Bug 424446 - PC3 ToolButton retains visible focus after being clicked even when on a panel
Summary: PC3 ToolButton retains visible focus after being clicked even when on a panel
Status: RESOLVED FIXED
Alias: None
Product: libplasma
Classification: Frameworks and Libraries
Component: components (show other bugs)
Version: 5.72.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Marco Martin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-20 01:11 UTC by Nate Graham
Modified: 2022-10-16 15:13 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.74
Sentry Crash Report:


Attachments
How it looks after being clicked (7.11 KB, image/jpeg)
2020-07-20 01:15 UTC, Nate Graham
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2020-07-20 01:11:17 UTC
Porting the Color Picker applet to PlasmaComponents3, a visual regression is seen: clicking on one of the toolbuttons retains the focus ring for the toolbutton. This is what we want most of the time, but it's inappropriate when the applet is on a panel, as panel applets never get focus. Also, the focus ring looks ugly here because it never goes away, so you wind up with a random inaccurate focus ring on your panel.

Either we could do something fancy to detect this condition, or just add a property that will disable showing the focus ring when clicked.
Comment 1 Nate Graham 2020-07-20 01:15:52 UTC
Created attachment 130267 [details]
How it looks after being clicked
Comment 2 David Redondo 2020-07-20 07:35:01 UTC
Not only on a panel but also when the widget is on the desktop
Comment 3 David Redondo 2020-07-20 07:40:20 UTC
Also happens with toolbutton3.qml compared to toolbutton.qml
Comment 4 David Redondo 2020-07-20 07:51:35 UTC
The PC3 Button gains activeFocus while the PC2 Button doesn't
Comment 5 David Redondo 2020-07-20 08:14:28 UTC
One last note I think this is a fundamental difference in Quick Controls 1 and 2. 1 had activeFocusOnPress which defaulted to false while QQC2 gains focus on press (but not visualized in qqc2-desktop-style).
Comment 6 David Redondo 2020-08-11 06:58:36 UTC
Git commit 3e225d8664bc994bffbc3b10805162ae32da3734 by David Redondo.
Committed on 11/08/2020 at 06:58.
Pushed by davidre into branch 'master'.

Only draw the focus indicator when we got focus via the keyboard

QQC2 controls gain activeFocus on press this is a difference to controls 1
which had activeFocusOnPress property that defaulted to false. qqc2-desktop-style
also only sets the focus flag if it was gained via keyboard (kquickstyleitem.cpp:705).

M  +4    -2    src/declarativeimports/plasmacomponents3/ToolButton.qml

https://invent.kde.org/frameworks/plasma-framework/commit/3e225d8664bc994bffbc3b10805162ae32da3734
Comment 7 Bug Janitor Service 2022-10-08 14:39:53 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kdeplasma-addons/-/merge_requests/244
Comment 8 Fushan Wen 2022-10-16 15:13:27 UTC
Git commit f52c706be9c5e5262204bfcda3ed0567b6d8f019 by Fushan Wen.
Committed on 16/10/2022 at 15:11.
Pushed by fusionfuture into branch 'master'.

applets/colorpicker: port to `PC3.ToolButton` and `QtQuick.DropArea`
Related: bug 424448

A  +112  -0    applets/colorpicker/package/contents/ui/ColorCircle.qml     [License: GPL(v2.0+)]
M  +16   -105  applets/colorpicker/package/contents/ui/main.qml

https://invent.kde.org/plasma/kdeplasma-addons/commit/f52c706be9c5e5262204bfcda3ed0567b6d8f019