Bug 509380 - Hover border of ContextualHelpButton can be smaller than icon
Summary: Hover border of ContextualHelpButton can be smaller than icon
Status: CONFIRMED
Alias: None
Product: frameworks-kirigami
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: unspecified
Platform: openSUSE Linux
: NOR minor
Target Milestone: Not decided
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-09-11 12:31 UTC by Thomas Moerschell
Modified: 2025-09-18 21:38 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Border touching the icon (23.84 KB, image/png)
2025-09-11 12:31 UTC, Thomas Moerschell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Moerschell 2025-09-11 12:31:04 UTC
Created attachment 184889 [details]
Border touching the icon

SUMMARY

It is possible for the border that becomes visible when hovering over the button to have a smaller height than the icon itself. The example I found of that is in the kscreen KCM when a single refresh rate is available (see attached screenshot).

STEPS TO REPRODUCE
1. Open `kcmshell6 kscreen` or through system settings "Display Configuration"
2. Hover over the Refresh rate ContextualHelpButton (given only one is available)

OBSERVED RESULT
The icon is larger than the button border.

EXPECTED RESULT
The button border should completely enclose the icon. One could also make a case for it to be square.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20250909
KDE Plasma Version: 6.4.4
KDE Frameworks Version: 6.17.0
Qt Version: 6.9.2

ADDITIONAL INFORMATION

The relevant line seems to be https://invent.kde.org/frameworks/kirigami/-/blob/master/src/controls/ContextualHelpButton.qml#L73. A naive approach would be to remove that line, but I'm not sure of the implications of that. It could be that this would throw layout of parent objects off. For example if there are multiple lines, some with and some without helper buttons, the line height should still be constant. If this should taken care of by the framework users instead, I will be happy to open a MR at kscreen instead. Another option would be to shrink the icon if the parent is too small.
Comment 1 Nate Graham 2025-09-18 21:38:03 UTC
> It could be that this would throw layout of parent objects off
That's exactly what would happen, yeah.

I haven't had any brainy ideas for how to fix this generically. If yo have any ideas, feel free to explore them.