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

Palettes: Implement Type-Ahead Find with incremental search #5829

Merged
merged 2 commits into from
Apr 29, 2020

Conversation

shoogle
Copy link
Contributor

@shoogle shoogle commented Mar 18, 2020

Resolves: no issue in tracker

If the user presses a letter key while in the Palettes tree then a matching palette or cell gains focus. E.g. Press 'L' to jump to the Lines palette.

Pressing multiple keys in quick succession enables incremental search. E.g. Press 'A' shortly followed by 'R' to skip Accidentals and go straight to Articulations.

Pressing the same key repeatedly cycles through matching items. E.g. 'T' => Time Signatures, 'T' => Text, 'T' => Tempo, 'T' => Time Signatures, etc.

  • I signed CLA
  • I made sure the code in the PR follows the coding rules
  • I made sure the code compiles on my machine
  • I made sure there are no unnecessary changes in the code
  • I made sure the title of the PR reflects the core meaning of the issue you are solving
  • I made sure the commit message(s) contain a description and answer the question "Why do those changes fix that particular issue?" or "Why are those changes really necessary as improvements?"
  • [N/A] I made sure the commit message title starts with "fix #424242:" if there is a related issue
  • [N/A] I created the test (mtest, vtest, script test) to verify the changes I made

@MarcSabatella
Copy link
Contributor

I know I can find out if I build this, but, what happens if I type "Treble" - do I get a treble clef, or does the "T" get "eaten" by the code jumpng to the time signature palette? Also, I assume this code is only active when not in the search box, so regular search behavior isn't affected?

@shoogle
Copy link
Contributor Author

shoogle commented Mar 19, 2020

what happens if I type "Treble" - do I get a treble clef, or does the "T" get "eaten" by the code jumpng to the time signature palette?

If you are on the palettes then it will take you to a palette. If you are within a palette then it will take you to an item within that palette. In other words, you cannot type "treble" and expect to get a treble clef unless you are already in the clefs palette.

This is slightly different to how type-ahead find usually works in a tree view. Normally you are able to jump to other levels of the tree, but only if they have previously been expanded (i.e. you can jump to any item that is currently visible). I'm not sure how useful that behaviour is, especially given that we already have search to take you straight to an item.

See the template chooser in the New Score Wizard for an example of the conventional behaviour. Make sure the template tree has focus and not the searchbox.

Also, I assume this code is only active when not in the search box, so regular search behavior isn't affected?

Correct.

@anatoly-os
Copy link
Contributor

@shoogle have you had a chance to test this PR on macOS and Windows? Focus doesn't work for me on macOS as you explained in the description of this PR. Typing "L" doesn't make "Lines" palette focused.

@shoogle
Copy link
Contributor Author

shoogle commented Apr 28, 2020

@anatoly-os, I've only tested on Windows so far and it worked there. I will try on Linux and macOS.

@shoogle shoogle force-pushed the qml-palette-mnemonics branch from 6d147ce to 5fc83ae Compare April 28, 2020 15:34
shoogle added 2 commits April 28, 2020 18:36
If the user presses a letter key while in the Palettes tree then a matching
palette or cell gains focus. E.g. Press 'L' to jump to the Lines palette.

Pressing multiple keys in quick succession enables incremental search. E.g.
Press 'A' shortly followed by 'R' to skip Accidentals and go straight to
Articulations.

Pressing the same key repeatedly cycles through matching items. E.g. 'T' =>
Time Signatures, 'T' => Text, 'T' => Tempo, 'T' => Time Signatures, etc.
Fixes a bug where pressing certain keys in the Palettes would trigger
application shortcuts defined in Preferences.

For example, the user might press 'R' expecting the "Repeats and Jumps"
palette to be highlighted. Prior to this commit, pressing 'R' would instead
trigger the application shortcut "Repeat selection", which enters notes
in the score.
@shoogle shoogle force-pushed the qml-palette-mnemonics branch from 5fc83ae to 937e7f5 Compare April 28, 2020 17:37
@shoogle
Copy link
Contributor Author

shoogle commented Apr 28, 2020

@anatoly-os

Typing "L" doesn't make "Lines" palette focused.

I tested on macOS and it worked for me. However, it is possible that 'L' was being swallowed by an application shortcut (i.e. if you defined one in Preferences). If that's the case then the latest commit should fix it.

@anatoly-os anatoly-os merged commit 84729e8 into musescore:master Apr 29, 2020
@shoogle shoogle deleted the qml-palette-mnemonics branch August 25, 2024 12:24
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.

4 participants