After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 741804 - automatically search when type
automatically search when type
Status: RESOLVED FIXED
Product: gnome-tweak-tool
Classification: Applications
Component: general
3.14.x
Other Linux
: Normal enhancement
: ---
Assigned To: GNOME Tweak Tool maintainer(s)
GNOME Tweak Tool maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-12-20 10:52 UTC by medeoTL
Modified: 2015-02-16 12:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for desired functionality (2.12 KB, patch)
2015-01-29 11:01 UTC, Isaac Lenton
needs-work Details | Review
Updated patch (2.21 KB, patch)
2015-02-15 09:35 UTC, Isaac Lenton
needs-work Details | Review
Updated patch (2.27 KB, patch)
2015-02-16 01:32 UTC, Isaac Lenton
committed Details | Review

Description medeoTL 2014-12-20 10:52:37 UTC
Sometimes I just want to change a specific setting on the fly, it'ld be nice if I can just launch gnome-tweak-tool and start typing the setting I want to change, then move mouse and change it
Comment 1 Isaac Lenton 2015-01-29 11:01:40 UTC
Created attachment 295739 [details] [review]
Patch for desired functionality

I agree, when I open gnome-tweak tool I just want to start searching for a feature.

This patch also fixes a bug in _on_key_press where the f key (in Ctrl-f) was being handled by multiple callbacks (since _on_key_press didn't return True that it had handled the input).
Comment 2 Rui Matos 2015-02-14 23:11:35 UTC
Review of attachment 295739 [details] [review]:

Thanks for the patch

::: gtweak/tweakview.py
@@ +198,3 @@
                 self._left_header.props.decoration_layout = tokens[0]
 
+    def _after_key_press(self, widget, event):

return self.searchbar.handle_event()

should be enough here.
Comment 3 Isaac Lenton 2015-02-15 09:35:25 UTC
Created attachment 296862 [details] [review]
Updated patch

The searchbar.handle_event (event) function only seems to work if the search bar is hidden or in focus.  This function allows user input to be handled by the search bar when hidden, in focus or out of focus.  I think the out-of-focus behaviour is good to have, that way the user can quickly continue searching as long as no other widget is capturing their keyboard input.

    def _after_key_press(self, widget, event):
        if not self.button.get_active() or not self.entry.is_focus():
            if self.entry.im_context_filter_keypress(event):
                self.button.set_active(True)
+               self.entry.grab_focus ()

                # Text in entry is selected, deselect it
                l = self.entry.get_text_length()
                self.entry.select_region(l, l)

                return True

I did notice a couple of issues with my previous patch: above where the entry wasn't grabbing focus, and a bug I failed to squash in _on_key_press.
Comment 4 Rui Matos 2015-02-15 16:05:39 UTC
Review of attachment 296862 [details] [review]:

Ok, let's go with this then. Only missing return False at the end of both functions i.e. on the fallback way out.

Are you able to push to git.gnome.org?

::: gtweak/tweakview.py
@@ +209,3 @@
+
+                return True
+

return False

@@ +226,1 @@
 

return False
Comment 5 Isaac Lenton 2015-02-16 01:32:17 UTC
Created attachment 296902 [details] [review]
Updated patch

Added the fallback cases.  I'm not able to push to git.gnome.org.
Comment 6 Rui Matos 2015-02-16 12:55:06 UTC
Review of attachment 296902 [details] [review]:

looks good