-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
[BasicUI] Align and optimize available space for switch with mappings #2388
base: main
Are you sure you want to change the base?
Conversation
The idea was to keep a minimum of place for label and value. |
Your commit of vscode settings is probably unexpected ? |
a82ace5
to
12dd98f
Compare
I haven't tested this with various widths of labels.
oops, removed now. |
Using 4.2 M1, I can see that I have to increase the zone for buttons to not have controls for a Player item cut on 2 lines on a phone. And I also see that the buttons in the new settings page are not rendered perfectly on a phone when cut on 2 lines. |
I haven't had a chance to look into this yet, and I'm generally clueless with css. If you have a fix, feel free post it and close this PR. Ideally, the buttons can take up as much horizontal space as possible, especially when there are no labels or the label is short. This way user can set a blank label to maximise the space for the buttons. But when there's a label, then reserve some space for the label. |
I would like to find the proper CSS properties to at least have player controls always on one line when there is enough place for that. |
The solution would probably include changing the css of the labels and/or the container. |
Original post updated with the latest result. |
12dd98f
to
1d8ccf5
Compare
@lolodomo this still reserves some space for the label / value, but also tries to make the buttons take up as much space as possible, but if it must wrap into multiple lines, maximise the space for the label again. See the original post with updated screenshots |
For anyone interested in testing, you can put this jar file in your addons folder, then disable the built in Note: rename the file and remove the .txt extension. |
Make sure you do a force refresh (Cmd+Refresh on mac, shift+reload or something - depending on your browser). |
I did a refresh (Shift+F5 on Windows). |
I suspect it hasn't fuly refreshed. What's your O/S, browser version? I'll try it on BrowserStack |
The difference is, I think, I use a much smaller window. Thats for me the whole point. I like the window as small as possible to put it right side of my screen to keep it visible. |
Can you show a screenshot of the smallest browser window where one button moved to a second line? And the smallest on one line please? |
Signed-off-by: Jimmy Tanagra <[email protected]>
Apparently (using dev tools), the size for the widget is a little bigger in case of Chrome: 507.86 vs 506.667 in Firefox. |
I take a look on the possible impact of your changes regarding mdl-form__row for a Buttongrid and a Chart. With your change (condensed layout): Before your change (condensed layout): In non condensed layout (with out without your change): Note that the issue is global to any widget, not specific to Buttongrid or Chart. |
My tests with my usual sitemap are finished and the only bug that remains is the re-introduction of the bug with the Player item (display of button,s forced on one line) that can lead to buttons moved too much to the right and overriding the widget at right. I will provide a sitemap to reproduce it but a simple Payer item should be sufficient to reproduce it when in non condensed layout. Setting bigger font option shows even more the problem. |
The additional tests I would like to execute are when the value is displayed at left of the buttons and when icons are used inside buttons (check that button width is then still as expected). |
Could you please provide a sitemap for me to test?
I also need a sitemap to show this issue. |
I found what is your change that re-introduced the bug, it is a direct consequence to set min-width to 5em for the label. We are in the case that this minimum is too much and there is then no enough place to show the 4 player buttons. It is exactly what I said in my comment about this adding of a min width, we have to be sure that it is without any wrong consequence on any widget. It has one with the Player item. Can you tell me if there is a real need to add such minimum width for the label ? |
In case it is usefull for multiline buttons, why not rather setting it only in JavaScript code and only for this widget when we are in multilines mode ? |
min-width for label is absolutely needed for the multiline buttons, because we removed the max-width on the buttons. Would reducing the min-width work for the player? I would prefer that than setting it in javascript (or css) only for multiline buttons. I don't care what it's reduced to, as long as it's set to something that's not too small that would cause the labels to be unreadable. |
Ok
Not sure to understand why you prefer this option.
I should then experiment what could be a reasonable value. |
@lolodomo in the latest change, I only set the min-width for multiline buttons. Could you please test it against the player item? |
Very good option. I will tell you if it works but I am already sure it will. |
|
Typo at line 235: you used $ intsead of & |
Signed-off-by: Jimmy Tanagra <[email protected]>
8476281
to
a0da860
Compare
Thanks! I was scratching my head! |
What is strange is that the build was not failing despite this error. This is something we have to fix (in another PR). |
The bug is fixed, the rendering of the player item is fine on my phone either in portrait or paysage (2 columns) modes whatever the values of "condensed layout" and "bigger font size" parameters. To be precise, it is still possible to reproduce the bug but it is not the consequence of any of your changes, it was already possible before. On a desktop screen with 3 columns, if you reduce the window width, at a certain time there is no more place to display the label at all and the buttons start to shift to the right to be fully rendered. In fact, the solution would be to use multiline buttons once there is no more place for the label. But this problem will be encountered in very rare cases so I propose to ignore it at this time. Another PR could be added later to switch from mono-line to multi-line in the JavaScript when the label size is 0. |
When using icons in buttons, I have a cut in two lines when it could be displayed on one line (was before your change). Buttons with text on the first widget at left are on one line while the buttons take more place than with icons. Before: Sitemap:
This is in non condensed layout with standard font size. |
Another annoying case: look at the widget on last line in the middle. Its size is bigger than expected at left and right. On my phone, I can see that it can also happen even without the display of the value, that is for the widget just before (last line at left). This is in non condensed layout with bigger font size. Before: Sitemap:
|
I'm investigating this
It seems that the "after" has a min-width that's wider than the "before". The advantage is we can read more of the label, at the expense of a narrower space for the buttons. If you prefer to sacrifice the space for the label, then we can simply reduce the min-width.
Can you please clarify this? |
Look at the alignment of icons at left and the buttons at right. They are no more aligned. |
OK this one is solved and will be in the next commit. When using (some types of) icons, the icons weren't loaded yet when the minimizeWidth() was initially executed, resulting in an incorrect calculation.
This is a result of the label's min-width. If you compare to "before" notice the label's size was smaller to compensate. However, try make your button even wider, e.g.
Even the "before" will also suffer the same problem, although the "after" version is worse because buttons have no max-width to limit it. I'm not sure of the best way to solve this because either way, something needs to either be truncated, or pushed around. Perhaps truncation is better because it won't affect the neighbouring controls. |
Yes I believe. |
Signed-off-by: Jimmy Tanagra <[email protected]>
Signed-off-by: Jimmy Tanagra <[email protected]>
@lolodomo please test the latest changes |
@jimtng : the last version is worst I think because now labels are truncated even when there is place to not truncate them. Maybe we should switch to your previous version which was not so bad even if not perfect. WDYT ? |
Before:
After: