diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2013-08-24 20:17:09 -0700 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2013-08-31 17:25:49 -0400 |
commit | 89214cad5b19f760ea0508fd2418a540744f3660 (patch) | |
tree | b1ada26dc56e50cb91bfc7715ad3aacd24cd4239 /gtk/gtkpathbar.c | |
parent | c9cc58de499ad082a321669d0a6f4ed1481e1833 (diff) | |
download | gtk+-89214cad5b19f760ea0508fd2418a540744f3660.tar.gz |
pathbar: fix positioning of the down slider button
So that it's always linked with the rest of the pathbar.
https://bugzilla.gnome.org/show_bug.cgi?id=706722
Diffstat (limited to 'gtk/gtkpathbar.c')
-rw-r--r-- | gtk/gtkpathbar.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c index f9135b5406..70f124d642 100644 --- a/gtk/gtkpathbar.c +++ b/gtk/gtkpathbar.c @@ -537,6 +537,7 @@ gtk_path_bar_size_allocate (GtkWidget *widget, gint allocation_width; gboolean need_sliders = FALSE; gint up_slider_offset = 0; + gint down_slider_offset = 0; GtkRequisition child_requisition; gboolean needs_reorder = FALSE; @@ -703,8 +704,15 @@ gtk_path_bar_size_allocate (GtkWidget *widget, gtk_widget_set_child_visible (child, TRUE); gtk_widget_size_allocate (child, &child_allocation); - if (direction == GTK_TEXT_DIR_LTR) - child_allocation.x += child_allocation.width; + if (direction == GTK_TEXT_DIR_RTL) + { + down_slider_offset = child_allocation.x - allocation->x - path_bar->priv->slider_width; + } + else + { + down_slider_offset += child_allocation.width; + child_allocation.x += child_allocation.width; + } } /* Now we go hide all the widgets that don't fit */ while (list) @@ -730,6 +738,9 @@ gtk_path_bar_size_allocate (GtkWidget *widget, needs_reorder |= gtk_widget_get_child_visible (path_bar->priv->up_slider_button) == FALSE; gtk_widget_set_child_visible (path_bar->priv->up_slider_button, TRUE); gtk_widget_show_all (path_bar->priv->up_slider_button); + + if (direction == GTK_TEXT_DIR_LTR) + down_slider_offset += path_bar->priv->slider_width; } else { @@ -740,13 +751,7 @@ gtk_path_bar_size_allocate (GtkWidget *widget, if (need_sliders) { child_allocation.width = path_bar->priv->slider_width; - - if (direction == GTK_TEXT_DIR_RTL) - child_allocation.x = 0; - else - child_allocation.x = allocation->width - path_bar->priv->slider_width; - - child_allocation.x += allocation->x; + child_allocation.x = down_slider_offset + allocation->x; gtk_widget_size_allocate (path_bar->priv->down_slider_button, &child_allocation); |