[goobox] Set button arrow icons according to locale's text direction
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [goobox] Set button arrow icons according to locale's text direction
- Date: Thu, 20 Jun 2013 17:06:52 +0000 (UTC)
commit 6ae8c25787ec20fc9718d73c6e425b786b83c519
Author: Yosef Or Boczko <yosefor3 walla com>
Date: Wed Jun 19 17:43:34 2013 +0300
Set button arrow icons according to locale's text direction
src/goo-player-bar.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/goo-player-bar.c b/src/goo-player-bar.c
index 6e31415..ddda839 100644
--- a/src/goo-player-bar.c
+++ b/src/goo-player-bar.c
@@ -263,6 +263,9 @@ goo_player_bar_construct (GooPlayerBar *self,
GtkWidget *main_box;
GtkWidget *button_box;
GtkWidget *button;
+ gboolean rtl;
+
+ rtl = gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL;
frame = gtk_event_box_new ();
gtk_style_context_add_class (gtk_widget_get_style_context (frame), "goobox-player-bar");
@@ -290,11 +293,11 @@ goo_player_bar_construct (GooPlayerBar *self,
gtk_style_context_add_class (gtk_widget_get_style_context (button_box), GTK_STYLE_CLASS_LINKED);
gtk_box_pack_start (GTK_BOX (main_box), button_box, FALSE, FALSE, 0);
- button = _gtk_button_new_from_icon_name (GOO_STOCK_PREV, GTK_ICON_SIZE_SMALL_TOOLBAR);
+ button = _gtk_button_new_from_icon_name (rtl ? GOO_STOCK_NEXT : GOO_STOCK_PREV,
GTK_ICON_SIZE_SMALL_TOOLBAR);
_gtk_button_sync_with_action (button, gtk_action_group_get_action (actions, "Prev"));
gtk_box_pack_start (GTK_BOX (button_box), button, FALSE, FALSE, 0);
- button = _gtk_button_new_from_icon_name (GOO_STOCK_NEXT, GTK_ICON_SIZE_SMALL_TOOLBAR);
+ button = _gtk_button_new_from_icon_name (rtl ? GOO_STOCK_PREV : GOO_STOCK_NEXT,
GTK_ICON_SIZE_SMALL_TOOLBAR);
_gtk_button_sync_with_action (button, gtk_action_group_get_action (actions, "Next"));
gtk_box_pack_start (GTK_BOX (button_box), button, FALSE, FALSE, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]