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

Add note about input prompt scaling, and add options to change the key to start and restart searches #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

microraptor
Copy link

This PR has two commits:

The first one adds only a small note to the readme how the input prompt text scaling can be changed. This setting seems very important for high DPI displays. I have a UHD monitor and scale=1 is not readable and scale=7 comfortable.

I have the keybind to open the script on Ctrl+f instead of f12, because it is more intuitive and better for laptop keyboards and fancy keyboards, which have the F-keys hidden behind a second layer. Changing the keybinding only in input.conf leads to the issue, that restarting a search when a page is already opened is un-intuitive. So the second commit changes only a few lines of the code to allow options to change the f12 default.

I also changed the text Press f12 to enter search query to Enter a new search query, because this text is usually shown after the keybind has been pressed and is therefore misleading.

This setting seems very important for high DPI displays
These change the default keybindings to open a search, as well as to restart a search, while a page is open
@@ -502,7 +506,7 @@ function list_meta:run_search()
end

function list_meta:open_wrapper(advanced)
if self.keyword == nil then self.empty_text = "Press f12 to enter search query" end
if self.keyword == nil then self.empty_text = "Enter a new search query" end
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this change.

Comment on lines +197 to +198
{o.keybind_open_search, "open_search", function() temp:get_input(false) end, {}},
{o.keybind_open_flag_search, "open_flag_search", function() temp:get_input(true) end, {}}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of this PR is actually unnecessary. If we remove these two lines:

Suggested change
{o.keybind_open_search, "open_search", function() temp:get_input(false) end, {}},
{o.keybind_open_flag_search, "open_flag_search", function() temp:get_input(true) end, {}}

And change the open_wrapper function to be:

function list_meta:open_wrapper(advanced)
    if self.keyword == nil then self.empty_text = "Press f12 to enter search query" end
    local hidden = self.hidden
    if hidden then self:open() end
    if self.keyword == nil or not hidden then self:get_input(advanced) end
end

Then the standard mpv keybind to open the page will be also be used when the page is open instead of being overridden. Then the keybinds can be changed by using standard input.conf changes.

Comment on lines +114 to +119
The scale of the input prompt can be changed with this setting in the `mpv.conf`:

```txt
script-opts-append=user_input-scale=1
```

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of recommending an entry in mpv.conf I would instead prefer to recommend an entry in ~~/script-opts/user_input.conf which would contain scale=1.

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.

2 participants