code icon indicating copy to clipboard operation
code copied to clipboard

Global search selected

Open jeremypw opened this issue 4 years ago • 2 comments

Fixes #1020

  • Use selected text or search entry text when available with global search action
  • Add button to searchbar to trigger global search

The keyboard shortcut searches text based on which widget is focused. If the document is focused and text is selected then that is the proposed search term. If the search entry is focused and has text then that is the search term.

The global search button prefocuses the search entry so that always supplies the search term.

At the moment the dialog still appears to allow the user to override the choice or change settings.

At the moment a placeholder icon "gnome-global" is used for the global search button. We need an elementary "global-search-symbolic" icon to be designed.

jeremypw avatar May 23 '21 09:05 jeremypw

@danrabbit Can you give some input on which icon to use instead of gnome-globe or if we need something new?

tintou avatar Jul 13 '22 09:07 tintou

Most "global search" icon examples on the web are some combination of a globe and magnifying glass (unsurprisingly).

jeremypw avatar Jul 13 '22 14:07 jeremypw

Hm yeah this interface is definitely starting to feel a bit awkward. I wonder if we should move search options into a menu and use checkboxes instead of trying to iconify all of the options inline.

I think it feels awkward to open the search dialog when we already have settings here for case sensitivity and regex. So perhaps if we make global search a checkbox option here we could have the keyboard shortcuts just open this one interface with the global search option either checked or unchecked

danirabbit avatar Aug 31 '22 16:08 danirabbit

Yeah, I guess you are right - the searchbar could also do global search so the dialog would be redundant. I think originally the dialog had more options but it was slimmed down. I'll split this PR and keep the code to apply the search to the selected text and lose the extra button pending an interface redesign.

jeremypw avatar Sep 01 '22 17:09 jeremypw

@danrabbit This PR is now restricted to allowing search on selected text - which is quite useful and quicker than typing search terms in the dialog every time. At the moment you can select any amount of text which fails with there are more than one line - not sure how to deal with that - search on a term up to the first new line?

jeremypw avatar Sep 01 '22 18:09 jeremypw