[gnome-control-center] sound: Flip the input level bar in RTL languages
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] sound: Flip the input level bar in RTL languages
- Date: Tue, 25 Sep 2012 11:12:43 +0000 (UTC)
commit fb8b858cba020c850e09f65f9b4d83adecface3a
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Sep 22 23:04:02 2012 -0400
sound: Flip the input level bar in RTL languages
https://bugzilla.gnome.org/show_bug.cgi?id=684603
panels/sound/gvc-level-bar.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/panels/sound/gvc-level-bar.c b/panels/sound/gvc-level-bar.c
index dd14aa9..f7a93cb 100644
--- a/panels/sound/gvc-level-bar.c
+++ b/panels/sound/gvc-level-bar.c
@@ -583,6 +583,8 @@ gvc_level_bar_draw (GtkWidget *widget,
bar = GVC_LEVEL_BAR (widget);
+ cairo_save (cr);
+
if (bar->priv->orientation == GTK_ORIENTATION_VERTICAL) {
int i;
int by;
@@ -622,6 +624,11 @@ gvc_level_bar_draw (GtkWidget *widget,
int i;
int bx;
+ if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) {
+ cairo_scale (cr, -1, 1);
+ cairo_translate (cr, -gtk_widget_get_allocated_width (widget), 0);
+ }
+
for (i = 0; i < NUM_BOXES; i++) {
bx = i * bar->priv->layout.delta;
curved_rectangle (cr,
@@ -655,6 +662,8 @@ gvc_level_bar_draw (GtkWidget *widget,
}
}
+ cairo_restore (cr);
+
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]