diff options
author | Matthias Clasen <mclasen@redhat.com> | 2006-03-04 05:17:40 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2006-03-04 05:17:40 +0000 |
commit | 6074d1f9d4c3ffc69f6ed79e081d340950644a3c (patch) | |
tree | 6e1da7259c5456cfa1053902e8aae3c28b66848c /gtk/gtkexpander.c | |
parent | 9907ebb2ce5854819efec570b0924bdd378a53f4 (diff) | |
download | gtk+-6074d1f9d4c3ffc69f6ed79e081d340950644a3c.tar.gz |
Position the focus rectangle correctly in RTL mode. (#333291, Benjamin
2006-03-04 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkexpander.c (gtk_expander_paint_focus): Position
the focus rectangle correctly in RTL mode. (#333291,
Benjamin Berg)
Diffstat (limited to 'gtk/gtkexpander.c')
-rw-r--r-- | gtk/gtkexpander.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c index bf537ca7c7..a5688806c1 100644 --- a/gtk/gtkexpander.c +++ b/gtk/gtkexpander.c @@ -817,12 +817,6 @@ gtk_expander_paint_focus (GtkExpander *expander, ltr = gtk_widget_get_direction (widget) != GTK_TEXT_DIR_RTL; - x = widget->allocation.x + border_width; - y = widget->allocation.y + border_width; - - if (ltr && interior_focus) - x += expander_spacing * 2 + expander_size; - width = height = 0; if (priv->label_widget && GTK_WIDGET_VISIBLE (priv->label_widget)) @@ -833,15 +827,29 @@ gtk_expander_paint_focus (GtkExpander *expander, height = label_allocation.height; } + width += 2 * focus_pad + 2 * focus_width; + height += 2 * focus_pad + 2 * focus_width; + + x = widget->allocation.x + border_width; + y = widget->allocation.y + border_width; + + if (ltr) + { + if (interior_focus) + x += expander_spacing * 2 + expander_size; + } + else + { + x += widget->allocation.width - 2 * border_width + - expander_spacing * 2 - expander_size - width; + } + if (!interior_focus) { width += expander_size + 2 * expander_spacing; height = MAX (height, expander_size + 2 * expander_spacing); } - width += 2 * focus_pad + 2 * focus_width; - height += 2 * focus_pad + 2 * focus_width; - gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget), area, widget, "expander", x, y, width, height); |