Added a GTK3 helper to build menu items with image + mnemonic label and reused it for icon menu item creation in the main menu helpers.

Added GTK3 helper builders for icon menu items in the channel list and spell entry menus, reusing them in the GTK3 branches while keeping GTK2 paths intact.
This commit is contained in:
2026-01-23 14:33:11 -07:00
parent 72b9560c32
commit 65ca665e25
3 changed files with 52 additions and 27 deletions

View File

@@ -124,12 +124,11 @@ chanlist_icon_button (const char *label, const char *icon_name,
return button;
}
#if HAVE_GTK3
static GtkWidget *
chanlist_icon_menu_item (const char *label, const char *icon_name,
GCallback callback, gpointer userdata)
chanlist_menu_item_new_with_icon (const char *label, const char *icon_name)
{
GtkWidget *item;
#if HAVE_GTK3
GtkWidget *box;
GtkWidget *image;
GtkWidget *label_widget;
@@ -142,6 +141,18 @@ 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);
return item;
}
#endif
static GtkWidget *
chanlist_icon_menu_item (const char *label, const char *icon_name,
GCallback callback, gpointer userdata)
{
GtkWidget *item;
#if HAVE_GTK3
item = chanlist_menu_item_new_with_icon (label, icon_name);
#endif
#if !HAVE_GTK3
GtkWidget *image;