From fd83f3636dc9546a90b8e8fe36e80c5cec170e09 Mon Sep 17 00:00:00 2001 From: deepend Date: Fri, 23 Jan 2026 18:01:07 -0700 Subject: [PATCH] Consolidated the GTK3/GTK2 branching for icon menu items in menu_quick_item and create_icon_menu to use the GtkMenuItem + GtkBox path under GTK3 and GtkImageMenuItem under GTK2. Unified the GTK3/GTK2 icon menu item construction branches in the channel list menu helper to match the GtkBox + GtkImage + GtkLabel pattern for GTK3 while preserving GTK2 behavior. Aligned the spelling menu icon item helper with the same GTK3/GTK2 branching structure, keeping GTK2 GtkImageMenuItem intact. --- src/fe-gtk/chanlist.c | 3 +-- src/fe-gtk/menu.c | 6 ++---- src/fe-gtk/sexy-spell-entry.c | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/fe-gtk/chanlist.c b/src/fe-gtk/chanlist.c index 217f5970..def01330 100644 --- a/src/fe-gtk/chanlist.c +++ b/src/fe-gtk/chanlist.c @@ -142,8 +142,7 @@ chanlist_icon_menu_item (const char *label, const char *icon_name, gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box), label_widget, FALSE, FALSE, 0); gtk_container_add (GTK_CONTAINER (item), box); -#endif -#if !HAVE_GTK3 +#else GtkWidget *image; item = gtk_image_menu_item_new_with_mnemonic (label); diff --git a/src/fe-gtk/menu.c b/src/fe-gtk/menu.c index 3bc6d20b..8addfc7d 100644 --- a/src/fe-gtk/menu.c +++ b/src/fe-gtk/menu.c @@ -316,8 +316,7 @@ menu_quick_item (char *cmd, char *label, GtkWidget * menu, int flags, gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box), label_widget, FALSE, FALSE, 0); gtk_container_add (GTK_CONTAINER (item), box); -#endif -#if !HAVE_GTK3 +#else item = gtk_image_menu_item_new_with_mnemonic (label); if (img) gtk_image_menu_item_set_image ((GtkImageMenuItem *)item, img); @@ -2043,8 +2042,7 @@ create_icon_menu (char *labeltext, void *stock_name, int is_stock) gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box), label_widget, FALSE, FALSE, 0); gtk_container_add (GTK_CONTAINER (item), box); -#endif -#if !HAVE_GTK3 +#else item = gtk_image_menu_item_new_with_mnemonic (labeltext); gtk_image_menu_item_set_image ((GtkImageMenuItem *)item, img); gtk_widget_show (img); diff --git a/src/fe-gtk/sexy-spell-entry.c b/src/fe-gtk/sexy-spell-entry.c index 3a74ff35..9346c2a9 100644 --- a/src/fe-gtk/sexy-spell-entry.c +++ b/src/fe-gtk/sexy-spell-entry.c @@ -649,8 +649,7 @@ sexy_spell_entry_icon_menu_item (const char *label, const char *stock_name) gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box), label_widget, FALSE, FALSE, 0); gtk_container_add (GTK_CONTAINER (item), box); -#endif -#if !HAVE_GTK3 +#else GtkWidget *image; item = gtk_image_menu_item_new_with_label (label);