[gnome-system-log] window: port to GtkHeaderBar, GtkButton and GtkRevealer



commit 0444930a926b9bf5c33b5044d7c51728374133c8
Author: Yosef Or Boczko <yoseforb gmail com>
Date:   Tue Aug 13 11:44:54 2013 +0300

    window: port to GtkHeaderBar, GtkButton and GtkRevealer
    
    * GdHeader*Button -> GtkButton subclass
    * GdHeaderButton -> GtkHeaderButton
    * GdRevealer -> GtkRevealer
    
    https://bugzilla.gnome.org/show_bug.cgi?id=705881
    
    Signed-off-by: Yosef Or Boczko <yoseforb gmail com>

 configure.ac          |    2 --
 src/logview-window.c  |   15 ++++++---------
 src/logview-window.ui |   39 +++++++++++++++++++++++++++++++--------
 3 files changed, 37 insertions(+), 19 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 16980ab..cb2964c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,8 +70,6 @@ PKG_CHECK_MODULES(LOGVIEW,
                   gtk+-3.0 >= $GTK_MIN_VERSION)
 
 LIBGD_INIT([
-  header-bar
-  revealer
   static
 ])
 
diff --git a/src/logview-window.c b/src/logview-window.c
index 7c5221c..5e8d157 100644
--- a/src/logview-window.c
+++ b/src/logview-window.c
@@ -25,7 +25,6 @@
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 #include <glib/gi18n.h>
-#include <libgd/gd.h>
 
 #include "logview-window.h"
 
@@ -174,7 +173,7 @@ logview_update_header (LogviewWindow *logview,
     goto out;
   }
 
-  if (gd_revealer_get_reveal_child (GD_REVEALER (logview->priv->find_bar_revealer))) {
+  if (gtk_revealer_get_reveal_child (GTK_REVEALER (logview->priv->find_bar_revealer))) {
     title = g_strdup_printf (_("Search in \"%s\""),
                              logview_log_get_display_name (active));
     goto out;
@@ -209,8 +208,8 @@ logview_update_header (LogviewWindow *logview,
   subtitle = g_string_free (string, FALSE);
 
  out:
-  gd_header_bar_set_title (GD_HEADER_BAR (logview->priv->header_bar), title);
-  gd_header_bar_set_subtitle (GD_HEADER_BAR (logview->priv->header_bar), subtitle);
+  gtk_header_bar_set_title (GTK_HEADER_BAR (logview->priv->header_bar), title);
+  gtk_header_bar_set_subtitle (GTK_HEADER_BAR (logview->priv->header_bar), subtitle);
 
   g_free (title);
   g_free (subtitle);
@@ -371,8 +370,8 @@ wrap:
   primary = g_strdup_printf (_("Search in \"%s\""),
                              logview_log_get_display_name (active_log));
 
-  gd_header_bar_set_title (GD_HEADER_BAR (logview->priv->header_bar), primary);
-  gd_header_bar_set_subtitle (GD_HEADER_BAR (logview->priv->header_bar), secondary);
+  gtk_header_bar_set_title (GTK_HEADER_BAR (logview->priv->header_bar), primary);
+  gtk_header_bar_set_subtitle (GTK_HEADER_BAR (logview->priv->header_bar), secondary);
 
 
   g_free (primary);
@@ -1134,7 +1133,7 @@ action_search_change_state (GSimpleAction *action,
   gboolean open = g_variant_get_boolean (state);
   LogviewLog *active_log = logview_manager_get_active_log (logview_manager_get ());
 
-  gd_revealer_set_reveal_child (GD_REVEALER (logview->priv->find_bar_revealer),
+  gtk_revealer_set_reveal_child (GTK_REVEALER (logview->priv->find_bar_revealer),
                                 open);
   if (open) {
     gtk_widget_grab_focus (logview->priv->find_bar);
@@ -1215,8 +1214,6 @@ logview_window_init (LogviewWindow *logview)
   logview_prefs_get_stored_window_size (priv->prefs, &width, &height);
   gtk_window_set_default_size (GTK_WINDOW (logview), width, height);
 
-  gd_ensure_types ();
-
   builder = gtk_builder_new ();
 
   if (!gtk_builder_add_from_resource (builder, "/org/gnome/logview/logview-window.ui", &err)) {
diff --git a/src/logview-window.ui b/src/logview-window.ui
index ee826ed..9c7fc61 100644
--- a/src/logview-window.ui
+++ b/src/logview-window.ui
@@ -61,27 +61,50 @@
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <child>
-      <object class="GdHeaderBar" id="headerbar">
+      <object class="GtkHeaderBar" id="headerbar">
         <property name="visible">True</property>
         <property name="vexpand">False</property>
         <child>
-          <object class="GdHeaderSimpleButton" id="find-button">
+          <object class="GtkButton" id="find-button">
             <property name="visible">True</property>
             <property name="can_focus">True</property>
-            <property name="symbolic-icon-name">edit-find-symbolic</property>
+            <property name="valign">center</property>
             <property name="action_name">win.search</property>
+            <style>
+              <class name="image-button"/>
+            </style>
+            <child>
+              <object class="GtkImage" id="find-image">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="icon_size">1</property>
+                <property name="icon_name">edit-find-symbolic</property>
+              </object>
+            </child>
           </object>
           <packing>
             <property name="pack_type">end</property>
           </packing>
         </child>
         <child>
-          <object class="GdHeaderMenuButton" id="gear-button">
+          <object class="GtkMenuButton" id="button1">
             <property name="visible">True</property>
             <property name="can_focus">True</property>
-            <property name="symbolic-icon-name">emblem-system-symbolic</property>
-            <property name="menu-model">gear-menu</property>
+            <property name="halign">end</property>
+            <property name="valign">center</property>
+            <property name="menu_model">gear-menu</property>
             <property name="action_name">win.gear-menu</property>
+            <style>
+              <class name="image-button"/>
+            </style>
+            <child>
+              <object class="GtkImage" id="image1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="icon_name">emblem-system-symbolic</property>
+                <property name="icon_size">1</property>
+              </object>
+            </child>
           </object>
           <packing>
             <property name="pack_type">end</property>
@@ -96,9 +119,9 @@
       </packing>
     </child>
     <child>
-      <object class="GdRevealer" id="find-bar-revealer">
+      <object class="GtkRevealer" id="find-bar-revealer">
         <property name="visible">True</property>
-        <property name="reveal-child">false</property>
+        <property name="reveal-child">False</property>
       </object>
       <packing>
         <property name="left_attach">0</property>


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