Don't focus main panel spinboxes on mouse scroll #442
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some people have said they dislike how, when you scroll the mousewheel on the tempo/speed/step spinboxes, BambooTracker transfers focus from the pattern editor to the spinbox. As a result, you can't toggle edit mode or enter notes, until you click on the pattern editor again.
This changes the spinboxes so they don't acquire focus when scrolled.
It would be even better if clicking the spinbox arrows didn't focus the spinbox instead of the pattern editor, but I couldn't figure out how to make this work. If I call
QSpinBox::setFocusPolicy(Qt::NoFocus)
andlineEdit()->setFocusPolicy(Qt::StrongFocus)
, clicking the arrows (not the line edit) still focuses the line edit and unfocuses the pattern editor.Concerns
<height>24</height>
in the .ui file. Is this a problem?QSpinBox::lineEdit()
may be too verbose.Preventing the instrument list from stealing pattern editor focus?
It would also be nice if clicking the instrument list didn't defocus the pattern editor. I tried editing
BambooTracker/gui/mainwindow.ui
and changing it toQt::TabFocus
, which almost works. But when you click "rename", the pattern editor gets unfocused anyway, and the instrument list gets a text field with a selection. However you can't click on the instrument list to end the rename (clicking the order or pattern editor works). And when you press Enter to close the rename text field, then the instrument widget is focused anyway (not the pattern editor).I tried making
MainWindow::renameInstrument()
focus the instrument list before starting the rename, which didn't fix this. Is it too hacky to setui->instrumentList
toStrongFocus
when a rename starts, and back toTabFocus
when it ends?Fixes #441.