[geany/geany] f15f5a: Minor improvements related to the search entry

Jiří Techet git-noreply at xxxxx
Sun Jan 23 16:43:57 UTC 2022


Branch:      refs/heads/master
Author:      Jiří Techet <techet at gmail.com>
Committer:   Jiří Techet <techet at gmail.com>
Date:        Sun, 23 Jan 2022 16:43:57 UTC
Commit:      f15f5a5dd87e4128bb14e3aa97ad5aacb7c28c69
             https://github.com/geany/geany/commit/f15f5a5dd87e4128bb14e3aa97ad5aacb7c28c69

Log Message:
-----------
Minor improvements related to the search entry

* Add search icon to the entry
* Mention the possibility to use more filters separated
  by space in tooltip
* Focus the tree when pressing enter in the search entry


Modified Paths:
--------------
    data/geany.glade
    src/callbacks.c
    src/callbacks.h

Modified: data/geany.glade
4 lines changed, 3 insertions(+), 1 deletions(-)
===================================================================
@@ -8252,14 +8252,16 @@
                           <object class="GtkEntry" id="entry_tagfilter">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                            <property name="tooltip_text" translatable="yes">Filter the Symbol List</property>
+                            <property name="tooltip_text" translatable="yes">Filter the symbol list using the entered text. Separate multiple filters with a space.</property>
                             <property name="invisible_char">•</property>
+                            <property name="primary_icon_stock">gtk-find</property>
                             <property name="secondary_icon_stock">gtk-clear</property>
                             <property name="primary_icon_activatable">False</property>
                             <property name="secondary_icon_activatable">True</property>
                             <property name="primary_icon_sensitive">True</property>
                             <property name="secondary_icon_sensitive">True</property>
                             <signal name="changed" handler="on_entry_tagfilter_changed" swapped="no"/>
+                            <signal name="activate" handler="on_entry_tagfilter_activate" swapped="no"/>
                             <signal name="icon-press" handler="on_entry_tagfilter_icon_press" swapped="no"/>
                           </object>
                           <packing>


Modified: src/callbacks.c
15 lines changed, 15 insertions(+), 0 deletions(-)
===================================================================
@@ -440,6 +440,10 @@ void on_toolbutton_search_clicked(GtkAction *action, gpointer user_data)
 void on_entry_tagfilter_changed(GtkAction *action, gpointer user_data)
 {
 	GeanyDocument *doc = document_get_current();
+
+	if (!doc)
+		return;
+
 	/* make sure the tree is fully re-created so it appears correctly
 	 * after applying filter */
 	if (doc->priv->tag_store)
@@ -455,6 +459,17 @@ void on_entry_tagfilter_icon_press(GtkEntry *entry, GtkEntryIconPosition icon_po
 }
 
 
+void on_entry_tagfilter_activate(GtkEntry *entry, gpointer user_data)
+{
+	GeanyDocument *doc = document_get_current();
+
+	if (!doc)
+		return;
+
+	gtk_widget_grab_focus(doc->priv->tag_tree);
+}
+
+
 /* hides toolbar from toolbar popup menu */
 static void on_hide_toolbar1_activate(GtkMenuItem *menuitem, gpointer user_data)
 {


Modified: src/callbacks.h
2 lines changed, 2 insertions(+), 0 deletions(-)
===================================================================
@@ -76,6 +76,8 @@ void on_entry_tagfilter_changed(GtkAction *action, gpointer user_data);
 
 void on_entry_tagfilter_icon_press(GtkEntry *entry, GtkEntryIconPosition icon_pos, GdkEvent *event, gpointer user_data);
 
+void on_entry_tagfilter_activate(GtkEntry *entry, gpointer user_data);
+
 void on_toggle_case1_activate(GtkMenuItem *menuitem, gpointer user_data);
 
 void on_find_usage1_activate(GtkMenuItem *menuitem, gpointer user_data);



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list