Bug 405210 - "Improve look of location bar dropdown button" (followup patch: fix some glitches) [p=twanno@lycos.nl (Teune van Steeg) r=gavin r+sr=roc a1.9=schrep]
authorreed@reedloden.com
Mon, 14 Jan 2008 03:13:39 -0800
changeset 10254 57ebd0806c1e377d249c04f4c830090dfd5cffb4
parent 10253 fc35f8032b377599dd62407b6c5216ef04c04ae4
child 10255 372d37c242bbcacd26a0555ec692dfcbd2320fe3
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs405210
milestone1.9b3pre
Bug 405210 - "Improve look of location bar dropdown button" (followup patch: fix some glitches) [p=twanno@lycos.nl (Teune van Steeg) r=gavin r+sr=roc a1.9=schrep]
toolkit/themes/gnomestripe/global/autocomplete.css
widget/src/gtk2/gtk2drawing.c
--- a/toolkit/themes/gnomestripe/global/autocomplete.css
+++ b/toolkit/themes/gnomestripe/global/autocomplete.css
@@ -66,16 +66,17 @@ textbox.padded {
 }
 
 .autocomplete-textbox-container {
   -moz-box-align: center;
 }
 
 textbox[enablehistory="true"] > .autocomplete-textbox-container {
   -moz-appearance: menulist-textfield;
+  -moz-margin-end: -3px;
 }
 
 .textbox-input-box {
   margin: 0 3px;
   -moz-box-align: center;
 }
 
 /* ::::: history button ::::: */
--- a/widget/src/gtk2/gtk2drawing.c
+++ b/widget/src/gtk2/gtk2drawing.c
@@ -1431,16 +1431,17 @@ moz_gtk_option_menu_paint(GdkDrawable* d
 }
 
 static gint
 moz_gtk_dropdown_arrow_paint(GdkDrawable* drawable, GdkRectangle* rect,
                              GdkRectangle* cliprect, GtkWidgetState* state,
                              GtkTextDirection direction)
 {
     gfloat arrow_scaling;
+    gint real_arrow_padding;
     GdkRectangle arrow_rect, real_arrow_rect;
     GtkStateType state_type = ConvertGtkState(state);
     GtkShadowType shadow_type = state->active ? GTK_SHADOW_IN : GTK_SHADOW_OUT;
     GtkStyle* style;
 
     ensure_arrow_widget();
     gtk_widget_set_direction(gDropdownButtonWidget, direction);
 
@@ -1459,17 +1460,21 @@ moz_gtk_dropdown_arrow_paint(GdkDrawable
     TSOffsetStyleGCs(style, real_arrow_rect.x, real_arrow_rect.y);
 
     gtk_widget_style_get(gArrowWidget,
                          "arrow-scaling", &arrow_scaling,
                          NULL);
     real_arrow_rect.width = real_arrow_rect.height =
         MIN (real_arrow_rect.width, real_arrow_rect.height) * arrow_scaling;
 
-    real_arrow_rect.x = floor (arrow_rect.x + ((arrow_rect.width - real_arrow_rect.width) / 2) + 0.5);
+    real_arrow_padding = floor((arrow_rect.width - real_arrow_rect.width) / 2 + 0.5);
+    real_arrow_rect.x = arrow_rect.x + real_arrow_padding;
+    if (direction == GTK_TEXT_DIR_RTL)
+        real_arrow_rect.x = arrow_rect.x + arrow_rect.width -
+                            real_arrow_rect.width - real_arrow_padding;
     real_arrow_rect.y = floor (arrow_rect.y + ((arrow_rect.height - real_arrow_rect.height) / 2) + 0.5);
 
     gtk_paint_arrow(style, drawable, state_type, shadow_type, cliprect,
                     gDropdownButtonWidget, "arrow",  GTK_ARROW_DOWN, TRUE,
                     real_arrow_rect.x, real_arrow_rect.y,
                     real_arrow_rect.width, real_arrow_rect.height);
 
     return MOZ_GTK_SUCCESS;