[gnome-characters/bilelmoussaoui/gtk4: 71/71] window: track search toggle button as well




commit 0d5d1ced18956f86afc9b2537653de6203e0331f
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Thu Nov 25 11:59:02 2021 +0100

    window: track search toggle button as well

 src/window.js | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/src/window.js b/src/window.js
index c7292df..9153407 100644
--- a/src/window.js
+++ b/src/window.js
@@ -98,6 +98,15 @@ var MainWindow = GObject.registerClass({
             GObject.BindingFlags.SYNC_CREATE | GObject.BindingFlags.BIDIRECTIONAL,
         );
 
+        this._searchButton.connect('toggled', btn => {
+            if (btn.active)
+                this._searchEntry.grab_focus();
+            else
+                this._searchEntry.set_text('');
+
+            this.searchActive = btn.active;
+        });
+
         this._searchEntry.connect('search-changed', entry => this._handleSearchChanged(entry));
         this._searchEntry.set_key_capture_widget(this);
         this._searchEntry.connect('search-started', () => {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]