Early sneak peek - porting Karsten Lentzsch's magn...
# compose-desktop
k
Early sneak peek - porting Karsten Lentzsch's magnificent FormLayout to Compose Desktop.
🎉 4
🆒 1
❤️ 1
r
That's a name I haven't heard in a long time!
💯 1
k
He's still active, but as he's not sponsored by Sun / Oracle anymore, all his libraries have moved to closed source. The version I'm porting is from 2014-2015, which was the last available open source drop. We'll see how it goes after I'm done with the port. No promises on any of his new stuff.
It'll also need some cleanups to reconcile his usage of
dlu
(dialog units, something he "invented" before
dp
was a thing) with `dp`s.
r
Yeah I remember dlu, he borrowed that from Microsoft I believe?
Visual Basic had a similar concept
k
It was right around the time where higher density displays were becoming a thing. They were still super expensive (around $10K+) in mid-2000s, but it was clear that the age of 96ppi was over. pushing-pixels.org/wp-content/uploads/presentations/JavaOne2008HighResMonitors.pdf was the presentation I did at JavaOne in 2008 with Mike Swingler from Apple.
👍 1
d
Reading your presentation, it looks like
dlu
is closer to
sp
than
dp
.
k
Yes, Karsten's implementation is based on the default button font, the font metrics object, and averaging the character width across the English alphabet.
(At least in that last open source version)
This layout is very much for forms, driven by text content - labels, text fields, comboboxes. It would only make sense to scale all elements of the grid based on the font-based conversions.
👍 1
d
Maybe, you can use the same algorithm but based on the
LocalTextStyle
.
👍 1
k