summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2017-10-11 09:03:40 +0200
committerTimm Bäder <mail@baedert.org>2017-10-11 09:03:40 +0200
commitc8add3d169be9ac51d52e5b10511f6c6fa059b10 (patch)
tree05eb82700c422f2524b1c21722923931830c7bee
parentb3fedda29ee4896d4a86c917ca4db5b664d57d79 (diff)
downloadgtk+-c8add3d169be9ac51d52e5b10511f6c6fa059b10.tar.gz
modelmenuitem: Fix icon/label alignment
gtk_box_pack_end will put the label child at the right side of the label (in LTR orientation), but we want it left, directly next to the icon. Also remove the spacing from the box child as this is a theme thing.
-rw-r--r--gtk/gtkmodelmenuitem.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gtk/gtkmodelmenuitem.c b/gtk/gtkmodelmenuitem.c
index 9afca4386f..0f05e83bc3 100644
--- a/gtk/gtkmodelmenuitem.c
+++ b/gtk/gtkmodelmenuitem.c
@@ -165,12 +165,12 @@ gtk_model_menu_item_set_icon (GtkModelMenuItem *item,
if (icon == NULL)
return;
- box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+ box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
/* Reparent the child without destroying it */
g_object_ref (child);
gtk_container_remove (GTK_CONTAINER (item), child);
- gtk_box_pack_end (GTK_BOX (box), child);
+ gtk_container_add (GTK_CONTAINER (box), child);
g_object_unref (child);
gtk_container_add (GTK_CONTAINER (item), box);
@@ -190,7 +190,8 @@ gtk_model_menu_item_set_icon (GtkModelMenuItem *item,
image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU);
gtk_image_set_pixel_size (GTK_IMAGE (image), 16);
- gtk_box_pack_start (GTK_BOX (child), image);
+ gtk_container_add (GTK_CONTAINER (child), image);
+ gtk_box_reorder_child (GTK_BOX (child), image, 0);
}
g_object_notify (G_OBJECT (item), "icon");