-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
TouchMenu: Search menu to search the menu #9876
Conversation
frontend/ui/widget/confirmbox.lua
Outdated
local image_widget | ||
if self.show_icon then | ||
--- @todo remove self.image support, only used in filemanagersearch | ||
-- this requires self.image's lifecycle to be managed by ImageWidget | ||
-- instead of caller, which is easy to introduce bugs | ||
if self.image then | ||
image_widget = ImageWidget:new{ | ||
image = self.image, | ||
width = self.image_width, | ||
height = self.image_height, | ||
alpha = self.alpha ~= nil and self.alpha or false, -- default to false | ||
} | ||
else | ||
image_widget = IconWidget:new{ | ||
icon = self.icon, | ||
alpha = self.alpha == nil and true or self.alpha, -- default to true | ||
} | ||
end | ||
else | ||
image_widget = WidgetContainer:new() | ||
end |
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.
@poire-z I didn't follow this PR closely (feel free to take over instead if you're more up to date with it). What's this extra image widget stuff about?
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.
cf #9823 (comment)
This confirmbox change should not be picked.
Where this ConfirmBox is used, it should either be switched to use a ButtonDialog (wider, no icon) as I suggested - or keep the ConfirmBox and use as the ConfirmBox's icon the icon of that top menu (as @hius07 suggested at #9823 (comment) if I got that right).
text = _("Filebrowser"), | ||
}, | ||
setting = { | ||
icon = "appbar.settings", | ||
text = _("Settings"), |
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.
Now that you have set the icon in the ConfirmBox, do we need to still have these (translated) text here.
And do we also need it in the ConfirmBox (this text would be shown nowhere else, so it relates to nothing, except giving a name to the icon on its left in the ConfirmBox.
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.
You're probably right, though there may upsides to having an official public name. (Then again, it's only the document and formatting menu that are a bit harder to talk about.)
I'll remove it.
There's also these uneeded always-false |
Co-authored-by: poire-z <poire-z@users.noreply.github.com>
frontend/ui/widget/touchmenu.lua
Outdated
if val.sub_item_table_func and extensive_search then | ||
local sub_item_table = val.sub_item_table_func() | ||
local perpage = "" | ||
if sub_item_table.max_per_page then | ||
perpage = "[" .. sub_item_table.max_per_page .."]" | ||
end | ||
recurse(sub_item_table, path .. ".sub_item_table_func" .. perpage, text, icon, depth) | ||
elseif val.sub_item_table then | ||
if val.sub_item_table then |
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.
After a quick look, it seems that with extensive_search=false, it wasn't (and isn't) searching inside sub_item_table_func ?
(one example of menu item inside such a func: About font-family fonts
or Ignore publisher font names when font-family is set
)
If that's the case, put the above back with just if val.sub_item_table_func then
?
Oh drat, I overlooked this comment. But indeed my main intent was to finish up what I saw as a final few minor remarks. :-) |
I haven't seen that glitch. |
More worrisome is that you can get this crash trying to animate a font result.
|
I guess regex search should go, and it should be plain search, given the target audience. |
Duplicated or just with the same name? (That is, proper bug or more of a presentation issue?) |
ok, looks like it's not a same menu duplicated. I was searching for "text", and I got many times some font name like "STIX Two Text". But also "Fulltext search", "Text editor: open last file". Each probably 100 times. Or search for "Noto", and you get all our Noto fonts many times.
So, we would probably need to flag some submenus so they are not traversed by the search. And that's what I feared with these kind of PRs. Feature totallly uneeded, but it looked localized and fun, so ok, not giving it much thoughts - and it ends up bleeding its crap elsewhere and becomes a curse: now, each time we'll add some dynamic submenu, we'll have to remember about this crappy menu search (and bug new contributors with "hey, you don't know that, but you have to think about that menu search that nobody uses; yes, it's ridiculous, but it's our heritage - you should comply...") |
Well, our hierarchical and thematic keywords are actually our menu tree :)
Being able to output/read a "gesture (event to action) and reverse gesture (action to event) sheet" could be nice. It could just be another submenu, readonly maybe - or a generated EPUB :) I'm not opposed to the "menu search feature", as the animation makes it look fun - and I wasn't doing the work. And I'm a bit upset that, after I initially warned it might be complicated, that after some amount of work (the most fun part), and because we were hinting at the little complexities at the end (that have to be solved, I'm quite proud we take the time to review/test, and notice things, and don't merge stuff with noticed issues not fixed), zwim decides to abandon all that because it was too much at one moment (even if there was no user, not even himself, needy of the features in his 2 or 3 opened PRs), and there was no hurry). And that I/we would be forced into taking on that work on our shoulders (at some time I haven't decided, and on a topic I have little interest on). |
I'd feel somewhat bad about having half the translations already done and then reverting it, but luckily it's just a few small strings. I did slightly overestimate how done it was based on first playing around with it, since I failed to approach it as a tester. |
Agreed.
"Show me"? |
Fixes #9800.
This is #9823.
This change is![Reviewable](https://camo.githubusercontent.com/23b05f5fb48215c989e92cc44cf6512512d083132bd3daf689867c8d9d386888/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)