[epiphany] Use header bar on passwords dialog



commit ddd5f4af344548e1415928ba99a4f08706040ba9
Author: William Jon McCann <william jon mccann gmail com>
Date:   Thu Feb 6 16:21:20 2014 -0500

    Use header bar on passwords dialog
    
    https://bugzilla.gnome.org/show_bug.cgi?id=723803

 src/prefs-dialog.c                |    4 ++-
 src/resources/passwords-dialog.ui |   63 ++++++++++++++++--------------------
 2 files changed, 31 insertions(+), 36 deletions(-)
---
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index 4903a95..7aed1cc 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -161,7 +161,9 @@ on_manage_passwords_button_clicked (GtkWidget *button,
 {
        PasswordsDialog *passwords_dialog;
 
-       passwords_dialog = g_object_new (EPHY_TYPE_PASSWORDS_DIALOG, NULL);
+       passwords_dialog = g_object_new (EPHY_TYPE_PASSWORDS_DIALOG,
+                                        "use-header-bar", TRUE,
+                                        NULL);
        gtk_window_set_transient_for (GTK_WINDOW (passwords_dialog), GTK_WINDOW (dialog));
        gtk_window_set_modal (GTK_WINDOW (passwords_dialog), TRUE);
        gtk_window_present (GTK_WINDOW (passwords_dialog));
diff --git a/src/resources/passwords-dialog.ui b/src/resources/passwords-dialog.ui
index 19aaa5a..f86d523 100644
--- a/src/resources/passwords-dialog.ui
+++ b/src/resources/passwords-dialog.ui
@@ -25,14 +25,39 @@
   <template class="PasswordsDialog" parent="GtkDialog">
     <property name="height_request">500</property>
     <property name="can_focus">False</property>
-    <property name="border_width">5</property>
-    <property name="title" translatable="yes">Passwords</property>
+    <property name="border_width">0</property>
     <property name="modal">True</property>
     <property name="window_position">center</property>
     <property name="default_width">300</property>
     <property name="default_height">600</property>
     <property name="destroy_with_parent">True</property>
     <property name="type_hint">dialog</property>
+    <child internal-child="headerbar">
+      <object class="GtkHeaderBar" id="headerbar1">
+        <property name="title" translatable="yes">Passwords</property>
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="show-close-button">True</property>
+        <child>
+          <object class="GtkButton" id="clear_button">
+            <property name="label" translatable="yes">C_lear All</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>
+            <property name="valign">center</property>
+            <style>
+              <class name="destructive-action"/>
+              <class name="text-button"/>
+            </style>
+          </object>
+          <packing>
+            <property name="pack_type">start</property>
+          </packing>
+        </child>
+      </object>
+    </child>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox2">
         <property name="visible">True</property>
@@ -41,40 +66,9 @@
         <property name="spacing">2</property>
         <child internal-child="action_area">
           <object class="GtkButtonBox" id="dialog-action_area2">
-            <property name="visible">True</property>
+            <property name="visible">False</property>
             <property name="can_focus">False</property>
             <property name="layout_style">end</property>
-            <child>
-              <object class="GtkButton" id="clear_button">
-                <property name="label" translatable="yes">C_lear All</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>
-                <property name="secondary">True</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>
@@ -299,7 +293,6 @@
     </child>
     <action-widgets>
       <action-widget response="-2">clear_button</action-widget>
-      <action-widget response="-7">close_button</action-widget>
     </action-widgets>
   </template>
   <object class="GtkMenu" id="treeview_popup_menu">


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