-
-
Notifications
You must be signed in to change notification settings - Fork 419
Search menu #405
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
Search menu #405
Conversation
| * Cmd/Ctrl-M: change *m*onitor | ||
| * Cmd/Ctrl-F: toggle *f*ull screen | ||
| * Mouse Scroll Up / Down: next or previous preset (hard transition) | ||
| * Return: search for preset (RETURN or ESCAPE to exit search) |
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.
maybe / too, vim-style?
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.
I started with this but gave up because of how SDL_StartTextInput will still grab the / key. I am likely missing something, but this could be a wish list.
src/libprojectM/KeyHandler.cpp
Outdated
| { | ||
| case PROJECTM_K_HOME: | ||
| if (renderer->showmenu) { // pageup only does something when the preset menu is active. | ||
| if (renderer->showmenu && !isTextInputActive()) { // pageup only does something when the preset menu is active. |
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.
these could be all simplified to if (isTextInputActive()) break;
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.
done
src/libprojectM/PresetLoader.cpp
Outdated
| const unsigned int PresetLoader::getPresetIndex(std::string &name) const | ||
| { | ||
| //Need a better structure than a vector for reverse lookup | ||
| for (int index = 0; index < _presetNames.size(); index++) |
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.
is there an indexOf() method or something like that in Vector?
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.
done
| else { | ||
| if (highlightable && showsearch && searchText().length() > 1) | ||
| { | ||
| int offset = x; |
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.
can these be separate functions?
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.
done
| { | ||
| int offset = x; | ||
| std::string str_find = substring; | ||
| for (size_t pos = 0; ; pos += str_find.length()) { |
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.
refactor with above to function?
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.
done
This reverts commit f8cea68.
768cbfa to
71ea3b8
Compare
Return enters search menu. Return/Escape exits search menu.
search based on text update next / previous based on search results.
Enhancement to the preset navigation menu previously submitted. Hit return and start typing to filter to presets based on keyword (case sensitive). It's limited to a single page for now (hopefully good enough).
obligatory demo: https://streamable.com/f8gbf1