[gnome-system-log] window: make headerbar as titlebar and add close button



commit f7220c6ab37b2d394f4d055c021838c765285a35
Author: Yosef Or Boczko <yoseforb gmail com>
Date:   Tue Aug 13 13:44:31 2013 +0300

    window: make headerbar as titlebar and add close button
    
    move the grid in .ui file into the window and
    defined that in the .ui file also.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=705886
    
    Signed-off-by: Yosef Or Boczko <yoseforb gmail com>

 src/logview-window.c  |    3 -
 src/logview-window.ui |  185 +++++++++++++++++++++++++------------------------
 2 files changed, 95 insertions(+), 93 deletions(-)
---
diff --git a/src/logview-window.c b/src/logview-window.c
index 7ae56d2..480e5f9 100644
--- a/src/logview-window.c
+++ b/src/logview-window.c
@@ -1244,11 +1244,8 @@ logview_window_init (LogviewWindow *window)
   gtk_widget_init_template (GTK_WIDGET (window));
 
   gtk_window_set_title (GTK_WINDOW (window), _("System Log"));
-  gtk_window_set_icon_name (GTK_WINDOW (window), "logview");
-  gtk_window_set_hide_titlebar_when_maximized (GTK_WINDOW (window), TRUE);
 
   logview_prefs_get_stored_window_size (priv->prefs, &width, &height);
-  gtk_container_add (GTK_CONTAINER (window), priv->window_content);
   gtk_window_set_default_size (GTK_WINDOW (window), width, height);
 
   priv->find_bar = logview_findbar_new ();
diff --git a/src/logview-window.ui b/src/logview-window.ui
index c0ce68a..d76fb6b 100644
--- a/src/logview-window.ui
+++ b/src/logview-window.ui
@@ -57,13 +57,18 @@
       </item>
     </submenu>
   </menu>
-  <object class="GtkGrid" id="window_content">
-    <property name="visible">True</property>
+  <template class="LogviewWindow" parent="GtkApplicationWindow">
     <property name="can_focus">False</property>
-    <child>
+    <property name="resizable">True</property>
+    <property name="icon_name">logview</property>
+    <child type="titlebar">
       <object class="GtkHeaderBar" id="header_bar">
         <property name="visible">True</property>
         <property name="vexpand">False</property>
+        <property name="show_close_button">True</property>
+        <style>
+          <class name="titlebar"/>
+        </style>
         <child>
           <object class="GtkButton" id="find_button">
             <property name="visible">True</property>
@@ -111,125 +116,125 @@
           </packing>
         </child>
       </object>
-      <packing>
-        <property name="left_attach">0</property>
-        <property name="top_attach">0</property>
-        <property name="width">1</property>
-        <property name="height">1</property>
-      </packing>
-    </child>
-    <child>
-      <object class="GtkRevealer" id="find_bar_revealer">
-        <property name="visible">True</property>
-        <property name="reveal-child">False</property>
-      </object>
-      <packing>
-        <property name="left_attach">0</property>
-        <property name="top_attach">1</property>
-        <property name="width">1</property>
-        <property name="height">1</property>
-      </packing>
     </child>
     <child>
-      <object class="GtkPaned" id="paned1">
+      <object class="GtkGrid" id="window_content">
         <property name="visible">True</property>
-        <property name="can_focus">True</property>
-        <property name="hexpand">True</property>
-        <property name="vexpand">True</property>
+        <property name="can_focus">False</property>
         <child>
-          <object class="GtkScrolledWindow" id="sidebar_scrolledwindow">
+          <object class="GtkRevealer" id="find_bar_revealer">
             <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="hscrollbar_policy">never</property>
-            <property name="shadow_type">none</property>
-            <property name="hexpand">True</property>
-            <property name="vexpand">True</property>
+            <property name="reveal-child">False</property>
           </object>
           <packing>
-            <property name="resize">False</property>
-            <property name="shrink">True</property>
+            <property name="left_attach">0</property>
+            <property name="top_attach">1</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
           </packing>
         </child>
         <child>
-          <object class="GtkGrid" id="logpane">
+          <object class="GtkPaned" id="paned1">
             <property name="visible">True</property>
-            <property name="can_focus">False</property>
+            <property name="can_focus">True</property>
+            <property name="hexpand">True</property>
+            <property name="vexpand">True</property>
             <child>
-              <object class="GtkInfoBar" id="message_area">
-                <property name="visible">False</property>
-                <property name="app_paintable">True</property>
-                <property name="can_focus">False</property>
-                <property name="orientation">horizontal</property>
+              <object class="GtkScrolledWindow" id="sidebar_scrolledwindow">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="hscrollbar_policy">never</property>
+                <property name="shadow_type">none</property>
                 <property name="hexpand">True</property>
-                <child internal-child="content_area">
-                  <object class="GtkBox" id="infobar_content_area1">
-                    <property name="can_focus">False</property>
-                    <property name="border_width">8</property>
-                    <property name="spacing">16</property>
-                  </object>
-                  <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child internal-child="action_area">
-                  <object class="GtkButtonBox" id="infobar_action_area1">
-                    <property name="can_focus">False</property>
-                    <property name="border_width">5</property>
-                    <property name="orientation">vertical</property>
-                    <property name="spacing">6</property>
-                    <property name="layout_style">end</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
+                <property name="vexpand">True</property>
               </object>
               <packing>
-                <property name="left_attach">0</property>
-                <property name="top_attach">0</property>
-                <property name="width">1</property>
-                <property name="height">1</property>
+                <property name="resize">False</property>
+                <property name="shrink">True</property>
               </packing>
             </child>
             <child>
-              <object class="GtkScrolledWindow" id="log_scrolledwindow">
+              <object class="GtkGrid" id="logpane">
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="shadow_type">none</property>
-                <property name="hexpand">True</property>
-                <property name="vexpand">True</property>
+                <property name="can_focus">False</property>
                 <child>
-                  <object class="GtkTextView" id="text_view">
+                  <object class="GtkInfoBar" id="message_area">
+                    <property name="visible">False</property>
+                    <property name="app_paintable">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="orientation">horizontal</property>
+                    <property name="hexpand">True</property>
+                    <child internal-child="content_area">
+                      <object class="GtkBox" id="infobar_content_area1">
+                        <property name="can_focus">False</property>
+                        <property name="border_width">8</property>
+                        <property name="spacing">16</property>
+                      </object>
+                      <packing>
+                        <property name="expand">True</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child internal-child="action_area">
+                      <object class="GtkButtonBox" id="infobar_action_area1">
+                        <property name="can_focus">False</property>
+                        <property name="border_width">5</property>
+                        <property name="orientation">vertical</property>
+                        <property name="spacing">6</property>
+                        <property name="layout_style">end</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkScrolledWindow" id="log_scrolledwindow">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                    <property name="editable">False</property>
+                    <property name="shadow_type">none</property>
+                    <property name="hexpand">True</property>
+                    <property name="vexpand">True</property>
+                    <child>
+                      <object class="GtkTextView" id="text_view">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="editable">False</property>
+                      </object>
+                    </child>
                   </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">1</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
                 </child>
               </object>
               <packing>
-                <property name="left_attach">0</property>
-                <property name="top_attach">1</property>
-                <property name="width">1</property>
-                <property name="height">1</property>
+                <property name="resize">True</property>
+                <property name="shrink">True</property>
               </packing>
             </child>
           </object>
           <packing>
-            <property name="resize">True</property>
-            <property name="shrink">True</property>
+            <property name="left_attach">0</property>
+            <property name="top_attach">2</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
           </packing>
         </child>
       </object>
-      <packing>
-        <property name="left_attach">0</property>
-        <property name="top_attach">2</property>
-        <property name="width">1</property>
-        <property name="height">1</property>
-      </packing>
     </child>
-  </object>
+  </template>
 </interface>


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