Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Granite.Clamp #623

Open
danirabbit opened this issue Sep 9, 2022 · 1 comment
Open

Granite.Clamp #623

danirabbit opened this issue Sep 9, 2022 · 1 comment
Labels
Needs Design Waiting for input from the UX team

Comments

@danirabbit
Copy link
Member

Problem

Something I’m having to add LibAdwaita for basically every repo is Adw.Clamp. This container widget allows you to set a maximum width whereas Gtk only allows you to set a minimum width. This is super helpful for making sure lists for example can be scaled down, but don’t continue to fill horizontal space on super large monitors which ends up making them more difficult to use

Proposal

We should probably have a Clamp implementation so we don’t need to add a dep just for this feature if Adw isn’t needed otherwise

While we’re at it I’d like to look into why Adw uses pixels instead of chars for it’s values

Prior Art (Optional)

Adw.Clamp! It’s Clamp. It’s got the juice! https://valadoc.org/libadwaita-1/Adw.Clamp.html

@danirabbit danirabbit added the Needs Design Waiting for input from the UX team label Sep 9, 2022
@leggettc18
Copy link

It looks like in libadwaita 1.4 Clamp now has a "unit" property, which defaults to pixels but can be set to "points" which scale with the text factor. It does add another type of object into the mix though with Adw.LengthUnits. Using Pixels does have benefits when it comes to non-text content like images, and even with text in the context of mobile, where you wouldn't want a widget to take more horizontal space when the text is scaled up due to the constrained screen width you have to deal with.

I'm interested in taking a stab at porting clamp, I have some experience since I ported Adw.Avatar for a project of mine recently. Would we want Granite.Clamp to have this ability to switch between pixels and points or would we just want to pick one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Design Waiting for input from the UX team
Projects
None yet
Development

No branches or pull requests

2 participants