Made GTK2-only chanlist menu popup and button icon paths explicit with #if !HAVE_GTK3, keeping GTK3 named-icon usage separate from stock icons.

Applied the same GTK2-guarded stock icon usage in plugingui and menu handling, including menu popups and icon helpers, to isolate GTK2-only calls.
This commit is contained in:
2026-01-23 07:47:16 -07:00
parent fae83a34bc
commit 8ba068041d
3 changed files with 24 additions and 12 deletions

View File

@@ -676,7 +676,8 @@ chanlist_button_cb (GtkTreeView *tree, GdkEventButton *event, server *serv)
G_CALLBACK (chanlist_copytopic), serv);
gtk_widget_show (item);
}
#else
#endif
#if !HAVE_GTK3
mg_create_icon_item (_("_Join Channel"), GTK_STOCK_JUMP_TO, menu,
chanlist_join, serv);
mg_create_icon_item (_("_Copy Channel Name"), GTK_STOCK_COPY, menu,
@@ -691,7 +692,8 @@ chanlist_button_cb (GtkTreeView *tree, GdkEventButton *event, server *serv)
#if HAVE_GTK3
gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *)event);
#else
#endif
#if !HAVE_GTK3
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 0, event->time);
#endif
@@ -865,7 +867,8 @@ chanlist_opengui (server *serv, int do_refresh)
g_signal_connect (G_OBJECT (wid), "clicked",
G_CALLBACK (chanlist_search_pressed), serv);
gtk_widget_show (wid);
#else
#endif
#if !HAVE_GTK3
wid = gtkutil_button (NULL, GTK_STOCK_FIND, 0, chanlist_search_pressed, serv,
_("_Search"));
#endif
@@ -885,7 +888,8 @@ chanlist_opengui (server *serv, int do_refresh)
g_signal_connect (G_OBJECT (wid), "clicked",
G_CALLBACK (chanlist_refresh), serv);
gtk_widget_show (wid);
#else
#endif
#if !HAVE_GTK3
wid = gtkutil_button (NULL, GTK_STOCK_REFRESH, 0, chanlist_refresh, serv,
_("_Download List"));
#endif
@@ -905,7 +909,8 @@ chanlist_opengui (server *serv, int do_refresh)
g_signal_connect (G_OBJECT (wid), "clicked",
G_CALLBACK (chanlist_save), serv);
gtk_widget_show (wid);
#else
#endif
#if !HAVE_GTK3
wid = gtkutil_button (NULL, GTK_STOCK_SAVE_AS, 0, chanlist_save, serv,
_("Save _List..."));
#endif
@@ -925,7 +930,8 @@ chanlist_opengui (server *serv, int do_refresh)
g_signal_connect (G_OBJECT (wid), "clicked",
G_CALLBACK (chanlist_join), serv);
gtk_widget_show (wid);
#else
#endif
#if !HAVE_GTK3
wid = gtkutil_button (NULL, GTK_STOCK_JUMP_TO, 0, chanlist_join, serv,
_("_Join Channel"));
#endif

View File

@@ -291,7 +291,8 @@ menu_quick_item (char *cmd, char *label, GtkWidget * menu, int flags,
{
#if HAVE_GTK3
img = gtk_image_new_from_icon_name (icon, GTK_ICON_SIZE_MENU);
#else
#endif
#if !HAVE_GTK3
img = gtk_image_new_from_stock (icon, GTK_ICON_SIZE_MENU);
#endif
}
@@ -581,7 +582,8 @@ menu_popup (GtkWidget *menu, GdkEventButton *event, gpointer objtounref)
G_CALLBACK (menu_destroy), objtounref);
#if HAVE_GTK3
gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *)event);
#else
#endif
#if !HAVE_GTK3
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL,
0, event ? event->time : 0);
#endif
@@ -1439,7 +1441,8 @@ menu_join (GtkWidget * wid, gpointer none)
gtk_button_set_image (GTK_BUTTON (button),
gtk_image_new_from_icon_name ("dialog-ok", GTK_ICON_SIZE_BUTTON));
}
#else
#endif
#if !HAVE_GTK3
dialog = gtk_dialog_new_with_buttons (_("Join Channel"),
GTK_WINDOW (parent_window), 0,
_("Retrieve channel list"), GTK_RESPONSE_HELP,
@@ -1820,7 +1823,8 @@ menu_about (GtkWidget *wid, gpointer sess)
#define ICON_FIND "edit-find"
#define ICON_HELP "help-browser"
#define ICON_ABOUT "help-about"
#else
#endif
#if !HAVE_GTK3
#define ICON_NEW GTK_STOCK_NEW
#define ICON_LOAD_PLUGIN GTK_STOCK_REVERT_TO_SAVED
#define ICON_DETACH GTK_STOCK_REDO
@@ -1967,7 +1971,8 @@ create_icon_menu (char *labeltext, void *stock_name, int is_stock)
{
#if HAVE_GTK3
img = gtk_image_new_from_icon_name (stock_name, GTK_ICON_SIZE_MENU);
#else
#endif
#if !HAVE_GTK3
img = gtk_image_new_from_stock (stock_name, GTK_ICON_SIZE_MENU);
#endif
}

View File

@@ -283,7 +283,8 @@ plugingui_open (void)
G_CALLBACK (plugingui_reloadbutton_cb), view);
gtk_widget_show (button);
}
#else
#endif
#if !HAVE_GTK3
gtkutil_button (hbox, GTK_STOCK_REVERT_TO_SAVED, NULL,
plugingui_loadbutton_cb, NULL, _("_Load..."));