-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
There was a problem hiding this 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.
src/widget/wbeatspinbox.cpp
Outdated
QKeyEvent backwardFocusKeyEvent = | ||
QKeyEvent{QEvent::KeyPress, Qt::Key_Backtab, Qt::NoModifier}; | ||
QApplication::sendEvent(this, &backwardFocusKeyEvent); | ||
auto* libraryFocusCO = ControlObject::getControl("[Library]", "focused_widget"); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
removes the KeyEvent hack from #4617