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

Don't focus main panel spinboxes on mouse scroll #442

Merged
merged 3 commits into from
Jun 17, 2022

Conversation

nyanpasu64
Copy link
Contributor

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) and lineEdit()->setFocusPolicy(Qt::StrongFocus), clicking the arrows (not the line edit) still focuses the line edit and unfocuses the pattern editor.

Concerns

  • I don't know why Qt Creator changed <height>24</height> in the .ui file. Is this a problem?
  • Calling 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 to Qt::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 makingMainWindow::renameInstrument() focus the instrument list before starting the rename, which didn't fix this. Is it too hacky to set ui->instrumentList to StrongFocus when a rename starts, and back to TabFocus when it ends?

Fixes #441.

@rerrahkr
Copy link
Member

rerrahkr commented May 23, 2022

Sorry for the late reply and thank you for your request.
It seems to work well as far as I can see.
I haven't been able to confirm the behaviour of the instrument list you mentioned, but if it doesn't seem easy to implement your idea, it may be better to leave it the way it behaves now.

Sorry, the conflict was caused by handling another issue. I can fix it if you like, but would you like to do it yourself?

@rerrahkr
Copy link
Member

There are a few compile errors, but I will fix them. Thank you for your contribution.

@rerrahkr rerrahkr merged commit fbb69ac into BambooTracker:master Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scrolling song settings/step spinboxes should not defocus pattern editor
2 participants