Guarded GTK3 chanlist menu item image creation on a non-null icon name before packing into the menu item box.

Updated GTK3 create_icon_menu to build menu items with explicit image/label composition using icon names or pixbufs before packing into the box.
Adjusted GTK3 spell entry icon menu item to create the image only when an icon name is available.
This commit is contained in:
deepend committed 2026-01-23 17:35:01 -07:00
1 parent 3923bd915c
commit c2e8507402
3 files changed
+18 -7

No files matched your search

+2 -1
View File
@@ -642,7 +642,8 @@ sexy_spell_entry_icon_menu_item (const char *label, const char *stock_name)
icon_name = gtkutil_icon_name_from_stock (stock_name);
item = gtk_menu_item_new ();
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
image = icon_name ? gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU) : NULL;
if (icon_name)
image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
label_widget = gtk_label_new_with_mnemonic (label);
if (image)
gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 0);