mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-20 12:40:18 +00:00
Adjusted GTK3 menu item icon-name fallbacks for quick items and stock icon menus in the menu helpers.
Updated channel list icon menu items to convert stock icon IDs to GTK3 icon names with a fallback path. Added a GTK3 icon-name fallback for spell entry menu items when building the icon/label box layout.
This commit is contained in:
@@ -133,10 +133,14 @@ chanlist_icon_menu_item (const char *label, const char *icon_name,
|
|||||||
GtkWidget *box;
|
GtkWidget *box;
|
||||||
GtkWidget *image = NULL;
|
GtkWidget *image = NULL;
|
||||||
GtkWidget *label_widget;
|
GtkWidget *label_widget;
|
||||||
|
const char *icon_name_gtk3;
|
||||||
|
|
||||||
item = gtk_menu_item_new ();
|
item = gtk_menu_item_new ();
|
||||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
|
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
|
||||||
image = icon_name ? gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU) : NULL;
|
icon_name_gtk3 = gtkutil_icon_name_from_stock (icon_name);
|
||||||
|
if (!icon_name_gtk3)
|
||||||
|
icon_name_gtk3 = icon_name;
|
||||||
|
image = icon_name_gtk3 ? gtk_image_new_from_icon_name (icon_name_gtk3, GTK_ICON_SIZE_MENU) : NULL;
|
||||||
label_widget = gtk_label_new_with_mnemonic (label);
|
label_widget = gtk_label_new_with_mnemonic (label);
|
||||||
if (image)
|
if (image)
|
||||||
gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 0);
|
||||||
|
|||||||
@@ -296,6 +296,8 @@ menu_quick_item (char *cmd, char *label, GtkWidget * menu, int flags,
|
|||||||
{
|
{
|
||||||
#if HAVE_GTK3
|
#if HAVE_GTK3
|
||||||
icon_name = gtkutil_icon_name_from_stock (icon);
|
icon_name = gtkutil_icon_name_from_stock (icon);
|
||||||
|
if (!icon_name)
|
||||||
|
icon_name = icon;
|
||||||
#endif
|
#endif
|
||||||
#if !HAVE_GTK3
|
#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);
|
||||||
@@ -2018,6 +2020,8 @@ create_icon_menu (char *labeltext, void *stock_name, int is_stock)
|
|||||||
{
|
{
|
||||||
#if HAVE_GTK3
|
#if HAVE_GTK3
|
||||||
icon_name = gtkutil_icon_name_from_stock (stock_name);
|
icon_name = gtkutil_icon_name_from_stock (stock_name);
|
||||||
|
if (!icon_name)
|
||||||
|
icon_name = stock_name;
|
||||||
if (icon_name)
|
if (icon_name)
|
||||||
image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
|
image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -640,6 +640,8 @@ sexy_spell_entry_icon_menu_item (const char *label, const char *stock_name)
|
|||||||
GtkWidget *label_widget;
|
GtkWidget *label_widget;
|
||||||
|
|
||||||
icon_name = gtkutil_icon_name_from_stock (stock_name);
|
icon_name = gtkutil_icon_name_from_stock (stock_name);
|
||||||
|
if (!icon_name)
|
||||||
|
icon_name = stock_name;
|
||||||
item = gtk_menu_item_new ();
|
item = gtk_menu_item_new ();
|
||||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
|
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
|
||||||
if (icon_name)
|
if (icon_name)
|
||||||
|
|||||||
Reference in New Issue
Block a user