-
Notifications
You must be signed in to change notification settings - Fork 89
[bluetooth] grow popup size until a configureable limit based on the number of devices #1245
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
base: master
Are you sure you want to change the base?
Conversation
|
Could you specify what unit it is in the docs? Like, pixels, centimeters, devices, bananas 😄 |
will do |
015f904 to
bb2f42a
Compare
|
Thanks for this. I'm going to hold off merging this until I have time to properly dig into the issue, because I feel like introducing more config options to resolve it is not the right way to go, especially pixel-based. |
|
I think this should also work (right after creating devices.set_max_content_height(grow_height_until);
devices.set_propagate_natural_height(true);Shame that |
|
Pros/cons of each approach? If we do go for this option btw, I'm thinking |
|
limiting the Or we only do this in case when scroll-able is enabled 🤷 |
I think Maybe https://github.com/JakeStanger/ironbar/wiki/volume#configuration |
Agreed with this |
bb2f42a to
082652c
Compare
implemented this. When revieweing you might probably see the |
| fn default() -> Self { | ||
| Self { | ||
| scrollable: true, | ||
| max_height: Some(330), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is 330 based on anything in particular?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a semi-useful number that I thing results in a good visual height.
And it has the effect, when the List is full the last Item will be chopped in half, which is indicating users clearly that the popup is scroll-able. (tested with bluetoothctl and scan on )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And it has the effect, when the List is full the last Item will be chopped in half, which is indicating users clearly that the popup is scroll-able.
This fully depends on styles - any font size, padding, margin or min-height changes can offset this. What was this tested against?
…e bluetoothbox, this adds a method to allow the box to grow until a limit of height is reached.
…agate_natural_height fn in combination with limiting max_content_height If you are wondering why negative values and 0 are interpreted as No Scrollbar - TOML doesnt provide a possibilty to overwrite a default, so if we would rely on toml and have a default != null it would NOT be possible to ever deactivate the scrollbars :/ This is a flaw/design decision by toml. And ofc here it makes sense to have scrollbar by default.
082652c to
e1cbed0
Compare
|
What is the tradeoff between limiting to number of devices and limiting to specific amount of pixels? I think the final choice will be relevant to some other modules too, e.g. #1050 (and as I just discovered it actually stops opening the popup once intended height approaches monitor height). |
I don't know how to translate between items and pixels. You can change the height of the entries via CSS and I maybe its also possible to have individual entries with different height than others. Do you have an algorithm in mind here ? |
|
Calculating the height reliably would be nigh impossible. It's possible to get the actual height after everything's rendered, but I can't imagine that's very useful. |
|
agree, @postsolar would you also be fine with a pixel version ? |
see issue #1186, though this does not fix the width problems