diff options
author | raveit65 <[email protected]> | 2023-10-14 22:12:32 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2023-10-16 12:40:54 +0200 |
commit | 7886eb1ad39eea7a0ea75e82dd112ec423f0b608 (patch) | |
tree | 94f9c9831b0ecac6fcfb7518b600fb18e5154984 /src | |
parent | b9c9edd945f73ccb92953788a991980c7256eb95 (diff) | |
download | mate-power-manager-7886eb1ad39eea7a0ea75e82dd112ec423f0b608.tar.bz2 mate-power-manager-7886eb1ad39eea7a0ea75e82dd112ec423f0b608.tar.xz |
replace deprecated gtk_image_menu_item
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 3 | ||||
-rw-r--r-- | src/gpm-tray-icon.c | 13 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 47815c5..da49dab 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -15,6 +15,7 @@ AM_CPPFLAGS = \ $(DBUS_CFLAGS) \ $(CAIRO_CFLAGS) \ $(LIBSECRET_CFLAGS) \ + $(MATE_DESKTOP_CFLAGS) \ $(KEYRING_CFLAGS) \ $(X11_CFLAGS) \ $(LIBNOTIFY_CFLAGS) \ @@ -198,6 +199,7 @@ mate_power_manager_LDADD = \ $(X11_LIBS) \ $(GSTREAMER_LIBS) \ $(CAIRO_LIBS) \ + $(MATE_DESKTOP_LIBS) \ $(LIBSECRET_LIBS) \ $(KEYRING_LIBS) \ $(DBUS_LIBS) \ @@ -261,6 +263,7 @@ mate_power_self_test_LDADD = \ $(GLIB_LIBS) \ $(X11_LIBS) \ $(CAIRO_LIBS) \ + $(MATE_DESKTOP_LIBS) \ $(LIBSECRET_LIBS) \ $(KEYRING_LIBS) \ $(GSTREAMER_LIBS) \ diff --git a/src/gpm-tray-icon.c b/src/gpm-tray-icon.c index 9f5fe38..e8e84bb 100644 --- a/src/gpm-tray-icon.c +++ b/src/gpm-tray-icon.c @@ -41,6 +41,8 @@ #include <gtk/gtk.h> #include <libupower-glib/upower.h> +#include <libmate-desktop/mate-image-menu-item.h> + #include "gpm-upower.h" #include "gpm-engine.h" #include "gpm-common.h" @@ -275,13 +277,12 @@ gpm_tray_icon_add_device (GpmTrayIcon *icon, GtkMenu *menu, const GPtrArray *arr else { label = g_strdup_printf ("%s (%.1f%%)", gpm_device_kind_to_localised_string (kind, 1), percentage); } - item = gtk_image_menu_item_new_with_label (label); + item = mate_image_menu_item_new_with_label (label); /* generate the image */ icon_name = gpm_upower_get_device_icon (device); image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image); - gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (item), TRUE); + mate_image_menu_item_set_image (MATE_IMAGE_MENU_ITEM (item), image); /* set callback and add the menu */ g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (gpm_tray_icon_show_info_cb), icon); @@ -317,7 +318,7 @@ gpm_tray_icon_add_primary_device (GpmTrayIcon *icon, GtkMenu *menu, UpDevice *de /* TRANSLATORS: % is a timestring, e.g. "6 hours 10 minutes" */ string = g_strdup_printf (_("%s remaining"), time_str); - item = gtk_image_menu_item_new_with_label (string); + item = mate_image_menu_item_new_with_label (string); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); g_free (time_str); g_free (string); @@ -371,9 +372,9 @@ gpm_tray_icon_create_menu (GpmTrayIcon *icon) } /* preferences */ - item = gtk_image_menu_item_new_with_mnemonic (_("_Preferences")); + item = mate_image_menu_item_new_with_mnemonic (_("_Preferences")); image = gtk_image_new_from_icon_name ("preferences-system", GTK_ICON_SIZE_MENU); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image); + mate_image_menu_item_set_image (MATE_IMAGE_MENU_ITEM (item), image); g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (gpm_tray_icon_show_preferences_cb), icon); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); |