Bug 464160 - Use of Kirigami.ActionToolBar makes various UI elements not triggerable with enter/return keys
Summary: Use of Kirigami.ActionToolBar makes various UI elements not triggerable with ...
Status: CONFIRMED
Alias: None
Product: Elisa
Classification: Applications
Component: general (show other bugs)
Version: 22.12.1
Platform: openSUSE Linux
: NOR minor
Target Milestone: ---
Assignee: Matthieu Gallien
URL:
Keywords: accessibility, usability
Depends on:
Blocks:
 
Reported: 2023-01-11 17:18 UTC by Jack Hill
Modified: 2023-01-13 13:55 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jack Hill 2023-01-11 17:18:35 UTC
SUMMARY
Can't open the 3-dot menu in the following two places:
* footer of the Now Playing view
* footer of the Playlist sidebar

STEPS TO REPRODUCE
1. Press tab until the menu button is highlighted
2. Press enter

OBSERVED RESULT
Nothing happens

EXPECTED RESULT
Menu should open

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20230109
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.7
Kernel Version: 6.1.3-1-default (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2023-01-11 18:36:44 UTC
In all of these cases, the 3-dot menu comes from Kirigami.ActionToolbar. That component uses standard Qt focus rules, i.e. "trigger the focused item with the spacebar." However that doesn't work for Elisa since we globally bind the spacebar to "Play/pause" and require the use of the enter/return key instead. We override this for other controls.

Me may need new API from ActionToolbar here, or else to port away from that component. Which would be a shame, since it's nice and it solved various other problems we had.

Thoughts, Arjen?
Comment 2 Arjen Hiemstra 2023-01-11 19:27:50 UTC
I recall Noah working on a patch to Qt so that enter could also be used to trigger controls. I don't recall whether it got merged or not though. That said, worst case we can do a workaround in Kirigami to also make it possible to trigger menus with enter, as I personally think it makes sense.
Comment 3 Noah Davis 2023-01-12 16:37:50 UTC
(In reply to Arjen Hiemstra from comment #2)
> I recall Noah working on a patch to Qt so that enter could also be used to
> trigger controls. I don't recall whether it got merged or not though. That
> said, worst case we can do a workaround in Kirigami to also make it possible
> to trigger menus with enter, as I personally think it makes sense.

The Qt patch is already completed and backported to Qt5. It's a thing that would need to be configurable though and figuring out where to allow configuring it is a bit of an issue. Maybe keyboard options KCM?
Comment 4 Nate Graham 2023-01-12 16:39:30 UTC
In this case we want to turn it on for Elisa 100% of the time, because the spacebar never works in Elisa to trigger focused UI elements because we made it a global play/pause action. Can we force it on for individual apps?
Comment 5 Noah Davis 2023-01-12 16:44:19 UTC
(In reply to Nate Graham from comment #4)
> In this case we want to turn it on for Elisa 100% of the time, because the
> spacebar never works in Elisa to trigger focused UI elements because we made
> it a global play/pause action. Can we force it on for individual apps?

It's implemented as part of the QPlatformTheme. My first thought is you'd need to make a custom QPlatformTheme for Elisa, which would be mad, but I don't really know. Maybe there could be something with private dynamic properties that the platform theme could read from the app and choose the correct behavior. More hacks piled on top, but it's not the worst thing ever.
Comment 6 Nate Graham 2023-01-12 16:48:14 UTC
That does sound crazy; I'd prefer an API in Kirigami.ActionToolBar to say "trigger on enter/return as well" and then when this option is globally enabled in Qt, that defaults to on.
Comment 7 Noah Davis 2023-01-13 01:50:39 UTC
(In reply to Nate Graham from comment #6)
> That does sound crazy; I'd prefer an API in Kirigami.ActionToolBar to say
> "trigger on enter/return as well" and then when this option is globally
> enabled in Qt, that defaults to on.

globally enabled in Qt? you still mean only in the scope of the app, right?
Comment 8 David Redondo 2023-01-13 12:45:14 UTC
Would it be possible to change Elisa so Spacebar is not done globally but only when nothing is focused? Or is something always focused?
Comment 9 Arjen Hiemstra 2023-01-13 13:46:55 UTC
Is there a reason we wouldn't just set the property to activate on enter globally in the Plasma platform theme?
Comment 10 Nate Graham 2023-01-13 13:55:36 UTC
(In reply to David Redondo from comment #8)
> Would it be possible to change Elisa so Spacebar is not done globally but
> only when nothing is focused? Or is something always focused?
We had that in the past and it was not good. Nobody liked it. Elisa has a lot of focusable controls and list items, so it was very common for something to become focused and then the spacebar did something unexpected.