[evince/wip/gpoo/ev-zoom-avoid-show-all: 3/4] shell: Avoid using gtk_widget_show_all on ev-zoom-action




commit b6573ab1fa07251a3f3cee032e8fff0b0436ba1b
Author: Germán Poo-Caamaño <gpoo gnome org>
Date:   Mon Mar 28 00:14:09 2022 -0300

    shell: Avoid using gtk_widget_show_all on ev-zoom-action
    
    Facilitate the transition to gtk4 by avoid using a call that
    does not exist, and the same can be achieved using composite
    template.
    
    Do not set visibility in main container, as it will be shown
    or hidden in the application depending if the mode is Recent
    View, Normal, or Fullscreen.

 shell/ev-zoom-action.c      | 13 ++++---------
 shell/evince-zoom-action.ui |  1 +
 2 files changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/shell/ev-zoom-action.c b/shell/ev-zoom-action.c
index 3c59e1466..3278a4895 100644
--- a/shell/ev-zoom-action.c
+++ b/shell/ev-zoom-action.c
@@ -440,18 +440,13 @@ GtkWidget *
 ev_zoom_action_new (EvDocumentModel *model,
                     GMenu           *menu)
 {
-        GtkWidget *retval;
-
         g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), NULL);
         g_return_val_if_fail (G_IS_MENU (menu), NULL);
 
-        retval = GTK_WIDGET (g_object_new (EV_TYPE_ZOOM_ACTION,
-                                           "document-model", model,
-                                           "menu", menu,
-                                           NULL));
-        gtk_widget_show_all (retval);
-
-        return retval;
+        return GTK_WIDGET (g_object_new (EV_TYPE_ZOOM_ACTION,
+                                         "document-model", model,
+                                         "menu", menu,
+                                         NULL));
 }
 
 gboolean
diff --git a/shell/evince-zoom-action.ui b/shell/evince-zoom-action.ui
index eed1c48f6..d04fe1916 100644
--- a/shell/evince-zoom-action.ui
+++ b/shell/evince-zoom-action.ui
@@ -11,6 +11,7 @@
         <property name="secondary-icon-name">pan-down-symbolic</property>
         <property name="xalign">1.0</property>
         <property name="max-width-chars">0</property>
+        <property name="visible">True</property>
       </object>
     </child>
   </template>


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