diff options
author | Victor Kareh <[email protected]> | 2025-07-18 15:07:38 -0400 |
---|---|---|
committer | Victor Kareh <[email protected]> | 2025-07-23 10:48:09 -0400 |
commit | 09e600072d95964596ca27316a5f182c8139b706 (patch) | |
tree | ac81d7fdc19da12f2d4a28897ea303d69e9bf271 | |
parent | 1e392a614d5f447531a6883ed9dc19b4c30b8eb6 (diff) | |
download | mate-panel-09e600072d95964596ca27316a5f182c8139b706.tar.bz2 mate-panel-09e600072d95964596ca27316a5f182c8139b706.tar.xz |
panel-stock-icons: Remove deprecated GtkIconFactory and GtkIconSource
All applet menus already use theme icon names directly, making this
legacy stock icon code obsolete. Removing it eliminates all the icon
factory deprecation warnings.
-rw-r--r-- | mate-panel/panel-stock-icons.c | 69 | ||||
-rw-r--r-- | mate-panel/panel-stock-icons.h | 12 |
2 files changed, 0 insertions, 81 deletions
diff --git a/mate-panel/panel-stock-icons.c b/mate-panel/panel-stock-icons.c index 87fa80be..bab01a33 100644 --- a/mate-panel/panel-stock-icons.c +++ b/mate-panel/panel-stock-icons.c @@ -54,73 +54,10 @@ GtkIconSize panel_add_to_icon_get_size(void) return panel_add_to_icon_size; } -typedef struct { - char *stock_id; - char *icon; -} PanelStockIcon; - -static PanelStockIcon stock_icons [] = { - { PANEL_STOCK_FORCE_QUIT, PANEL_ICON_FORCE_QUIT } -}; - -static void -panel_init_stock_icons (GtkIconFactory *factory) -{ - GtkIconSource *source; - gsize i; - - source = gtk_icon_source_new (); - - for (i = 0; i < G_N_ELEMENTS (stock_icons); i++) { - GtkIconSet *set; - - gtk_icon_source_set_icon_name (source, stock_icons [i].icon); - - set = gtk_icon_set_new (); - gtk_icon_set_add_source (set, source); - - gtk_icon_factory_add (factory, stock_icons [i].stock_id, set); - gtk_icon_set_unref (set); - } - - gtk_icon_source_free (source); - -} - -typedef struct { - char *stock_id; - char *stock_icon_id; - char *label; -} PanelStockItem; - -static PanelStockItem stock_items [] = { - { PANEL_STOCK_EXECUTE, "gtk-execute", N_("_Run") }, - { PANEL_STOCK_FORCE_QUIT, PANEL_STOCK_FORCE_QUIT, N_("_Force quit") }, - { PANEL_STOCK_CLEAR, "gtk-clear", N_("C_lear") }, - { PANEL_STOCK_DONT_DELETE, "gtk-cancel", N_("D_on't Delete") } -}; - -static void -panel_init_stock_items (GtkIconFactory *factory) -{ - gsize n_items; - gsize i; - - n_items = G_N_ELEMENTS (stock_items); - - for (i = 0; i < n_items; i++) { - GtkIconSet *icon_set; - - /* FIXME: does this take into account the theme? */ - icon_set = gtk_icon_factory_lookup_default (stock_items [i].stock_icon_id); - gtk_icon_factory_add (factory, stock_items [i].stock_id, icon_set); - } -} void panel_init_stock_icons_and_items (void) { - GtkIconFactory *factory; GSettings *settings; gint icon_size; @@ -153,12 +90,6 @@ panel_init_stock_icons_and_items (void) PANEL_ADD_TO_DEFAULT_ICON_SIZE, PANEL_ADD_TO_DEFAULT_ICON_SIZE); - factory = gtk_icon_factory_new (); - gtk_icon_factory_add_default (factory); - - panel_init_stock_icons (factory); - panel_init_stock_items (factory); - g_object_unref (factory); g_object_unref (settings); } diff --git a/mate-panel/panel-stock-icons.h b/mate-panel/panel-stock-icons.h index a43ca699..eeb536e8 100644 --- a/mate-panel/panel-stock-icons.h +++ b/mate-panel/panel-stock-icons.h @@ -41,18 +41,6 @@ extern "C" { #define PANEL_ADD_TO_DEFAULT_ICON_SIZE 32 -/* stock icons */ -#define PANEL_STOCK_FORCE_QUIT "mate-panel-force-quit" - -/* stock items - no point in theme the icons one these, - * they use stock gtk icons and just modify the text - * for the stock item. - */ -#define PANEL_STOCK_EXECUTE "panel-execute" -#define PANEL_STOCK_CLEAR "panel-clear" -#define PANEL_STOCK_DONT_DELETE "panel-dont-delete" -/* FIXME: put a more representative icon here */ -#define PANEL_STOCK_DEFAULT_ICON "application-default-icon" void panel_init_stock_icons_and_items (void); GtkIconSize panel_menu_icon_get_size (void); |