Skip to content

resources: main: Correctly scale and wrap text in slider items#12

Merged
mschwan-phytec merged 3 commits intomainfrom
wip-main-page-scaling
Oct 20, 2023
Merged

resources: main: Correctly scale and wrap text in slider items#12
mschwan-phytec merged 3 commits intomainfrom
wip-main-page-scaling

Conversation

@mschwan-phytec
Copy link
Copy Markdown
Collaborator

Correctly scale and wrap the text in the main page's slider items. Also prevent the items' header text from being elided. This text should be always readable. Only the longer description text may be elided.

Shrink the default window size to 640x480 pixels allowing smaller displays to correctly display the application.

Shrink the default window size to 640x480 pixels allowing smaller
displays to correctly display the application.

Signed-off-by: Martin Schwan <m.schwan@phytec.de>
Use the full, correct scheme for loading the resource in FontLoader.

Signed-off-by: Martin Schwan <m.schwan@phytec.de>
@mschwan-phytec mschwan-phytec added the enhancement New feature or request label Oct 18, 2023
Comment thread resources/main.qml
text: icon
color: PhyTheme.teal1
font.family: icons.font.family
font.pointSize: Math.max(0.05 * parent.width, 48)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This icon feels too small for me. I would leave it as it is.

Comment thread resources/main.qml
color: PhyTheme.white
font.pointSize: Math.max(0.015 * parent.width, 24)
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, it looks too small for me:
20231019_080753 (1)

Suggested change
Layout.fillWidth: true
font.pointSize: Math.max(0.015 * parent.width, 24)
horizontalAlignment: Text.AlignHCenter
Layout.fillWidth: true

With suggested changes, it looks like this:
20231019_085115 (1)
This is on a 800x480 display, what do you think?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have mentioned that I plan to use Qt's global scaling mechanisms to adjust the application's font sizes, instead of manually tweaking each label. This has also the benefit of other elements and controls scaling proportionally.

Could you try running qtphy with QT_SCALE_FACTOR=2 and see if that looks better?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've also changed the cards' name label styling to use horizontalAlignment: Text.AlignHCenter as you suggested, and applied HTML header styling to it. That should do the trick without worrying about exact font sizes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is better now. Does it make sense to make a card name appear bigger than the description?
20231019_095851

Tried bold name, but IMHO it is not really a sufficient change.
20231019_100636

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please refetch the latest changes and test again.

Correctly scale and wrap the text in the main page's slider items. Also
prevent the items' header text from being elided. This text should be
always readable. Only the longer description text may be elided.

Signed-off-by: Martin Schwan <m.schwan@phytec.de>
@andrejpicej
Copy link
Copy Markdown
Contributor

Nice, it look better now (with 1.6 scale factor):
20231019_101705

Thanks.

@andrejpicej
Copy link
Copy Markdown
Contributor

Using this scale factor is fine for scrolling through the tiles, but also every page gets scaled. On some pages this means that they are not really useable. Did you also notice this?

@mschwan-phytec
Copy link
Copy Markdown
Collaborator Author

What do you mean by "not usable"? Can you give an example?

I observed that the image viewer displays the actual images a little too small and the device information does not allow scrolling. Do you mean something like that?

@andrejpicej
Copy link
Copy Markdown
Contributor

Yes image viewer problem and for example, the widget factory gets scaled too much, so you have to scroll left to right to see all widgets. So it looks to me that the tiles icons and text are not really in proportion with the pages. Either we get pages that are scaled too much or tiles that are too small.
(complete display with 1.6 scale)
20231019_105858

Can we disable scaling for pages (or at least for some pages)? If you are using different screen size the results might be different/ok.

@mschwan-phytec
Copy link
Copy Markdown
Collaborator Author

mschwan-phytec commented Oct 19, 2023

I see. The correct way to solve this would be to create our own QML style with adjusted paddings and sizes. Unfortunately, for the i.MX8M release we won't be able to fix this in time. Before the i.MX93 release we will also try and fix this. But for now, is it okay, if we merge it as is?

@mschwan-phytec mschwan-phytec added this to the 0.2.1 milestone Oct 19, 2023
@mschwan-phytec mschwan-phytec self-assigned this Oct 19, 2023
Copy link
Copy Markdown
Contributor

@andrejpicej andrejpicej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is okay for now. And lets finalize the scaling stuff before the next i.MX93 release

@mschwan-phytec mschwan-phytec merged commit d2436c1 into main Oct 20, 2023
@mschwan-phytec mschwan-phytec deleted the wip-main-page-scaling branch October 20, 2023 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants