[devhelp] window: use show-close-button property of headerbar



commit bdccd023afdddcfa25e80a8be01aed285f5dd752
Author: Ignacio Casal Quinteiro <ignacio casal nice-software com>
Date:   Wed Sep 4 08:38:40 2013 +0200

    window: use show-close-button property of headerbar

 src/dh-window.c  |    5 -----
 src/dh-window.ui |   31 +------------------------------
 2 files changed, 1 insertions(+), 35 deletions(-)
---
diff --git a/src/dh-window.c b/src/dh-window.c
index eba57be..dc2bde7 100644
--- a/src/dh-window.c
+++ b/src/dh-window.c
@@ -50,7 +50,6 @@ typedef struct {
         GtkWidget      *forward_button;
         GtkImage       *forward_button_image;
         GtkMenuButton  *gear_menu_button;
-        GtkWidget      *close_button;
         GtkWidget      *grid_sidebar;
         GtkWidget      *grid_documents;
         GtkWidget      *search_bar;
@@ -606,7 +605,6 @@ dh_window_class_init (DhWindowClass *klass)
         gtk_widget_class_bind_template_child_private (widget_class, DhWindow, forward_button);
         gtk_widget_class_bind_template_child_private (widget_class, DhWindow, forward_button_image);
         gtk_widget_class_bind_template_child_private (widget_class, DhWindow, gear_menu_button);
-        gtk_widget_class_bind_template_child_private (widget_class, DhWindow, close_button);
         gtk_widget_class_bind_template_child_private (widget_class, DhWindow, hpaned);
         gtk_widget_class_bind_template_child_private (widget_class, DhWindow, grid_sidebar);
         gtk_widget_class_bind_template_child_private (widget_class, DhWindow, grid_documents);
@@ -682,9 +680,6 @@ window_populate (DhWindow *window)
         gtk_image_set_from_icon_name (priv->back_button_image, prev_icon, GTK_ICON_SIZE_MENU);
         gtk_image_set_from_icon_name (priv->forward_button_image, next_icon, GTK_ICON_SIZE_MENU);
 
-        g_signal_connect_swapped (priv->close_button, "clicked",
-                                  G_CALLBACK (gtk_window_close), window);
-
         /* Sidebar */
         priv->sidebar = dh_sidebar_new (book_manager);
         gtk_widget_set_vexpand (priv->sidebar, TRUE);
diff --git a/src/dh-window.ui b/src/dh-window.ui
index 398b091..0ee5538 100644
--- a/src/dh-window.ui
+++ b/src/dh-window.ui
@@ -111,6 +111,7 @@
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="vexpand">False</property>
+        <property name="show_close_button">True</property>
         <child>
           <object class="GtkBox" id="box">
             <property name="visible">True</property>
@@ -182,36 +183,6 @@
             <property name="pack_type">end</property>
           </packing>
         </child>
-        <child>
-          <object class="GtkSeparator" id="close_button_separator">
-            <property name="visible">True</property>
-            <property name="orientation">vertical</property>
-            <property name="valign">fill</property>
-          </object>
-          <packing>
-            <property name="pack_type">end</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkButton" id="close_button">
-            <property name="visible">True</property>
-            <property name="valign">center</property>
-            <property name="relief">none</property>
-            <style>
-              <class name="image-button"/>
-            </style>
-            <child>
-              <object class="GtkImage" id="close_button_image">
-                <property name="visible">True</property>
-                <property name="icon_size">1</property>
-                <property name="icon_name">window-close-symbolic</property>
-              </object>
-            </child>
-          </object>
-          <packing>
-            <property name="pack_type">end</property>
-          </packing>
-        </child>
       </object>
     </child>
     <child>


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