[gedit] Use header bar close button for the prefs



commit e32d3f94140be554f96f57c60e101bfe1d5efe33
Author: Paolo Borelli <pborelli gnome org>
Date:   Fri Feb 14 21:25:14 2014 +0100

    Use header bar close button for the prefs

 gedit/gedit-preferences-dialog.c  |   14 +----------
 gedit/gedit-preferences-dialog.ui |   44 +++++++-----------------------------
 2 files changed, 11 insertions(+), 47 deletions(-)
---
diff --git a/gedit/gedit-preferences-dialog.c b/gedit/gedit-preferences-dialog.c
index fcccfd5..e0b3973 100644
--- a/gedit/gedit-preferences-dialog.c
+++ b/gedit/gedit-preferences-dialog.c
@@ -135,18 +135,7 @@ gedit_preferences_dialog_response (GtkDialog *dlg,
 {
        gedit_debug (DEBUG_PREFS);
 
-       switch (res_id)
-       {
-               case GTK_RESPONSE_HELP:
-                       gedit_app_show_help (GEDIT_APP (g_application_get_default ()),
-                                            GTK_WINDOW (dlg),
-                                            NULL,
-                                            "index#configure-gedit");
-                       break;
-
-               default:
-                       gtk_widget_destroy (GTK_WIDGET (dlg));
-       }
+       gtk_widget_destroy (GTK_WIDGET (dlg));
 }
 
 static void
@@ -1111,6 +1100,7 @@ gedit_show_preferences_dialog (GeditWindow *parent)
        {
                preferences_dialog = GTK_WIDGET (g_object_new (GEDIT_TYPE_PREFERENCES_DIALOG,
                                                               "application", g_application_get_default (),
+                                                              "use-header-bar", TRUE,
                                                               NULL));
                g_signal_connect (preferences_dialog,
                                  "destroy",
diff --git a/gedit/gedit-preferences-dialog.ui b/gedit/gedit-preferences-dialog.ui
index 21b63ca..9141300 100644
--- a/gedit/gedit-preferences-dialog.ui
+++ b/gedit/gedit-preferences-dialog.ui
@@ -24,11 +24,19 @@
   </object>
   <template class="GeditPreferencesDialog" parent="GtkDialog">
     <property name="can_focus">False</property>
-    <property name="title" translatable="yes">gedit Preferences</property>
+    <property name="title" translatable="yes">Preferences</property>
     <property name="resizable">True</property>
     <property name="destroy_with_parent">True</property>
     <property name="type_hint">dialog</property>
     <property name="border_width">5</property>
+    <child type="titlebar">
+      <object class="GtkHeaderBar" id="header_bar">
+        <property name="title" translatable="yes">Preferences</property>
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="show-close-button">True</property>
+       </object>
+    </child>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox">
         <property name="visible">True</property>
@@ -42,36 +50,6 @@
             <property name="layout_style">end</property>
             <property name="border_width">5</property>
             <property name="spacing">6</property>
-            <child>
-              <object class="GtkButton" id="helpbutton1">
-                <property name="label" translatable="yes">_Help</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_underline">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="closebutton1">
-                <property name="label" translatable="yes">_Close</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_underline">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
           </object>
           <packing>
             <property name="expand">False</property>
@@ -936,10 +914,6 @@
         </child>
       </object>
     </child>
-    <action-widgets>
-      <action-widget response="-11">helpbutton1</action-widget>
-      <action-widget response="-7">closebutton1</action-widget>
-    </action-widgets>
   </template>
   <object class="GtkListStore" id="schemes_treeview_model">
     <columns>


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