summaryrefslogtreecommitdiff
path: root/gtk/gtkradiomenuitem.c
diff options
context:
space:
mode:
authorSoeren Sandmann <sandmann@daimi.au.dk>2003-07-06 13:14:28 +0000
committerSøren Sandmann Pedersen <ssp@src.gnome.org>2003-07-06 13:14:28 +0000
commitc8515b2f8d22c9856fc58f71398eea9e13695fb1 (patch)
tree717fed71a7377b7729c73a610f1eb16463bd130d /gtk/gtkradiomenuitem.c
parentba999da1d8528afdb7cf810e626bd1ab3946ff17 (diff)
downloadgtk+-c8515b2f8d22c9856fc58f71398eea9e13695fb1.tar.gz
add vertical_padding style property.
Sat Jul 5 10:34:00 2003 Soeren Sandmann <sandmann@daimi.au.dk> * gtk/gtkmenu.c: add vertical_padding style property. * gtk/gtkmenuitem.c: add style properties toggle_spacing, arrow_spacing and horizontal_padding. Also center separators and make them a bit taller. * gtk/*menuitem.c: use new style properties. * docs/widget_geometry.txt: Add note about GtkMenuItem * gtk/gtkstyle.c (gtk_default_draw_vline, gtk_default_draw_hline): fix +/-1 errors. (gtk_default_draw_shadow): draw a black border around menus. * gtk/gtkvseparator, gtk/gtkhseparator.c, gtk/gtkmenuitem.c: fix calls to gtk_paint_hline() and gtk_paint_vline() (they take x1, x2 and y1, y2 respectively, not x, width and y, height).
Diffstat (limited to 'gtk/gtkradiomenuitem.c')
-rw-r--r--gtk/gtkradiomenuitem.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/gtk/gtkradiomenuitem.c b/gtk/gtkradiomenuitem.c
index 87ac5052e4..4d7ba5f7fa 100644
--- a/gtk/gtkradiomenuitem.c
+++ b/gtk/gtkradiomenuitem.c
@@ -312,16 +312,35 @@ gtk_radio_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
if (GTK_WIDGET_DRAWABLE (check_menu_item))
{
+ guint horizontal_padding;
+ guint toggle_spacing;
+ guint toggle_size;
+
widget = GTK_WIDGET (check_menu_item);
+ gtk_widget_style_get (GTK_WIDGET (check_menu_item),
+ "toggle_spacing", &toggle_spacing,
+ "horizontal_padding", &horizontal_padding,
+ NULL);
+
width = 8;
height = 8;
+ toggle_size = GTK_MENU_ITEM (check_menu_item)->toggle_size;
offset = GTK_CONTAINER (check_menu_item)->border_width +
widget->style->xthickness + 2;
+
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
- x = widget->allocation.x + offset;
+ {
+ x = widget->allocation.x + offset + horizontal_padding +
+ (toggle_size - toggle_spacing - width) / 2;
+ }
else
- x = widget->allocation.x + widget->allocation.width - width - offset;
+ {
+ x = widget->allocation.x + widget->allocation.width -
+ offset - horizontal_padding - toggle_size + toggle_spacing +
+ (toggle_size - toggle_spacing - width) / 2;
+ }
+
y = widget->allocation.y + (widget->allocation.height - height) / 2;
if (check_menu_item->active ||