-
-
Notifications
You must be signed in to change notification settings - Fork 241
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
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 <jcode@tanagra.id.au>
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
I'm back! I had a look at this again, rebased my branch and recompiled without any changes, and I can't see any problems. In your screenshot above, is it the "Espa..." that you think behaves the wrong way? IMO, it's correct because the last button wouldn't fit in one line. Yes, after it's wrapped, it "seems" that there is a lot of space but it's just not quite wide enough to accommodate that button. |
Bot at all! The current problem is that now all my labels are truncated and only 3 or four characters are shown. This happens even when there is a lot of place to show the full label. Look at my screenshot, except for the label "NR", all others are truncated. |
I tried but cannot reproduce this. Can you paste me a sitemap that I can use to test it? |
did this happen on this branch's build but not on the main milestone / snapshot? If so, can you please provide a sitemap for me to test, along with details about your basicui settings. |
Wait! False Alarm. This problem has nothing to do with your adaptions in the Basic UI. |
Ok, here is how to reproduce the problem in IDE with the Demo sitemap. Update the demo sistemap by adding two new elements:
Starts openHAB. Here is the initial rendering that is fine for labels and buttons rendering: Now click on DemoSwitchGroup to open the sub page and go back to the main page. Here is the new rendering with truncated labels and different dispatching of buttons on the two lines ! Now click Ctrl+F5 and the initial and correct rendering is back. It is not specific to browser, I reproduce it with Firefox and Chrome. |
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
b67ff21
to
8f5eaac
Compare
It seems that onload event didn't fire when navigating to a subpage (Text element) and back. I've added an extra call to run minimizeWidth immediately. |
My tests with my current sitemap in production are all positive now. Will run again tests with specific cases leading to your changes in september and start again a final review. |
Done. Remains to do a new quick review. |
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.
LGTM, thank you
I will have to check if this does not impact the new buttons containing a square color (Colorpicker and Colortemperaturepicker widgets). |
Thank you @jimtng for this work and your patience. |
Let me know how to reproduce that and I'll have a play with it. It'd be much easier (I hope) now that this is merged, thanks! |
With the following element:
Select the second button to have a value and on a a phone, set bigger font as preference. |
Yes, exactly |
Before:
After: