[gnome-logs] Use GtkIconTheme built-in RTL support



commit 16c1b8fee34b3ea40a512e8cef873fbc7bd33e56
Author: David King <davidk gnome org>
Date:   Mon Jun 30 08:59:30 2014 +0100

    Use GtkIconTheme built-in RTL support
    
    Remove custom code to handle different icons for RTL language support,
    and instead use the built-in support added to GtkIconTheme in 3.13.2.

 configure.ac            |    2 +-
 data/gl-eventtoolbar.ui |    2 ++
 src/gl-eventtoolbar.c   |   20 +-------------------
 src/gl-eventviewrow.c   |    8 +++-----
 4 files changed, 7 insertions(+), 25 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 47f4cfb..22cf7bf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -88,7 +88,7 @@ AM_CONDITIONAL([LOGS_ENABLE_TESTS], [test "x$testing_utilities" = "xyes"])
 
 dnl Libraries
 GIO_REQUIRED="gio-unix-2.0 >= 2.39.90"
-GTK_REQUIRED="gtk+-3.0 >= 3.11.5"
+GTK_REQUIRED="gtk+-3.0 >= 3.13.2"
 SYSTEMD_JOURNAL_REQUIRED="libsystemd-journal"
 PKG_CHECK_MODULES([LOGS], [$GIO_REQUIRED $GTK_REQUIRED $SYSTEMD_JOURNAL_REQUIRED])
 
diff --git a/data/gl-eventtoolbar.ui b/data/gl-eventtoolbar.ui
index fc06423..6f2463f 100644
--- a/data/gl-eventtoolbar.ui
+++ b/data/gl-eventtoolbar.ui
@@ -14,6 +14,8 @@
                 </style>
                 <child>
                     <object class="GtkImage" id="go_back_icon">
+                        <property name="icon-name">go-previous-symbolic</property>
+                        <property name="icon-size">1</property>
                         <property name="visible">True</property>
                     </object>
                 </child>
diff --git a/src/gl-eventtoolbar.c b/src/gl-eventtoolbar.c
index 9146d98..28cfaeb 100644
--- a/src/gl-eventtoolbar.c
+++ b/src/gl-eventtoolbar.c
@@ -1,6 +1,6 @@
 /*
  *  GNOME Logs - View and search logs
- *  Copyright (C) 2013  Red Hat, Inc.
+ *  Copyright (C) 2013, 2014  Red Hat, Inc.
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -33,7 +33,6 @@ enum
 typedef struct
 {
     GtkWidget *back_button;
-    GtkWidget *go_back_icon;
     GtkWidget *search_button;
     GlEventToolbarMode mode;
 } GlEventToolbarPrivate;
@@ -162,8 +161,6 @@ gl_event_toolbar_class_init (GlEventToolbarClass *klass)
     gtk_widget_class_bind_template_child_private (widget_class, GlEventToolbar,
                                                   back_button);
     gtk_widget_class_bind_template_child_private (widget_class, GlEventToolbar,
-                                                  go_back_icon);
-    gtk_widget_class_bind_template_child_private (widget_class, GlEventToolbar,
                                                   search_button);
 
     gtk_widget_class_bind_template_callback (widget_class,
@@ -173,25 +170,10 @@ gl_event_toolbar_class_init (GlEventToolbarClass *klass)
 static void
 gl_event_toolbar_init (GlEventToolbar *toolbar)
 {
-    GlEventToolbarPrivate *priv = gl_event_toolbar_get_instance_private (toolbar);
-
     gtk_widget_init_template (GTK_WIDGET (toolbar));
 
     g_signal_connect (toolbar, "notify::mode", G_CALLBACK (on_notify_mode),
                       NULL);
-
-    if (gtk_widget_get_direction (GTK_WIDGET (toolbar)) == GTK_TEXT_DIR_RTL)
-    {
-        gtk_image_set_from_icon_name (GTK_IMAGE (priv->go_back_icon),
-                                      "go-previous-rtl-symbolic",
-                                      GTK_ICON_SIZE_MENU);
-    }
-    else
-    {
-        gtk_image_set_from_icon_name (GTK_IMAGE (priv->go_back_icon),
-                                      "go-previous-symbolic",
-                                      GTK_ICON_SIZE_MENU);
-    }
 }
 
 gboolean
diff --git a/src/gl-eventviewrow.c b/src/gl-eventviewrow.c
index 3699150..18a2adc 100644
--- a/src/gl-eventviewrow.c
+++ b/src/gl-eventviewrow.c
@@ -1,6 +1,6 @@
 /*
  *  GNOME Logs - View and search logs
- *  Copyright (C) 2013  Red Hat, Inc.
+ *  Copyright (C) 2013, 2014  Red Hat, Inc.
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -158,8 +158,7 @@ gl_event_view_row_create_cmdline (GlEventViewRow *row)
     gtk_widget_set_halign (label, GTK_ALIGN_END);
     gtk_grid_attach (GTK_GRID (grid), label, rtl ? 0 : 1, 0, 1, 1);
 
-    image = gtk_image_new_from_icon_name (rtl ? "go-next-rtl-symbolic"
-                                              : "go-next-symbolic",
+    image = gtk_image_new_from_icon_name ("go-next-symbolic",
                                           GTK_ICON_SIZE_MENU);
     gtk_grid_attach (GTK_GRID (grid), image, 2, 0, 1, 2);
 
@@ -207,8 +206,7 @@ gl_event_view_row_create_simple (GlEventViewRow *row)
     gtk_widget_set_halign (label, GTK_ALIGN_END);
     gtk_grid_attach (GTK_GRID (grid), label, rtl ? 1 : 0, 0, 1, 1);
 
-    image = gtk_image_new_from_icon_name (rtl ? "go-next-rtl-symbolic"
-                                              : "go-next-symbolic",
+    image = gtk_image_new_from_icon_name ("go-next-symbolic",
                                           GTK_ICON_SIZE_MENU);
     gtk_grid_attach (GTK_GRID (grid), image, 1, 0, 1, 2);
 


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