Bug 431889 - Wrong fontsize on Keyboard Layout applet
Summary: Wrong fontsize on Keyboard Layout applet
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Keyboard Layout (show other bugs)
Version: 5.20.90
Platform: Archlinux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Andrey
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-21 19:40 UTC by sashalib31
Modified: 2021-02-09 21:42 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.21


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sashalib31 2021-01-21 19:40:26 UTC
SUMMARY
Fontsize is too small

STEPS TO REPRODUCE
1. Change panel size to arround 40-50


OBSERVED RESULT
Fontsize isn't changing accordingly to panel size

EXPECTED RESULT
Fontsize changes to fit the panel

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.20.90
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Comment 1 Andrey 2021-01-21 21:10:40 UTC
Thanks for reporting.
Please, provide information about resolutions you tested with.

Also, I thought your problem is the text size jumps when you change panel size,
but here you write it isn't changing.
Isn't it expected then, or earlier it behaved differently?
Comment 2 sashalib31 2021-01-22 05:26:11 UTC
(In reply to Andrey from comment #1)
> Thanks for reporting.
> Please, provide information about resolutions you tested with.
> 
> Also, I thought your problem is the text size jumps when you change panel
> size,
> but here you write it isn't changing.
> Isn't it expected then, or earlier it behaved differently?

Resolutions: 2560x1600, 1920x1080.
It is supposed to change fontsize accordingly to panel size (like the old X11 widget)
Comment 3 sashalib31 2021-01-22 13:00:14 UTC
STEPS TO REPRODUCE:
1. Change tray icon size setting to scale accordingly to panel
2. Change panel size higher than 32 (most noticeable on 46 and higher)
Comment 4 Nate Graham 2021-01-22 16:18:18 UTC
Resolutions are not relevant here. I think the issue is that the applet's compact representation is implemented as a toolbutton rather than the standard implementation.
Comment 5 Andrey 2021-01-22 17:48:22 UTC
Right, resolutions are not relevant.
Need to see if we can have Toolbutton's text scaled.
Comment 6 Nate Graham 2021-01-22 19:24:30 UTC
As I said, the correct fix is to stop using a ToolButton and use the same implementation for the applet's CompactRepresentation: that other applets use.
Comment 7 Andrey 2021-01-23 00:28:13 UTC
What do you mean exactly?
ToolButton was chosen for a reason, and what others applet use may not suit here.
Other applets are just an icons, and here we need text.
Alternative to ToolButton is AbstractButton, but it has it's own drawbacks.
If you have something other in mind, please tell.
Comment 8 Andrey 2021-01-25 12:56:35 UTC
Removing "wayland" Keyword. The applet might be loaded on panel (and other containments) in X11 also, and there will be the same problem.
Comment 9 Nate Graham 2021-01-25 15:48:32 UTC
(In reply to Andrey from comment #7)
> What do you mean exactly?
> ToolButton was chosen for a reason, and what others applet use may not suit
> here.
Consistency is important. If one applet uses a ToolButton as its compact representation but other don't, the UX differs between applets and we get bug reports (such as this one).

Various other applets have expanding text for their compact representations, such as the clock and weather applets. You might check out what they do.
Comment 10 Andrey 2021-01-25 20:58:57 UTC
Hi Nate,
I'm fully agree.
And sorry if my words sounded a bit sharp, this applet didn't come easy to me.

I guess current state needs a bit clarification.
ToolButton was chosen just as a stage on a road of applet's evolving. Some UI aspects were not clear to me, and ToolButton provided free effects I didn't know how to achieve otherwise. Also, it's used in lockscreen layout switcher.
Now I have a vision how to rework UI part, but this needs to be done consequently.
For fontsize problem, it doesn't really matter what component is used for the UI - whether it button or something else.
Consistency part will be addressed separately, and I've already got report about it - added to "See Also".

Eventually, new applet should get near the same look and feel as the old one. Somewhat better, somewhat worse. Just need some time to get there :)
Comment 11 Nate Graham 2021-01-25 22:26:03 UTC
Sure, as long as it's on the to-do list. :)
Comment 12 Bug Janitor Service 2021-02-09 16:17:16 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/342
Comment 13 Andrey 2021-02-09 21:39:52 UTC
Git commit f7bb44d05c81bd98df9d495dd93b02c6be41e086 by Andrey Butirsky.
Committed on 09/02/2021 at 16:14.
Pushed by ngraham into branch 'master'.

fix: Wrong fontsize on Keyboard Layout applet

We do "fontSizeMode: Text.Fit" so font could scale along with the item

M  +18   -0    applets/keyboardlayout/contents/ui/main.qml

https://invent.kde.org/plasma/plasma-desktop/commit/f7bb44d05c81bd98df9d495dd93b02c6be41e086
Comment 14 Nate Graham 2021-02-09 21:40:30 UTC
Git commit 5b9d4fd0fb6f3fe71873dd1d9d38c923dc19d82d by Nate Graham, on behalf of Andrey Butirsky.
Committed on 09/02/2021 at 21:40.
Pushed by ngraham into branch 'Plasma/5.21'.

fix: Wrong fontsize on Keyboard Layout applet

We do "fontSizeMode: Text.Fit" so font could scale along with the item


(cherry picked from commit f7bb44d05c81bd98df9d495dd93b02c6be41e086)

M  +18   -0    applets/keyboardlayout/contents/ui/main.qml

https://invent.kde.org/plasma/plasma-desktop/commit/5b9d4fd0fb6f3fe71873dd1d9d38c923dc19d82d