Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorBenjamin Berg <benjamin@sipsolutions.net>2007-09-28 17:17:57 (GMT)
committer Benjamin Berg <benjamin@sipsolutions.net>2007-09-28 17:17:57 (GMT)
commitcd0548850aedd254401275fae78de62bc9646648 (patch)
tree28ee7a16f572bc1d2838900518d02b928fd4c527 /gtk
parentaf1a104682fc6db035f66fdb8e8621faaac392f9 (diff)
Fixed the menu arrow color and added a hack to draw the scroll boxes better in menus.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/engine/sugar-style.c23
-rw-r--r--gtk/theme/gtkrc.em5
2 files changed, 25 insertions, 3 deletions
diff --git a/gtk/engine/sugar-style.c b/gtk/engine/sugar-style.c
index 8502a16..207382b 100644
--- a/gtk/engine/sugar-style.c
+++ b/gtk/engine/sugar-style.c
@@ -439,8 +439,29 @@ sugar_style_draw_box (GtkStyle *style,
x + (width - SUGAR_RC_STYLE (style->rc_style)->line_width) / 2);
} else if (DETAIL ("menu") || DETAIL ("palette")) {
SugarInfo info;
-
sugar_fill_generic_info (&info, style, state_type, shadow_type, widget, detail, x, y, width, height);
+
+ /* This code is to detect the up/down arrow buttons, as GTK+ unfortunately
+ * does not have any special detail string :-/
+ * The reason we need this hack is that there is no other way to get the
+ * correct padding on the top/bottom menu item. */
+ if (widget && widget->allocation.x == 0) {
+ /* Just make the area larger, it does not matter really how
+ * we do this ... note that this ignores GtkMenu::horizontal-padding
+ * and GtkMenu::vertical-padding ... */
+ if (y == style->ythickness) {
+ info.pos.x -= style->xthickness;
+ info.pos.width += 2*style->xthickness;
+ info.pos.y -= style->ythickness;
+ info.pos.height += style->ythickness;
+ }
+ if (y + height == widget->allocation.height - style->ythickness) {
+ info.pos.x -= style->xthickness;
+ info.pos.width += 2*style->xthickness;
+ info.pos.height += style->ythickness;
+ }
+ }
+
sugar_draw_menu (cr, &info, NULL);
} else if (DETAIL ("palette-invoker") || DETAIL ("toolbutton-prelight")) {
SugarInfo info;
diff --git a/gtk/theme/gtkrc.em b/gtk/theme/gtkrc.em
index 68c9d2f..cf5781a 100644
--- a/gtk/theme/gtkrc.em
+++ b/gtk/theme/gtkrc.em
@@ -211,10 +211,11 @@ style "menu"
{
bg[NORMAL] = $black
# Used for the arrow colour
- fg[NORMAL] = $button_grey
+ fg[NORMAL] = $white
+ fg[PRELIGHT] = $white
bg[ACTIVE] = $button_grey
- # This is just the exact reverse of what is going on inside GTK+ ...
+ ${# This is just the exact reverse of what is going on inside GTK+ ...}
GtkMenu::scroll-arrow-vlength = $(my_floor(subcell_size/0.7 + 2*thickness))
GtkMenu::horizontal-padding = 0
GtkMenu::vertical-padding = 0