summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-04 00:26:52 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-04 00:26:52 +0000
commit3b1ccf61e2e0b94ed0f9846b1b4e993a927cd553 (patch)
tree581dd7fbaa29244030eb5b3614732596bc110380 /chrome/browser
parent60222437a31765923a630cc4201398e697eb0c66 (diff)
downloadchromium_src-3b1ccf61e2e0b94ed0f9846b1b4e993a927cd553.zip
chromium_src-3b1ccf61e2e0b94ed0f9846b1b4e993a927cd553.tar.gz
chromium_src-3b1ccf61e2e0b94ed0f9846b1b4e993a927cd553.tar.bz2
GTK: make browser action container behave better in RTL.
a) fix gripper resize b) fix browser action drag movement BUG=42697 TEST=LANG=he_IL chrome Review URL: http://codereview.chromium.org/1789005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46302 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/gtk/browser_actions_toolbar_gtk.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/chrome/browser/gtk/browser_actions_toolbar_gtk.cc b/chrome/browser/gtk/browser_actions_toolbar_gtk.cc
index 0ea880c..694e502 100644
--- a/chrome/browser/gtk/browser_actions_toolbar_gtk.cc
+++ b/chrome/browser/gtk/browser_actions_toolbar_gtk.cc
@@ -6,6 +6,7 @@
#include <vector>
+#include "base/i18n/rtl.h"
#include "chrome/browser/browser.h"
#include "chrome/browser/extensions/extension_browser_event_router.h"
#include "chrome/browser/extensions/extension_context_menu_model.h"
@@ -666,6 +667,8 @@ gboolean BrowserActionsToolbarGtk::OnDragMotion(GtkWidget* widget,
if (!drag_button_)
return FALSE;
+ if (base::i18n::IsRTL())
+ x = widget->allocation.width - x;
drop_index_ = x < kButtonSize ? 0 : x / (kButtonSize + kButtonPadding);
// We will go ahead and reorder the child in order to provide visual feedback
@@ -727,8 +730,12 @@ gboolean BrowserActionsToolbarGtk::OnGripperMotionNotify(
if (!(event->state & GDK_BUTTON1_MASK))
return FALSE;
- gint new_width = button_hbox_->allocation.width -
- (event->x - widget->allocation.width);
+ // Calculate how much the user dragged the gripper and subtract that off the
+ // button container's width.
+ int distance_dragged = base::i18n::IsRTL() ?
+ -event->x :
+ event->x - widget->allocation.width;
+ gint new_width = button_hbox_->allocation.width - distance_dragged;
SetButtonHBoxWidth(new_width);
return FALSE;