Added GTK3 icon-name menu item helper and used it when building icon-based menu items in the main menu paths, while keeping the GtkImageMenuItem fallback for GTK2 intact.

Guarded GTK3 chanlist icon menu item creation to handle missing icon names safely while still creating the boxed menu layout.
Applied the same GTK3 icon-name guard for the sexy-spell-entry menu items while preserving GTK2 code paths.
This commit is contained in:
2026-01-23 14:46:19 -07:00
parent 65ca665e25
commit b0a9f34dc4
3 changed files with 26 additions and 9 deletions

View File

@@ -130,12 +130,13 @@ chanlist_menu_item_new_with_icon (const char *label, const char *icon_name)
{
GtkWidget *item;
GtkWidget *box;
GtkWidget *image;
GtkWidget *image = NULL;
GtkWidget *label_widget;
item = gtk_menu_item_new ();
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
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);