aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Saavedra <csaavedra@igalia.com>2012-12-15 04:26:58 +0800
committerClaudio Saavedra <csaavedra@igalia.com>2012-12-15 18:25:11 +0800
commitc83458d2b065ba4056163dff6db1bc0779e0b8fd (patch)
treecade95e849c918eeca00fb59c44b0d8da4c90c76
parent9dc80533f94749c0e765e4508e2fb8cb9c6cb5b1 (diff)
downloadgsoc2013-epiphany-c83458d2b065ba4056163dff6db1bc0779e0b8fd.tar
gsoc2013-epiphany-c83458d2b065ba4056163dff6db1bc0779e0b8fd.tar.gz
gsoc2013-epiphany-c83458d2b065ba4056163dff6db1bc0779e0b8fd.tar.bz2
gsoc2013-epiphany-c83458d2b065ba4056163dff6db1bc0779e0b8fd.tar.lz
gsoc2013-epiphany-c83458d2b065ba4056163dff6db1bc0779e0b8fd.tar.xz
gsoc2013-epiphany-c83458d2b065ba4056163dff6db1bc0779e0b8fd.tar.zst
gsoc2013-epiphany-c83458d2b065ba4056163dff6db1bc0779e0b8fd.zip
ephy-toolbar: fix the toolbar in RTL environments
https://bugzilla.gnome.org/show_bug.cgi?id=684366
-rw-r--r--src/ephy-toolbar.c11
-rw-r--r--src/ephy-window.c13
2 files changed, 20 insertions, 4 deletions
diff --git a/src/ephy-toolbar.c b/src/ephy-toolbar.c
index 6fff281ac..3af2e9390 100644
--- a/src/ephy-toolbar.c
+++ b/src/ephy-toolbar.c
@@ -135,7 +135,10 @@ ephy_toolbar_constructed (GObject *object)
gtk_container_add (GTK_CONTAINER (back_forward), box);
gtk_container_add (GTK_CONTAINER (toolbar), GTK_WIDGET (back_forward));
gtk_widget_show_all (GTK_WIDGET (back_forward));
- gtk_widget_set_margin_right (GTK_WIDGET (back_forward), 12);
+ if (gtk_widget_get_direction (GTK_WIDGET (back_forward)) == GTK_TEXT_DIR_RTL)
+ gtk_widget_set_margin_left (GTK_WIDGET (back_forward), 12);
+ else
+ gtk_widget_set_margin_right (GTK_WIDGET (back_forward), 12);
/* Location and Reload/Stop */
location_stop_reload = gtk_tool_item_new ();
@@ -170,7 +173,11 @@ ephy_toolbar_constructed (GObject *object)
gtk_size_group_add_widget (size, location);
g_object_unref (size);
- gtk_widget_set_margin_right (GTK_WIDGET (location_stop_reload), 12);
+ if (gtk_widget_get_direction (GTK_WIDGET (location_stop_reload)) == GTK_TEXT_DIR_RTL)
+ gtk_widget_set_margin_left (GTK_WIDGET (location_stop_reload), 12);
+ else
+ gtk_widget_set_margin_right (GTK_WIDGET (location_stop_reload), 12);
+
gtk_widget_show_all (GTK_WIDGET (location_stop_reload));
/* Page Menu */
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 0649701ac..37bc34b2d 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1297,6 +1297,7 @@ setup_ui_manager (EphyWindow *window)
GtkActionGroup *action_group;
GtkAction *action;
GtkUIManager *manager;
+ const char *prev_icon, *next_icon;
window->priv->main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show (window->priv->main_vbox);
@@ -1356,12 +1357,20 @@ setup_ui_manager (EphyWindow *window)
window->priv->tab_accels_action_group = action_group;
g_object_unref (action_group);
+ if (gtk_widget_get_direction (GTK_WIDGET (window)) == GTK_TEXT_DIR_RTL) {
+ prev_icon = "go-previous-rtl-symbolic";
+ next_icon = "go-next-rtl-symbolic";
+ } else {
+ prev_icon = "go-previous-symbolic";
+ next_icon = "go-next-symbolic";
+ }
+
action_group = gtk_action_group_new ("SpecialToolbarActions");
action =
g_object_new (EPHY_TYPE_NAVIGATION_HISTORY_ACTION,
"name", "NavigationBack",
"label", _("Back"),
- "icon-name", "go-previous-symbolic",
+ "icon-name", prev_icon,
"window", window,
"direction", EPHY_NAVIGATION_HISTORY_DIRECTION_BACK,
NULL);
@@ -1373,7 +1382,7 @@ setup_ui_manager (EphyWindow *window)
g_object_new (EPHY_TYPE_NAVIGATION_HISTORY_ACTION,
"name", "NavigationForward",
"label", _("Forward"),
- "icon-name", "go-next-symbolic",
+ "icon-name", next_icon,
"window", window,
"direction", EPHY_NAVIGATION_HISTORY_DIRECTION_FORWARD,
NULL);