-
Notifications
You must be signed in to change notification settings - Fork 69
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
feat: palette menus #652
feat: palette menus #652
Conversation
Each (sub)menu can now enable palette mode by setting its `palette` property to `true`. In this mode: - search input is always visible, doesn't have to be enabled, and can't be disabled - `title` is used as input placeholder while search is empty
scripts/uosc/elements/Menu.lua
Outdated
for _, menu in ipairs(self.all) do | ||
if menu.palette and not menu.search then | ||
update_dimensions_again = true | ||
self:search_init(menu) | ||
elseif not menu.palette and menu.search and menu.search.query == '' then | ||
update_dimensions_again = true | ||
menu.search = nil | ||
end | ||
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.
Why can't that be done before the dimensions update? Then you wouldn't require update_dimensions_again
.
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.
We update before and after because search_inits need the initial un-searched menu's position and scroll state to save on the search.source
table.
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 don't like it but I also can't think of something better :)
What's the point of that palette mode? Starting a search isn't that big of a deal for users. |
The point of palette mode is to make palette menus :) Like For example I have a I also want It'll also be useful for implementing stuff like subtitle downloader, where there's just an empty list initially with a search input at the top pre-populated with current file name. I'd expect it to look something like: |
I don't really know if I want it to be executed or not. I'm going with yes atm, but not sure about it. The use case is of course the subtitle downloader, where you make a menu with I thought about making it just a |
Agree
Isn't that the point of
Scripts that want to provide a prefilled search field with the corresponding search result while providing But when the internal search is used we need to execute a search. |
True :) Renamed it to |
So you're fine with external searches calling |
No I'll fix it 😶. |
Each (sub)menu can now enable palette mode by setting its `palette` property to `true`. In this mode: - search input is always visible, doesn't have to be enabled, and can't be disabled - `title` is used as input placeholder while search is empty - `search_suggestion` can be used to pre-populate search input with an initial query
Each (sub)menu can now enable palette mode by setting its
palette
property totrue
.In this mode:
title
is used as input placeholder while search is emptyAny suggestions/bugs/comments?