Revise librarycontrol // FocusWidget#4618
Conversation
b1504a2 to
63ee935
Compare
|
Alright, I tested all controls that were touched by this PR, as well as navigating menus and dialogs. |
63ee935 to
ca34bfe
Compare
|
There seems to be a kind of loop when the Mixxx window receives the focus, resulting in a flashing focus border. |
|
The rest works nice. Please give a hint when you consider this a ready for merge. |
Not intended at all, and I can't reproduce. Can you describe your scenario and which widget is flashing? |
ca34bfe to
92fff33
Compare
fwiw, I can't reproduce this either. |
|
Oh I have just notice that other Qt Apps are affected as well. So this it probably a Qt issue. |
5ed1f3b to
f87361f
Compare
|
Please let me know when someone starts a code review. |
f87361f to
3037d5d
Compare
| void setFocus() override; | ||
| void keyPressEvent(QKeyEvent* event) override; | ||
| void loadSelectedTrack() override; | ||
| void doubleClickSelectedTrack() override; |
There was a problem hiding this comment.
We shouldn't name signals like that. Double clicking only works computers with a mouse. It does not work on touchscreens (double tapping), it does not work on controllers (long press?).
How about something like triggerSelectedTrackSecondaryAction() or something like that?
Note: This is not a code review, feel free to force-push.
There was a problem hiding this comment.
Or is this a non-issue because this signal will never be emitted by using a touchscreen or a controller?
There was a problem hiding this comment.
I simply adjusted to the wording in Preferences > Library > Track Double-Click Action so that the connection is clear for developers.
- Controller mappings would use
[Library], GoToItem - Keyboards: Keyboard: Enter in library is double-click, change Preview shortcuts #4359
- I don't remember testing with a touch screen tbh, no idea how one can interact with the library. Depends on the OS and desktop environment IIRC.
3037d5d to
a60dcad
Compare
Emulated Shift+Tab sent to QApplication::focusWidget() moves the focus, THOUGH it also makes Shift get stuck for this widget. Actually, this wouldn't matter because Shift is released as soon as this widget receives any keyEvent with Qt::NoModifier. Though, [Playlist],selectTrackKnob doesn't use keyEvents, thus using it directly after [Library],MoveFocusBackward would expand the selection... Simply use BackTab key :)
a60dcad to
98033e6
Compare
|
For testing without controllers you can put abd1520 on top to have some debug output and skin feedback for FocusWidget. |
daschuer
left a comment
There was a problem hiding this comment.
LGTM, And works as expected. Thank you.
|
Great, I'll add the documentation when I'm back home. |
|
fixup 4f45dbe |
While testing #4465 I was looking for a way to reliably navigate the track menu with a push encoder, and it turned out my
FocusWidgetapproach in #4369 is complicated and not extendable to cover menus and dialogs.Here I revise the focus control:
focusChangedandfocusWindowChangedsignals. These are emitted every time the focused widget changes or when a new window/popup/menu is ready to receive keyboard presses, thus I could remove almost the entire former implementation.updateFocusedWidgetControls()FocusWidgettype, as well as the respective new state of[Library],focused_widget.FocusWidgetis now used by a few library controls to trigger context-specific actions -- this andLibraryControl::emitKeyEventis now much simpler, faster and less error-prone I reckonUpdated enum values of
[Library],focused_widget:TESTING
with controller:
Every
[Library]control should still work as expected.For testing the menu navigation, manually open a context menu or one in the main menu bar, then use
[Library],MoveVerticalto move the selection,[Library],GoToItemto activate items and confirm dialogs. Or put https://github.com/ronso0/mixxx/tree/open-track-menu-control on top of this branch.It's also possible to handle error messages and some compact dialogs with these controls, too.
without controller:
open developer tools, find
focused_widget, then click around in the main GUI and watch how the value changes accordingly, see enum above.