mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 22:41:43 +00:00
menuitem: really ignore horizontal-padding
This style property has been documented as been ignored for a long time, but we were still reading it in some cases.
This commit is contained in:
parent
f792d20507
commit
35ed13ac54
@ -645,12 +645,11 @@ gtk_image_menu_item_size_allocate (GtkWidget *widget,
|
||||
GtkBorder padding;
|
||||
GtkRequisition child_requisition;
|
||||
GtkAllocation child_allocation;
|
||||
guint horizontal_padding, toggle_spacing;
|
||||
guint toggle_spacing;
|
||||
gint toggle_size;
|
||||
|
||||
toggle_size = GTK_MENU_ITEM (image_menu_item)->priv->toggle_size;
|
||||
gtk_widget_style_get (widget,
|
||||
"horizontal-padding", &horizontal_padding,
|
||||
"toggle-spacing", &toggle_spacing,
|
||||
NULL);
|
||||
|
||||
@ -672,10 +671,10 @@ gtk_image_menu_item_size_allocate (GtkWidget *widget,
|
||||
{
|
||||
if ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR) ==
|
||||
(pack_dir == GTK_PACK_DIRECTION_LTR))
|
||||
x = offset + horizontal_padding + padding.left +
|
||||
x = offset + padding.left +
|
||||
(toggle_size - toggle_spacing - child_requisition.width) / 2;
|
||||
else
|
||||
x = widget_allocation.width - offset - horizontal_padding - padding.right -
|
||||
x = widget_allocation.width - offset - padding.right -
|
||||
toggle_size + toggle_spacing +
|
||||
(toggle_size - toggle_spacing - child_requisition.width) / 2;
|
||||
|
||||
@ -685,10 +684,10 @@ gtk_image_menu_item_size_allocate (GtkWidget *widget,
|
||||
{
|
||||
if ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR) ==
|
||||
(pack_dir == GTK_PACK_DIRECTION_TTB))
|
||||
y = offset + horizontal_padding + padding.top +
|
||||
y = offset + padding.top +
|
||||
(toggle_size - toggle_spacing - child_requisition.height) / 2;
|
||||
else
|
||||
y = widget_allocation.height - offset - horizontal_padding - padding.bottom -
|
||||
y = widget_allocation.height - offset - padding.bottom -
|
||||
toggle_size + toggle_spacing +
|
||||
(toggle_size - toggle_spacing - child_requisition.height) / 2;
|
||||
|
||||
|
@ -649,7 +649,6 @@ gtk_real_check_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
|
||||
guint offset;
|
||||
guint toggle_size;
|
||||
guint toggle_spacing;
|
||||
guint horizontal_padding;
|
||||
guint indicator_size;
|
||||
GtkStateFlags state;
|
||||
GtkBorder padding;
|
||||
@ -662,7 +661,6 @@ gtk_real_check_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
|
||||
|
||||
gtk_widget_style_get (widget,
|
||||
"toggle-spacing", &toggle_spacing,
|
||||
"horizontal-padding", &horizontal_padding,
|
||||
"indicator-size", &indicator_size,
|
||||
NULL);
|
||||
|
||||
@ -672,13 +670,13 @@ gtk_real_check_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
|
||||
|
||||
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
|
||||
{
|
||||
x = offset + horizontal_padding +
|
||||
x = offset +
|
||||
(toggle_size - toggle_spacing - indicator_size) / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
x = allocation.width -
|
||||
offset - horizontal_padding - toggle_size + toggle_spacing +
|
||||
offset - toggle_size + toggle_spacing +
|
||||
(toggle_size - toggle_spacing - indicator_size) / 2;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user