[gtranslator/merge-requests/61: 12/20] Implement function to perform hide/show action for search_and_replace_bar in src/gtr-tab.c



commit 97bef0069d1659c497a432db3ff1cbb5d9187bd7
Author: Priyanka Saggu <priyankasggu11929 gmail com>
Date:   Tue Feb 11 13:17:30 2020 +0530

    Implement function to perform hide/show action for search_and_replace_bar in src/gtr-tab.c

 src/gtr-tab.c | 27 +++++++++++++++++++++------
 1 file changed, 21 insertions(+), 6 deletions(-)
---
diff --git a/src/gtr-tab.c b/src/gtr-tab.c
index d88afd5d..ceba4bb8 100644
--- a/src/gtr-tab.c
+++ b/src/gtr-tab.c
@@ -47,6 +47,7 @@
 #include "gtr-window.h"
 #include "gtr-progress.h"
 #include "gtr-search-bar.h"
+#include "gtr-actions.h"
 
 #include <glib.h>
 #include <glib-object.h>
@@ -108,7 +109,6 @@ typedef struct
   gint autosave_interval;
   guint autosave_timeout;
   guint autosave : 1;
-
   /*Blocking movement */
   guint blocking : 1;
 
@@ -116,9 +116,9 @@ typedef struct
   guint dispose_has_run : 1;
 
   /*Search Bar*/
-  GtkOverlay    *overlay;
-  GtkRevealer   *search_revealer;
-  GtrSearchBar *search_bar;
+  GtkOverlay     *overlay;
+  GtkRevealer    *search_revealer;
+  GtrSearchBar   *search_bar;
   GtkSearchEntry *search;
 } GtrTabPrivate;
 
@@ -147,7 +147,7 @@ static gboolean gtr_tab_autosave (GtrTab * tab);
 
 //---------------------------Search Bar Revealer------------------//
 
-static void
+void
 gtr_page_stop_search (GtrTab *tab,
                              GtrSearchBar *search_bar)
 {
@@ -161,7 +161,22 @@ gtr_page_stop_search (GtrTab *tab,
 
 }
 
-static void
+void
+gtr_tab_show_hide_search_bar (GtrTab *tab, GtrSearchBar *search_bar, gint count)
+{
+  GtrTabPrivate *priv;
+
+  priv = gtr_tab_get_instance_private (tab);
+  g_assert (GTR_IS_TAB (tab));
+  g_assert (GTR_IS_SEARCH_BAR (priv->search_bar));
+
+  if (count == 0)
+    { gtk_revealer_set_reveal_child (priv->search_revealer, TRUE); }
+  else
+    { gtk_revealer_set_reveal_child (priv->search_revealer, FALSE); }
+}
+
+void
 gtr_page_notify_child_revealed (GtrTab *tab,
                                        GParamSpec    *pspec,
                                        GtkRevealer   *revealer)


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