[gtranslator: 1/2] gtr-search-bar.c: change the 'active' signal to "changed"




commit 9248e6db5d52fb37262aee5f7168439d6cf810b0
Author: Tanju Brunostar <tanjubrunostar0 gmail com>
Date:   Sat Apr 2 16:44:07 2022 +0000

    gtr-search-bar.c: change the 'active' signal to "changed"
    
    This patch triggers the search on search input change and also removes the autofocus of the translation 
message text area on `gtr_tab_message_go_to`.
    
    See https://gitlab.gnome.org/GNOME/gtranslator/-/issues/108

 src/gtr-search-bar.c |  2 +-
 src/gtr-tab.c        | 14 --------------
 2 files changed, 1 insertion(+), 15 deletions(-)
---
diff --git a/src/gtr-search-bar.c b/src/gtr-search-bar.c
index b7fc38bc..a5231b48 100644
--- a/src/gtr-search-bar.c
+++ b/src/gtr-search-bar.c
@@ -698,7 +698,7 @@ gtr_search_bar_init (GtrSearchBar *self)
                     "insert_text", G_CALLBACK (insert_text_handler), NULL);
 
   g_signal_connect_swapped (self->search_entry,
-                            "activate",
+                            "changed",
                             G_CALLBACK (gtr_search_bar_find_next),
                             self);
 
diff --git a/src/gtr-tab.c b/src/gtr-tab.c
index b22d2355..6b23a202 100644
--- a/src/gtr-tab.c
+++ b/src/gtr-tab.c
@@ -247,15 +247,6 @@ show_hide_revealer (GtkWidget *widget, GdkEvent *ev, GtrTab *tab)
   return TRUE;
 }
 
-static gboolean
-msg_grab_focus (GtrTab *tab)
-{
-  GtrTabPrivate *priv;
-  priv = gtr_tab_get_instance_private (tab);
-  gtk_widget_grab_focus (priv->trans_msgstr[0]);
-  return FALSE;
-}
-
 static void
 install_autosave_timeout (GtrTab * tab)
 {
@@ -1245,11 +1236,6 @@ gtr_tab_message_go_to (GtrTab * tab,
   else
     return;
 
-  // Grabbing the focus in the GtrView to edit the message
-  // This is done in the idle add to avoid the focus grab from the
-  // message-table
-  g_idle_add((GSourceFunc)msg_grab_focus, tab);
-
   /*
    * Emitting showed-message signal
    */


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