Add Preferences search (fix #5353)#5507
Conversation
aseprite-bot
left a comment
There was a problem hiding this comment.
clang-tidy made some suggestions
| dragAndDropFromEdges()->setSelected(m_pref.timeline.dragAndDropFromEdges.defaultValue()); | ||
| } | ||
|
|
||
| void allWidgetsIn(Widget* root, WidgetsList& list) |
There was a problem hiding this comment.
warning: function 'allWidgetsIn' is within a recursive call chain [misc-no-recursion]
void allWidgetsIn(Widget* root, WidgetsList& list)
^Additional context
src/app/commands/cmd_options.cpp:2065: example recursive call chain, starting from function 'allWidgetsIn'
void allWidgetsIn(Widget* root, WidgetsList& list)
^src/app/commands/cmd_options.cpp:2070: Frame #1: function 'allWidgetsIn' calls function 'allWidgetsIn' here:
allWidgetsIn(*i, list);
^src/app/commands/cmd_options.cpp:2070: ... which was the starting point of the recursive call chain; there may be other cycles
allWidgetsIn(*i, list);
^|
Great, cool feature! Some comments:
|
b3adc2b to
1a96470
Compare
|
Removed the use of the |
|
Great!! I didn't mention before but // Always disable the Slider and ColorButton widgets; they will be enabled through
// their label.
if (widget && widget->type() == kSliderWidget || widget->type() == ColorButton::colorbutton_type())
widget->setEnabled(false);
|
|
In case we need access to |
1a96470 to
bf49488
Compare
aseprite-bot
left a comment
There was a problem hiding this comment.
clang-tidy made some suggestions
| dragAndDropFromEdges()->setSelected(m_pref.timeline.dragAndDropFromEdges.defaultValue()); | ||
| } | ||
|
|
||
| void allWidgetsIn(Widget* root, WidgetsList& list) |
There was a problem hiding this comment.
warning: function 'allWidgetsIn' is within a recursive call chain [misc-no-recursion]
void allWidgetsIn(Widget* root, WidgetsList& list)
^Additional context
src/app/commands/cmd_options.cpp:2106: example recursive call chain, starting from function 'allWidgetsIn'
void allWidgetsIn(Widget* root, WidgetsList& list)
^src/app/commands/cmd_options.cpp:2111: Frame #1: function 'allWidgetsIn' calls function 'allWidgetsIn' here:
allWidgetsIn(*i, list);
^src/app/commands/cmd_options.cpp:2111: ... which was the starting point of the recursive call chain; there may be other cycles
allWidgetsIn(*i, list);
^bf49488 to
2568cf7
Compare
|
Fixed some issues with the disabling/re-enabling and added a disabled state to the @dacap Made a change to Slider so it's also setting the |
2568cf7 to
53d8852
Compare
53d8852 to
d7faf3d
Compare
|
Fixed accidentally breaking everything (oops) and added two new things:
|
|
Almost perfect, but...: if (label->isEnabled()) {
label->buddy()->setEnabled(true);
// Special case to handle buttonsets
if (label->buddy()->type() == kGridWidget) {
for (auto* child : label->buddy()->children())
child->setEnabled(true);
}
}
else if (label->buddy()->isEnabled() && !label->buddy()->text().empty()) {
label->setEnabled(true);
}I found that the ComboBox labels are disabled regardless, even though the string "pn" belongs to one of the available options ("png") in the default file association ComboBox under "Files" section. The problem lies in the following "else if" statement: else if (label->buddy()->isEnabled() && !label->buddy()->text().empty())In the mentioned ComboBox |
aseprite-bot
left a comment
There was a problem hiding this comment.
clang-tidy made some suggestions
5bc4583 to
18bfed3
Compare
3823405 to
73d8ab3
Compare
|
Added a cache of the lower case searchable text for the widgets, this speeds up the processing on each keystroke by around 40%~, I've also added debouncing to |
aseprite-bot
left a comment
There was a problem hiding this comment.
clang-tidy made some suggestions
|
I've rebased this to latest beta to avoid conflicts with the merged PR #5503 You can find the rebased version here https://github.com/dacap/aseprite/tree/preferences-search in case you want to move your own branch. Anyway there are some comments to make. |
I'm not sure why this change was required. Is it necessary for this feature? |
73d8ab3 to
a2459af
Compare
aseprite-bot
left a comment
There was a problem hiding this comment.
clang-tidy made some suggestions
|
Looks great @ckaiser 👍 I'll merge it right now, and make a little change in the Grid section that it looks something has changed. |
Fixes #5353, adds a search to the preferences menu like so:
(Note: Outdated video)
pref-search.mp4