Bug 424228

Summary: The Search field has stopped displaying a frame when using a larger font size and display scaling
Product: [Applications] systemsettings Reporter: popov895 <popov895>
Component: sidebarviewAssignee: Marco Martin <notmart>
Status: RESOLVED FIXED    
Severity: normal CC: kde, nate, plasma-bugs-null, popov895, zrenfire
Priority: HI Keywords: regression
Version First Reported In: 5.19.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.20.0
Sentry Crash Report:
Attachments: Search field
Search field in the System Settings with font 11pt

Description popov895 2020-07-15 10:28:32 UTC
Created attachment 130137 [details]
Search field

SUMMARY

After one of the latest updates the search field has stopped displaying a frame when it has input focus. It seems that it appeared after updating to Frameworks 5.72 but I'm not sure. After some investigation I found that removing the code below fixes this issue for me:

> Layout.maximumHeight: Kirigami.Units.iconSizes.smallMedium + Kirigami.Units.smallSpacing * 2
https://invent.kde.org/plasma/systemsettings/-/blob/master/sidebar/package/contents/ui/CategoriesPage.qml#L64

The problem is that I use "Force font DPI" only (from "System Settings" > "Fonts" > "Fonts"). If I switch to use global DPI scaling (from "System Settings" > "Display and Monitor" > "Display Configuration"), the issue no longer exists.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: KDE neon 5.19 User Edition
KDE Plasma Version: 5.19.3
KDE Frameworks Version: 5.72.0
Qt Version: 5.14.2
Comment 1 popov895 2020-07-15 15:08:03 UTC
As can be seen in the screenshot, it affects not only the System Settings, but also the KInfoCenter and Discover.
Comment 3 Nate Graham 2020-07-16 03:43:24 UTC
As discussed in another bug report, this is a visual issue caused by abusing the Force Font DPI spinbox to to full-screen scaling. Supported methods are using the Qt scaling feature in the KScreen KCM (for large adjustments), or changing the font size directly (for small adjustments).
Comment 4 popov895 2020-07-19 10:20:24 UTC
Unfortunately, I have to reopen this bug, as it's reproduced if you just make the font size larger than the default. It doesn't depend on what DPI scaling you set.
Comment 5 popov895 2020-07-19 10:21:48 UTC
Created attachment 130235 [details]
Search field in the System Settings with font 11pt
Comment 6 Nate Graham 2020-07-19 14:53:30 UTC
Whoa weird, can reproduce.

Chris could you investigate? Thanks!
Comment 7 Chris Holland 2020-07-19 15:55:04 UTC
If the height is the problem, why is it not showing the left/right frame highlight?

* https://github.com/KDE/kirigami/blob/master/src/controls/SearchField.qml
* https://github.com/KDE/kirigami/blob/master/src/controls/ActionTextField.qml
* https://doc.qt.io/qt-5/qml-qtquick-controls2-textfield.html

Where's the Kirigami TextField "style"? Is it just using the QQC2.TextField defaults?

Also, why does the Kirigami.SearchField in Plasma Style show a highlight frame?

* https://github.com/KDE/plasma-desktop/blob/master/kcms/desktoptheme/package/contents/ui/main.qml#L64

$ locate CategoriesPage.qml
/usr/share/kpackage/genericqml/org.kde.systemsettings.sidebar/contents/ui/CategoriesPage.qml

Editing that file with:
Layout.maximumHeight: topPadding + contentHeight + bottomPadding // Shows frame
Layout.maximumHeight: topPadding + contentHeight + bottomPadding - 1 // Doesn't show frame

So the bug is that CategoriesPage.qml assumes the `iconSizes.smallMedium` is taller than the text of the SearchField, which isn't always the case.

Eg: https://i.imgur.com/5GPkrYl.png
Comment 8 Nate Graham 2020-07-19 17:09:20 UTC
Oh goodness, all that crazy sizing code is just not needed at all. Will fix.
Comment 9 Bug Janitor Service 2020-07-19 17:20:18 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/systemsettings/-/merge_requests/5
Comment 10 Nate Graham 2020-07-19 19:56:35 UTC
Git commit e711edd7a8592d1dd789ef9782de53d4726f3262 by Nate Graham.
Committed on 19/07/2020 at 17:13.
Pushed by ngraham into branch 'master'.

[sidebar view] Remove size hacks for toolbar items

The heights of these items are all bound together to keep them the same
height, but this is the wrong way to do it; instead, the QQC2 styling
for these controls should automatically take care of ensuring consistent
heights, as I recently did for the PlasmaComponents3 versions in
https://invent.kde.org/frameworks/plasma-framework/-/commit/e607c1ae470acd526c8a0a0d8323e878e8be55e8.

These hacks have caused a bug when the font size is increased. Let's remove
the size hacks and fix the sizing properly in the style itself.
FIXED-IN: 5.20.0

M  +0    -6    sidebar/package/contents/ui/CategoriesPage.qml

https://invent.kde.org/plasma/systemsettings/commit/e711edd7a8592d1dd789ef9782de53d4726f3262