[gnome-control-center] user-accounts: Use header bar in the history dialog



commit 00dacd5854161d6a87fee513ea65b63fdde6025d
Author: Yosef Or Boczko <yoseforb src gnome org>
Date:   Mon Mar 24 09:21:40 2014 +0200

    user-accounts: Use header bar in the history dialog
    
    https://bugzilla.gnome.org/show_bug.cgi?id=724299

 panels/user-accounts/data/history-dialog.ui |  138 +++++++++------------------
 panels/user-accounts/um-history-dialog.c    |    5 +-
 2 files changed, 45 insertions(+), 98 deletions(-)
---
diff --git a/panels/user-accounts/data/history-dialog.ui b/panels/user-accounts/data/history-dialog.ui
index a12fea8..149d73c 100644
--- a/panels/user-accounts/data/history-dialog.ui
+++ b/panels/user-accounts/data/history-dialog.ui
@@ -9,113 +9,66 @@
     <property name="window_position">center-on-parent</property>
     <property name="icon_name">system-users</property>
     <property name="type_hint">dialog</property>
-    <child internal-child="vbox">
-      <object class="GtkBox" id="dialog-vbox1">
+    <property name="use_header_bar">1</property>
+    <child internal-child="headerbar">
+      <object class="GtkHeaderBar" id="dialog-header-bar">
+        <property name="visible">True</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>
+        <property name="title" translatable="yes">Login History</property>
+        <property name="subtitle" translatable="yes">Login History</property>
+        <property name="show_close_button">True</property>
+        <child>
+          <object class="GtkButton" id="previous-button">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="valign">center</property>
+            <style>
+              <class name="image-button"/>
+            </style>
             <child>
-              <object class="GtkButton" id="close-button">
-                <property name="label" translatable="yes">Close</property>
+              <object class="GtkImage" id="previous-image">
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
+                <property name="can_focus">False</property>
               </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</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>
+            <property name="pack_type">start</property>
           </packing>
         </child>
         <child>
-          <object class="GtkBox" id="box1">
+          <object class="GtkButton" id="next-button">
             <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="orientation">vertical</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <style>
+              <class name="image-button"/>
+            </style>
             <child>
-              <object class="GtkBox" id="box3">
+              <object class="GtkImage" id="next-image">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="margin_start">6</property>
-                <property name="margin_end">6</property>
-                <property name="spacing">6</property>
-                <child>
-                  <object class="GtkButton" id="previous-button">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">True</property>
-                    <property name="valign">center</property>
-                    <style>
-                      <class name="image-button"/>
-                    </style>
-                    <child>
-                      <object class="GtkImage" id="previous-image">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                      </object>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="week-label">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <attributes>
-                      <attribute name="weight" value="bold"/>
-                    </attributes>
-                  </object>
-                  <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkButton" id="next-button">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">True</property>
-                    <style>
-                      <class name="image-button"/>
-                    </style>
-                    <child>
-                      <object class="GtkImage" id="next-image">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="valign">center</property>
-                      </object>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">2</property>
-                  </packing>
-                </child>
+                <property name="valign">center</property>
               </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
             </child>
+          </object>
+          <packing>
+            <property name="pack_type">end</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox1">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">2</property>
+        <child>
+          <object class="GtkBox" id="box1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
             <child>
               <object class="GtkScrolledWindow" id="scrolledwindow1">
                 <property name="width_request">350</property>
@@ -152,8 +105,5 @@
         </child>
       </object>
     </child>
-    <action-widgets>
-      <action-widget response="0">close-button</action-widget>
-    </action-widgets>
   </object>
 </interface>
diff --git a/panels/user-accounts/um-history-dialog.c b/panels/user-accounts/um-history-dialog.c
index c489e4a..f63029d 100644
--- a/panels/user-accounts/um-history-dialog.c
+++ b/panels/user-accounts/um-history-dialog.c
@@ -114,7 +114,7 @@ show_week_label (UmHistoryDialog *um)
                 g_free (to);
         }
 
-        gtk_label_set_label (GTK_LABEL (get_widget (um, "week-label")), label);
+        gtk_header_bar_set_subtitle (GTK_HEADER_BAR (get_widget (um, "dialog-header-bar")), label);
 
         g_free (label);
 }
@@ -365,9 +365,6 @@ um_history_dialog_new (void)
         um->dialog = get_widget (um, "dialog");
         g_signal_connect (um->dialog, "delete-event", G_CALLBACK (gtk_widget_hide_on_delete), NULL);
 
-        widget = get_widget (um, "close-button");
-        g_signal_connect (widget, "clicked", G_CALLBACK (close_history_dialog), um);
-
         widget = get_widget (um, "next-button");
         g_signal_connect (widget, "clicked", G_CALLBACK (show_next), um);
 


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