[eog] Use headerbar in preferences dialog



commit 7da26f5333a074f61ed8b7adb884ad41c70ff0c1
Author: Trinh Anh Ngoc <atw1990 gmail com>
Date:   Sun Sep 6 08:58:11 2015 +0700

    Use headerbar in preferences dialog

 data/eog-preferences-dialog.ui |   83 ++++++++++-----------------------------
 src/eog-preferences-dialog.c   |    1 +
 2 files changed, 23 insertions(+), 61 deletions(-)
---
diff --git a/data/eog-preferences-dialog.ui b/data/eog-preferences-dialog.ui
index 48b1116..b48a62b 100644
--- a/data/eog-preferences-dialog.ui
+++ b/data/eog-preferences-dialog.ui
@@ -12,61 +12,32 @@
   </object>
   <template class="EogPreferencesDialog" parent="GtkDialog">
     <property name="can_focus">False</property>
-    <property name="border_width">5</property>
     <property name="title" translatable="yes">Preferences</property>
     <property name="type_hint">dialog</property>
+    <child internal-child="headerbar">
+      <object class="GtkHeaderBar">
+        <child>
+          <object class="GtkButton" id="help_button">
+            <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>
+        </child>
+      </object>
+    </child>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox1">
+        <property name="border_width">0</property>
         <property name="can_focus">False</property>
         <property name="orientation">vertical</property>
-        <property name="spacing">2</property>
-        <child internal-child="action_area">
-          <object class="GtkButtonBox" id="dialog-action_area1">
-            <property name="can_focus">False</property>
-            <property name="layout_style">end</property>
-            <child>
-              <object class="GtkButton" id="help_button">
-                <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="close_button">
-                <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>
-            <property name="fill">True</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
         <child>
           <object class="GtkNotebook" id="notebook">
+            <property name="show-border">False</property>
             <property name="visible">True</property>
             <property name="can_focus">True</property>
-            <property name="border_width">5</property>
             <child>
               <object class="GtkBox" id="vbox5">
                 <property name="visible">True</property>
@@ -100,7 +71,7 @@
                       <object class="GtkAlignment" id="alignment5">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="left_padding">16</property>
+                        <property name="margin_start">16</property>
                         <child>
                           <object class="GtkBox" id="vbox2">
                             <property name="visible">True</property>
@@ -113,7 +84,6 @@
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
                                 <property name="use_underline">True</property>
-                                <property name="xalign">0</property>
                                 <property name="draw_indicator">True</property>
                               </object>
                               <packing>
@@ -129,7 +99,6 @@
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
                                 <property name="use_underline">True</property>
-                                <property name="xalign">0</property>
                                 <property name="draw_indicator">True</property>
                               </object>
                               <packing>
@@ -145,7 +114,6 @@
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
                                 <property name="use_underline">True</property>
-                                <property name="xalign">0</property>
                                 <property name="draw_indicator">True</property>
                               </object>
                               <packing>
@@ -196,7 +164,7 @@
                       <object class="GtkAlignment" id="alignment1">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="left_padding">16</property>
+                        <property name="margin_start">16</property>
                         <child>
                           <object class="GtkBox" id="hbox1">
                             <property name="visible">True</property>
@@ -208,7 +176,6 @@
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
-                                <property name="xalign">0</property>
                                 <property name="draw_indicator">True</property>
                               </object>
                               <packing>
@@ -273,7 +240,7 @@
                       <object class="GtkAlignment" id="alignment4">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="left_padding">16</property>
+                        <property name="margin_start">16</property>
                         <child>
                           <object class="GtkBox" id="vbox8">
                             <property name="visible">True</property>
@@ -287,7 +254,6 @@
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
                                 <property name="use_underline">True</property>
-                                <property name="xalign">0</property>
                                 <property name="active">True</property>
                                 <property name="draw_indicator">True</property>
                               </object>
@@ -309,7 +275,6 @@
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
                                     <property name="use_underline">True</property>
-                                    <property name="xalign">0</property>
                                     <property name="draw_indicator">True</property>
                                     <property name="group">checkpattern_radio</property>
                                   </object>
@@ -348,7 +313,6 @@
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
                                 <property name="use_underline">True</property>
-                                <property name="xalign">0</property>
                                 <property name="draw_indicator">True</property>
                                 <property name="group">checkpattern_radio</property>
                               </object>
@@ -419,7 +383,7 @@
                       <object class="GtkAlignment" id="alignment2">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="left_padding">16</property>
+                        <property name="margin_start">16</property>
                         <child>
                           <object class="GtkCheckButton" id="upscale_check">
                             <property name="label" translatable="yes">E_xpand images to fit screen</property>
@@ -427,7 +391,6 @@
                             <property name="can_focus">True</property>
                             <property name="receives_default">False</property>
                             <property name="use_underline">True</property>
-                            <property name="xalign">0</property>
                             <property name="draw_indicator">True</property>
                           </object>
                         </child>
@@ -458,7 +421,7 @@
                       <object class="GtkAlignment" id="alignment3">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="left_padding">16</property>
+                        <property name="margin_start">16</property>
                         <child>
                           <object class="GtkBox" id="vbox15">
                             <property name="visible">True</property>
@@ -488,7 +451,7 @@
                                   <object class="GtkAlignment" id="alignment6">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
-                                    <property name="left_padding">16</property>
+                                    <property name="margin_start">16</property>
                                     <child>
                                       <object class="GtkScale" id="seconds_scale">
                                         <property name="visible">True</property>
@@ -521,7 +484,6 @@
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
                                 <property name="use_underline">True</property>
-                                <property name="xalign">0</property>
                                 <property name="draw_indicator">True</property>
                               </object>
                               <packing>
@@ -607,7 +569,6 @@
     </child>
     <action-widgets>
       <action-widget response="-11">help_button</action-widget>
-      <action-widget response="-7">close_button</action-widget>
     </action-widgets>
   </template>
 </interface>
diff --git a/src/eog-preferences-dialog.c b/src/eog-preferences-dialog.c
index 492069f..7f9f359 100644
--- a/src/eog-preferences-dialog.c
+++ b/src/eog-preferences-dialog.c
@@ -309,6 +309,7 @@ GtkWidget *eog_preferences_dialog_get_instance(GtkWindow *parent)
 {
        if (instance == NULL) {
                instance = g_object_new (EOG_TYPE_PREFERENCES_DIALOG,
+                                        "use-header-bar", TRUE,
                                         NULL);
        }
 


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