I’m creating a dashboard with fixed canvas layout with some standard library widgets like “oh-label-card” or “oh-slider-card”. I noticed that the vertical alignment of the content of these cards is different than wehn using these widgets in a fixed grid layout or layout page. “preserve classic style” is set to true. Is this intended behavior? If yes, how can the content be vertically centered?
Example of a grid layout (all contents are vertically centered within the cards):
I checked fixed canvas with oh-label-card with title/footer and without title/footer and oh-toggle-card on openHAB 5.0.x, 5.1.1 and current snapshot and it renders same everywhere. Furthermore, vertical alignment of labels inside with and without preserver classic style enabled and it looks the same on all three versions.
So at least it’s no regression.
Changing the alignment can surely be done, but we always have to keep in mind that this might break other people’s layouts.
First of all, thank you very much for the in-depth investigation of the problem and for proposing a way to fix it. Would this also “fix” the slider widget?
Perhaps the following questions can help point us in the right direction:
What is the reason that, in a fixed grid, the item content is vertically centered?
What is the goal of the “preserve classic style” option?
In my opinion, the widgets from the standard library are not really usable at all when working with a fixed canvas. They are not consistent with the row/column or fixed grid layout.
It looks better – I cannot say why some things in the UI have been designed the way they are, I wasn’t at all involved in Main UI’s initial creation.
That’s not really clear to me. What I am pretty sure is that this should preserver the card background. But should it also preserver the card height and vertical alignment??