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

Find in the hotkeys popup #3970

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

Conversation

kosorin
Copy link
Contributor

@kosorin kosorin commented Oct 18, 2024

Implements #3963

  • find in description only
  • no fuzzy or other sophisticated searching
  • uses awful.prompt.run
  • show_help() does not return awful.keygrabber (breaking change?)

Theme variables

Theme Default value Description
highlight_bg "#ffff00" The highlighted text background color.
highlight_fg "#000000" The highlighted text foreground color.
find_fg_cursor - The find prompt cursor foreground color.
find_bg_cursor - The find prompt cursor background color.
find_ul_cursor - The find prompt cursor underline style.
find_prompt "<b>Find: </b>" The find prompt text.
find_font font The find prompt text font.
find_margin group_margin Margin around the find prompt.

hotkeys_popup_find

@@ -371,6 +427,22 @@ function widget.new(args)
beautiful.hotkeys_description_font or "Monospace 8"
self.group_margin = args.group_margin or
beautiful.hotkeys_group_margin or dpi(6)
self.highlight_bg = args.highlight_bg or
beautiful.hotkeys_highlight_bg or "#ffff00"
Copy link
Member

Choose a reason for hiding this comment

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

please default to other beautiful.* variables which are for sure defined in the default theme.lua instead of falling back to hardcoded colors

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like this bright yellow, because the point is to easily see highlighted text. For example firefox uses #ff00ff, also bright.

What about beautiful.bg_urgent (red)? I haven't found any other beautiful colors that fit it.

Copy link
Member

@actionless actionless Oct 19, 2024

Choose a reason for hiding this comment

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

yup, just choose any placeholder from beautiful, that bg_urgent is fine by me.
people who care more would set the right theme key anyway

@actionless
Copy link
Member

actionless commented Oct 18, 2024

thanks for submitting, i found small issue right from the description (and left a separate comment), i'll start reviewing the code itself later on in upcoming days or mb even hours

@actionless
Copy link
Member

and also the test is failing:

  • /home/runner/work/awesome/awesome/tests/test-awesomerc.lua: Error: running function for step 13/18 (@3): /home/runner/work/awesome/awesome/tests/test-awesomerc.lua:289: assertion failed!

@actionless
Copy link
Member

regarding keygrabber question, i'll need first to understand:

  1. what was the initial intention of returning it there
  2. why it's not possible to do it anymore

@actionless
Copy link
Member

also, mb add a bool option to args for closing hotkeys on a any keypress (the current behavior), so the users who used to that, could restore that old default behavior

@actionless
Copy link
Member

i think find_prompt should be moved from theme option to args

@kosorin
Copy link
Contributor Author

kosorin commented Oct 19, 2024

regarding keygrabber question, i'll need first to understand:

1. what was the initial intention of returning it there

2. why it's not possible to do it anymore

Because I use awful.prompt I no longer have access to the underlying keygrabber. Why was it returning keygrabber? I don't know, it doesn't make much sense to me.

Actually, I need to check if the prompt is stopped gracefully. Right now I just call awful.keygrabber.stop().

also, mb add a bool option to args for closing hotkeys on a any keypress (the current behavior), so the users who used to that, could restore that old default behavior

I added show_args.enable_find (enabled by default). If false, the prompt is not visible and the popup is hidden on any key.

i think find_prompt should be moved from theme option to args

I don't know. What are the odds that you want multiple prompts for different hotkey popups? It's just a simple text "find: ", nothing more so I thought was easier for user to set it once in the theme.

@actionless
Copy link
Member

actionless commented Oct 19, 2024

What are the odds that you want multiple prompts for different hotkey popups

it wasn't a point about having multiple different prompts, but about untying translation and style - and as you can see from our existing themes (and defined theme variables in the awful/wibox/etc builtin libraries), it's indeed not a used practice storing such sort of info there

I added show_args.enable_find (enabled by default). If false, the prompt is not visible and the popup is hidden on any key.

thanks 👍

Because I use awful.prompt I no longer have access to the underlying keygrabber. Why was it returning keygrabber? I don't know, it doesn't make much sense to me.

ok i'll try to dive into git blame to figure that out 😺

@actionless
Copy link
Member

style checking is failing in the CI btw

self.highlight_fg = args.highlight_fg or
beautiful.hotkeys_highlight_fg or beautiful.fg_urgent
self.find_prompt = args.find_prompt or
beautiful.hotkeys_find_prompt or "<b>Find: </b>"
Copy link
Member

Choose a reason for hiding this comment

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

as i mentioned in previous comment this shouldn't be defined in beautiful, as its role defining theme, not translation/labels

Copy link
Member

@actionless actionless left a comment

Choose a reason for hiding this comment

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

⬆️

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