Bug 433028 - Header for QWidgets KCMs not aligned with sidebar header
Summary: Header for QWidgets KCMs not aligned with sidebar header
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: sidebarview (show other bugs)
Version: 5.21.2
Platform: Neon Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Marco Martin
URL:
Keywords: regression
: 433825 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-02-16 20:16 UTC by David C
Modified: 2021-07-28 09:26 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.22


Attachments
QWidgets KCM renders header differently from systemsettings (5.49 KB, image/png)
2021-02-16 20:16 UTC, David C
Details
header problem (2.26 MB, video/mp4)
2021-04-04 23:00 UTC, medin
Details
System Settings header alignment problem (2.41 MB, video/mp4)
2021-07-22 21:35 UTC, medin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David C 2021-02-16 20:16:32 UTC
Created attachment 135733 [details]
QWidgets KCM renders header differently from systemsettings

The header or title area for QWidgets KCMs are not flush with the systemsettings header. The difference is just a few pixels but is noticeable.

I'm using Breeze and Noto Sans 10, but the same bug was reproducible for users of Kvantum themes and other application styles.


STEPS TO REPRODUCE
1. Be on Plasma 5.21.0 and Frameworks 5.79.0
2. Open systemsettings
3. View a module like Energy Saving or KDE Connect

See attachment for the graphical error caused by this bug.

SOFTWARE/OS VERSIONS
KDE Neon User
KDE Plasma Version: 5.21.0
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2
Comment 1 Nate Graham 2021-02-16 20:24:03 UTC
Confirmed for QWidgets KCMs. I'll see if I can fix it.
Comment 2 Nate Graham 2021-02-16 21:38:42 UTC
The issue here appears to be somewhere in the QML header injected in kcmutils:src/kcmoduleqml.cpp. I tried making the calculation the same as the one in System Settings' sidebar headers but that didn't work. :(

Could you help, Marco?
Comment 3 Ismael Asensio 2021-02-20 09:49:43 UTC
Git commit a31fa7a45b3010683bf8cb31c138d3e5ef14a0e1 by Ismael Asensio.
Committed on 20/02/2021 at 07:41.
Pushed by iasensio into branch 'master'.

[sidebarmode] Fix header height for QWidget KCMs

Take the height value from the sidebar header and set it to the
custom QWidget header, so both headers look aligned.

There was a helpful method already set-up for this, but not used
before.
FIXED-IN: 5.21.1

M  +3    -0    sidebar/SidebarMode.cpp
M  +2    -1    sidebar/package/contents/ui/main.qml

https://invent.kde.org/plasma/systemsettings/commit/a31fa7a45b3010683bf8cb31c138d3e5ef14a0e1
Comment 4 Ismael Asensio 2021-02-20 09:58:54 UTC
Git commit 48fecba07b5ec361a5c2be8d8892adcb93901e0e by Ismael Asensio.
Committed on 20/02/2021 at 09:55.
Pushed by iasensio into branch 'Plasma/5.21'.

[sidebarmode] Fix header height for QWidget KCMs

Take the height value from the sidebar header and set it to the
custom QWidget header, so both headers look aligned.

There was a helpful method already set-up for this, but not used
before.
FIXED-IN: 5.21.1

Cherry-picked from: a31fa7a45b3010683bf8cb31c138d3e5ef14a0e1

M  +3    -0    sidebar/SidebarMode.cpp
M  +2    -1    sidebar/package/contents/ui/main.qml

https://invent.kde.org/plasma/systemsettings/commit/48fecba07b5ec361a5c2be8d8892adcb93901e0e
Comment 5 Nate Graham 2021-02-20 20:48:56 UTC
Fixed for Breeze with those commits.

Other styles may require other fixes, which will be dome separately.
Comment 6 Nate Graham 2021-03-02 19:11:48 UTC
This seems to be back again, or maybe it was never truly fixed in the first place. :( Alignment seems to be perfect for me when using 11pt Noto Sans, but with the default 10pt, they are mis-aligned.
Comment 7 Nate Graham 2021-03-02 19:11:59 UTC
*** Bug 433825 has been marked as a duplicate of this bug. ***
Comment 8 Nate Graham 2021-03-02 19:12:55 UTC
Raising priority as this is simultaneously really small and insignificant but also incredibly stupid looking and impossible to miss once you notice it.
Comment 9 Marco Martin 2021-03-16 09:35:39 UTC
what are dpi and scale factor here can't reproduce neither with 10 nor 11 pt with noto
Comment 10 Nate Graham 2021-03-16 10:24:27 UTC
200% scale
Comment 11 David Edmundson 2021-04-04 22:30:57 UTC
Cannot reproduce with trying all sorts of settings including a clean VM.

I didn't check the maths behind both sizes, but if this is hittable except in extreme situations it's definitely not VHI at that point.

Please can you also confirm it's still valid.
Comment 12 medin 2021-04-04 22:59:28 UTC
(In reply to David Edmundson from comment #11)
> Cannot reproduce with trying all sorts of settings including a clean VM.
> 
> I didn't check the maths behind both sizes, but if this is hittable except
> in extreme situations it's definitely not VHI at that point.
> 
> Please can you also confirm it's still valid.

I confirm the problem is still present but not in all places, the mysterious thing is that the same header appears incorrectly vertically aligned but after some navigation it appears correctly, and the cause is when I jump from a page with 3 columns to another with 2 columns. The same happens with Info center interface. See attached video for more info.
Comment 13 medin 2021-04-04 23:00:47 UTC
Created attachment 137337 [details]
header problem
Comment 14 Nate Graham 2021-04-05 15:46:05 UTC
With current git master, I cna no longer reproduce the issue with Noto Sans 10, which I was able to reproduce before. Perhaps Ismael's patches fixed it.

Medin, any chance you can try with git master/unstable packages?
Comment 15 medin 2021-04-18 21:49:12 UTC
(In reply to Nate Graham from comment #14)
> With current git master, I cna no longer reproduce the issue with Noto Sans
> 10, which I was able to reproduce before. Perhaps Ismael's patches fixed it.
> 
> Medin, any chance you can try with git master/unstable packages?

With 5.21.4 the problem is still present. I can't install git version (it wants to pull all others git plasma packages).
Comment 16 Nicolas Fella 2021-04-19 22:13:08 UTC
I can confirm this is fixed in current master
Comment 17 medin 2021-07-15 12:32:53 UTC
The problem is still present on 5.22.3
Comment 18 Nate Graham 2021-07-22 15:46:43 UTC
Cannot reproduce with 10pt or 11pt Noto Sans with 200% scaling and the font DPI unchanged from its default value.

Please mention which font, scaling, and DPI settings you're using.
Comment 19 medin 2021-07-22 21:31:05 UTC
(In reply to Nate Graham from comment #18)
> Cannot reproduce with 10pt or 11pt Noto Sans with 200% scaling and the font
> DPI unchanged from its default value.
> 
> Please mention which font, scaling, and DPI settings you're using.

I use Noto Sans font and size 9pt, scaling 100% and dpi 96, see attached video for more info.
NB :  The same happens with size of 10pt.
Comment 20 medin 2021-07-22 21:35:52 UTC
Created attachment 140266 [details]
System Settings header alignment problem
Comment 21 Nate Graham 2021-07-24 02:16:51 UTC
Thank you for the video. I still cannot reproduce the issue with your exact settings shown in the video and those exact KCMs (except for the >anjaro-specific ones, because I'm not using Manjaro). I must therefore assume that either this issue has already been fixed in the git master version of Kirigami or System Settings, or there is a Manjaro-specific problem. Dunno if there's anything more I can do here, sorry.
Comment 22 medin 2021-07-28 09:26:47 UTC
Weird, I had two accounts created from 5.20 and both suffered from this problem, but now after creating new one it seems the problem is fixed, I think some config files are not applied to old accounts after upgrading to 5.22. In fact this trick solved many problems for me in the past (especially with baloo) but the cost to reconfigure all plasma desktop, widgets and apps is really fastidious.