mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-19 12:10:19 +00:00
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:
@@ -676,7 +676,8 @@ chanlist_button_cb (GtkTreeView *tree, GdkEventButton *event, server *serv)
|
|||||||
G_CALLBACK (chanlist_copytopic), serv);
|
G_CALLBACK (chanlist_copytopic), serv);
|
||||||
gtk_widget_show (item);
|
gtk_widget_show (item);
|
||||||
}
|
}
|
||||||
#else
|
#endif
|
||||||
|
#if !HAVE_GTK3
|
||||||
mg_create_icon_item (_("_Join Channel"), GTK_STOCK_JUMP_TO, menu,
|
mg_create_icon_item (_("_Join Channel"), GTK_STOCK_JUMP_TO, menu,
|
||||||
chanlist_join, serv);
|
chanlist_join, serv);
|
||||||
mg_create_icon_item (_("_Copy Channel Name"), GTK_STOCK_COPY, menu,
|
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
|
#if HAVE_GTK3
|
||||||
gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *)event);
|
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);
|
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 0, event->time);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -865,7 +867,8 @@ chanlist_opengui (server *serv, int do_refresh)
|
|||||||
g_signal_connect (G_OBJECT (wid), "clicked",
|
g_signal_connect (G_OBJECT (wid), "clicked",
|
||||||
G_CALLBACK (chanlist_search_pressed), serv);
|
G_CALLBACK (chanlist_search_pressed), serv);
|
||||||
gtk_widget_show (wid);
|
gtk_widget_show (wid);
|
||||||
#else
|
#endif
|
||||||
|
#if !HAVE_GTK3
|
||||||
wid = gtkutil_button (NULL, GTK_STOCK_FIND, 0, chanlist_search_pressed, serv,
|
wid = gtkutil_button (NULL, GTK_STOCK_FIND, 0, chanlist_search_pressed, serv,
|
||||||
_("_Search"));
|
_("_Search"));
|
||||||
#endif
|
#endif
|
||||||
@@ -885,7 +888,8 @@ chanlist_opengui (server *serv, int do_refresh)
|
|||||||
g_signal_connect (G_OBJECT (wid), "clicked",
|
g_signal_connect (G_OBJECT (wid), "clicked",
|
||||||
G_CALLBACK (chanlist_refresh), serv);
|
G_CALLBACK (chanlist_refresh), serv);
|
||||||
gtk_widget_show (wid);
|
gtk_widget_show (wid);
|
||||||
#else
|
#endif
|
||||||
|
#if !HAVE_GTK3
|
||||||
wid = gtkutil_button (NULL, GTK_STOCK_REFRESH, 0, chanlist_refresh, serv,
|
wid = gtkutil_button (NULL, GTK_STOCK_REFRESH, 0, chanlist_refresh, serv,
|
||||||
_("_Download List"));
|
_("_Download List"));
|
||||||
#endif
|
#endif
|
||||||
@@ -905,7 +909,8 @@ chanlist_opengui (server *serv, int do_refresh)
|
|||||||
g_signal_connect (G_OBJECT (wid), "clicked",
|
g_signal_connect (G_OBJECT (wid), "clicked",
|
||||||
G_CALLBACK (chanlist_save), serv);
|
G_CALLBACK (chanlist_save), serv);
|
||||||
gtk_widget_show (wid);
|
gtk_widget_show (wid);
|
||||||
#else
|
#endif
|
||||||
|
#if !HAVE_GTK3
|
||||||
wid = gtkutil_button (NULL, GTK_STOCK_SAVE_AS, 0, chanlist_save, serv,
|
wid = gtkutil_button (NULL, GTK_STOCK_SAVE_AS, 0, chanlist_save, serv,
|
||||||
_("Save _List..."));
|
_("Save _List..."));
|
||||||
#endif
|
#endif
|
||||||
@@ -925,7 +930,8 @@ chanlist_opengui (server *serv, int do_refresh)
|
|||||||
g_signal_connect (G_OBJECT (wid), "clicked",
|
g_signal_connect (G_OBJECT (wid), "clicked",
|
||||||
G_CALLBACK (chanlist_join), serv);
|
G_CALLBACK (chanlist_join), serv);
|
||||||
gtk_widget_show (wid);
|
gtk_widget_show (wid);
|
||||||
#else
|
#endif
|
||||||
|
#if !HAVE_GTK3
|
||||||
wid = gtkutil_button (NULL, GTK_STOCK_JUMP_TO, 0, chanlist_join, serv,
|
wid = gtkutil_button (NULL, GTK_STOCK_JUMP_TO, 0, chanlist_join, serv,
|
||||||
_("_Join Channel"));
|
_("_Join Channel"));
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -291,7 +291,8 @@ menu_quick_item (char *cmd, char *label, GtkWidget * menu, int flags,
|
|||||||
{
|
{
|
||||||
#if HAVE_GTK3
|
#if HAVE_GTK3
|
||||||
img = gtk_image_new_from_icon_name (icon, GTK_ICON_SIZE_MENU);
|
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);
|
img = gtk_image_new_from_stock (icon, GTK_ICON_SIZE_MENU);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -581,7 +582,8 @@ menu_popup (GtkWidget *menu, GdkEventButton *event, gpointer objtounref)
|
|||||||
G_CALLBACK (menu_destroy), objtounref);
|
G_CALLBACK (menu_destroy), objtounref);
|
||||||
#if HAVE_GTK3
|
#if HAVE_GTK3
|
||||||
gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *)event);
|
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,
|
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL,
|
||||||
0, event ? event->time : 0);
|
0, event ? event->time : 0);
|
||||||
#endif
|
#endif
|
||||||
@@ -1439,7 +1441,8 @@ menu_join (GtkWidget * wid, gpointer none)
|
|||||||
gtk_button_set_image (GTK_BUTTON (button),
|
gtk_button_set_image (GTK_BUTTON (button),
|
||||||
gtk_image_new_from_icon_name ("dialog-ok", GTK_ICON_SIZE_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"),
|
dialog = gtk_dialog_new_with_buttons (_("Join Channel"),
|
||||||
GTK_WINDOW (parent_window), 0,
|
GTK_WINDOW (parent_window), 0,
|
||||||
_("Retrieve channel list"), GTK_RESPONSE_HELP,
|
_("Retrieve channel list"), GTK_RESPONSE_HELP,
|
||||||
@@ -1820,7 +1823,8 @@ menu_about (GtkWidget *wid, gpointer sess)
|
|||||||
#define ICON_FIND "edit-find"
|
#define ICON_FIND "edit-find"
|
||||||
#define ICON_HELP "help-browser"
|
#define ICON_HELP "help-browser"
|
||||||
#define ICON_ABOUT "help-about"
|
#define ICON_ABOUT "help-about"
|
||||||
#else
|
#endif
|
||||||
|
#if !HAVE_GTK3
|
||||||
#define ICON_NEW GTK_STOCK_NEW
|
#define ICON_NEW GTK_STOCK_NEW
|
||||||
#define ICON_LOAD_PLUGIN GTK_STOCK_REVERT_TO_SAVED
|
#define ICON_LOAD_PLUGIN GTK_STOCK_REVERT_TO_SAVED
|
||||||
#define ICON_DETACH GTK_STOCK_REDO
|
#define ICON_DETACH GTK_STOCK_REDO
|
||||||
@@ -1967,7 +1971,8 @@ create_icon_menu (char *labeltext, void *stock_name, int is_stock)
|
|||||||
{
|
{
|
||||||
#if HAVE_GTK3
|
#if HAVE_GTK3
|
||||||
img = gtk_image_new_from_icon_name (stock_name, GTK_ICON_SIZE_MENU);
|
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);
|
img = gtk_image_new_from_stock (stock_name, GTK_ICON_SIZE_MENU);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -283,7 +283,8 @@ plugingui_open (void)
|
|||||||
G_CALLBACK (plugingui_reloadbutton_cb), view);
|
G_CALLBACK (plugingui_reloadbutton_cb), view);
|
||||||
gtk_widget_show (button);
|
gtk_widget_show (button);
|
||||||
}
|
}
|
||||||
#else
|
#endif
|
||||||
|
#if !HAVE_GTK3
|
||||||
gtkutil_button (hbox, GTK_STOCK_REVERT_TO_SAVED, NULL,
|
gtkutil_button (hbox, GTK_STOCK_REVERT_TO_SAVED, NULL,
|
||||||
plugingui_loadbutton_cb, NULL, _("_Load..."));
|
plugingui_loadbutton_cb, NULL, _("_Load..."));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user