Commit caa47b2e authored by Matthias Clasen's avatar Matthias Clasen

GtkMenuItem: fix display of accelerators

The accel label in menus was getting a small allocation that
caused its draw code to always omit the accelerator string.
Fix that by setting halign to fill. To keep the menu label
left-aligned, set xalign to 0 to compensate.
parent d6d424f9
......@@ -2510,8 +2510,8 @@ gtk_menu_item_ensure_label (GtkMenuItem *menu_item)
if (!gtk_bin_get_child (GTK_BIN (menu_item)))
{
accel_label = g_object_new (GTK_TYPE_ACCEL_LABEL, NULL);
gtk_widget_set_halign (accel_label, GTK_ALIGN_START);
accel_label = g_object_new (GTK_TYPE_ACCEL_LABEL, "xalign", 0.0, NULL);
gtk_widget_set_halign (accel_label, GTK_ALIGN_FILL);
gtk_widget_set_valign (accel_label, GTK_ALIGN_CENTER);
gtk_container_add (GTK_CONTAINER (menu_item), accel_label);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment