[epiphany] Use header bar on cookies dialog



commit a6242a8fc0e90aa13558c5c7655efe7e6f4eb5ce
Author: William Jon McCann <william jon mccann gmail com>
Date:   Thu Feb 6 16:14:52 2014 -0500

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

 src/prefs-dialog.c              |    4 ++-
 src/resources/cookies-dialog.ui |   61 +++++++++++++++++---------------------
 2 files changed, 30 insertions(+), 35 deletions(-)
---
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index a079759..4903a95 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -147,7 +147,9 @@ on_manage_cookies_button_clicked (GtkWidget *button,
 {
        CookiesDialog *cookies_dialog;
 
-       cookies_dialog = g_object_new (EPHY_TYPE_COOKIES_DIALOG, NULL);
+       cookies_dialog = g_object_new (EPHY_TYPE_COOKIES_DIALOG,
+                                      "use-header-bar", TRUE,
+                                      NULL);
        gtk_window_set_transient_for (GTK_WINDOW (cookies_dialog), GTK_WINDOW (dialog));
        gtk_window_set_modal (GTK_WINDOW (cookies_dialog), TRUE);
        gtk_window_present (GTK_WINDOW (cookies_dialog));
diff --git a/src/resources/cookies-dialog.ui b/src/resources/cookies-dialog.ui
index eddd6f4..2dffb08 100644
--- a/src/resources/cookies-dialog.ui
+++ b/src/resources/cookies-dialog.ui
@@ -15,14 +15,39 @@
   <template class="CookiesDialog" 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">Cookies</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">Cookies</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>
@@ -34,37 +59,6 @@
             <property name="visible">True</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>
@@ -168,7 +162,6 @@
     </child>
     <action-widgets>
       <action-widget response="-2">clear_button</action-widget>
-      <action-widget response="-7">close_button</action-widget>
     </action-widgets>
   </template>
 </interface>


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