Improve keyboard navigation
AbandonedPublic

Authored by apol on May 10 2019, 2:22 PM.

Details

Reviewers
mart
Group Reviewers
Kirigami
Summary

Forward DelegateRecycler keyboard events to the actual delegate.
Have PrivateActionToolButton trigger its action if the mnemonic is activated.

BUG: 403711

Test Plan

I can navigate into applications in Discover

Diff Detail

Repository
R169 Kirigami
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 11731
Build 11749: arc lint + arc unit
apol created this revision.May 10 2019, 2:22 PM
Restricted Application added a project: Kirigami. · View Herald TranscriptMay 10 2019, 2:22 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
apol requested review of this revision.May 10 2019, 2:22 PM
mart requested changes to this revision.May 10 2019, 2:37 PM
mart added inline comments.
src/controls/private/PrivateActionToolButton.qml
100 ↗(On Diff #57865)

why p0?

having another shortcut here isn't nice, but is kinda necessary since how the desktop style paints the text in the button background

just remove p0

src/delegaterecycler.cpp
373 ↗(On Diff #57865)

this doesn't look right. especially because it will help with keyboard navigation, but not with accessibility at all.

The proper solutuion should be make DelegateRecycler a FocusScope (and i *think* setting activefocusontab to false tough not 100% sure now)

This revision now requires changes to proceed.May 10 2019, 2:37 PM
apol marked an inline comment as done.May 10 2019, 3:19 PM
apol added inline comments.
src/delegaterecycler.cpp
373 ↗(On Diff #57865)

DelegateRecycler can't be a FocusScope itself because QQuickFocusScope is private API.

We could put it in a FocusScope but then this opens a can of worms WRT sizes.

apol updated this revision to Diff 57870.May 10 2019, 3:19 PM

Remove unnecessary name

mart added inline comments.May 13 2019, 9:07 AM
src/delegaterecycler.cpp
373 ↗(On Diff #57865)

https://doc.qt.io/qt-5/qquickitem.html#Flag-enum

you can set the focusscope flag on top of any qquickitem, FocusScope is just an empty item that doesn't do anything that setting thjat flag in its ctor

QQuickFocusScope::QQuickFocusScope(QQuickItem *parent)
: QQuickItem(parent)
{

setFlag(ItemIsFocusScope);

}

apol updated this revision to Diff 58012.May 13 2019, 4:01 PM

Go for a more elegant approach: use Keys.forwardsTo and expose the item

apol added inline comments.May 13 2019, 4:02 PM
src/delegaterecycler.cpp
373 ↗(On Diff #57865)

I tried it, but it doesn't really make a difference, since the event was already being delivered to the item, the recycler, the problem was that the key stroke never reached the actual delegate.

I've changed it to use the declarative API, I think it looks more elegant.

apol abandoned this revision.May 29 2019, 3:04 PM