[gtk+] level-bar: add support for RTL locales



commit 5e55bf1d53c4135d454e2135706c1392407273e8
Author: Stefano Facchini <stefano facchini gmail com>
Date:   Tue Sep 18 14:19:01 2012 +0200

    level-bar: add support for RTL locales
    
    https://bugzilla.gnome.org/show_bug.cgi?id=684288

 gtk/gtklevelbar.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtklevelbar.c b/gtk/gtklevelbar.c
index 038cc52..2e477e5 100644
--- a/gtk/gtklevelbar.c
+++ b/gtk/gtklevelbar.c
@@ -480,6 +480,11 @@ gtk_level_bar_draw_fill (GtkLevelBar *self,
     trough_borders.top - trough_borders.bottom;
 
   inverted = self->priv->inverted;
+  if (gtk_widget_get_direction (GTK_WIDGET (self)) == GTK_TEXT_DIR_RTL)
+    {
+      if (self->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+        inverted = !inverted;
+    }
 
   if (self->priv->bar_mode == GTK_LEVEL_BAR_MODE_CONTINUOUS)
     gtk_level_bar_draw_fill_continuous (self, cr, inverted, &fill_area);



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