Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WBeatSpinBox/WEffectSelector: pass focus to tracks via focus CO #4845

Merged
merged 1 commit into from
Jul 7, 2022

Conversation

ronso0
Copy link
Member

@ronso0 ronso0 commented Jul 6, 2022

removes the KeyEvent hack from #4617

@ronso0 ronso0 added the ui label Jul 6, 2022
Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. I hope I will find time for a brief test as well.

QKeyEvent backwardFocusKeyEvent =
QKeyEvent{QEvent::KeyPress, Qt::Key_Backtab, Qt::NoModifier};
QApplication::sendEvent(this, &backwardFocusKeyEvent);
auto* libraryFocusCO = ControlObject::getControl("[Library]", "focused_widget");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be done at once via:
ControlObject::set(ConfigKey(Library]", "focused_widget"), static_cast(FocusWidget::TracksTable));
The cast should be double to avoid the implicit double conversion.
The same below.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, thank you!
I wonder why, in other places, we first get the CO, then check for !nullptr before setting it, while this is already implemented in ControlObject::set(). Example

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because ControlObject::set() has been introduced after the code was already there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah okay. So whenever I stumble over it I can safely replace it. Good to know.

Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works and looks good, Thank you.

@daschuer daschuer merged commit e6d6f0b into mixxxdj:main Jul 7, 2022
@ronso0 ronso0 deleted the move-focus-rework branch July 7, 2022 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants