diff options
author | raveit65 <[email protected]> | 2023-10-06 17:58:58 +0200 |
---|---|---|
committer | Luke from DC <[email protected]> | 2023-10-09 16:22:23 +0000 |
commit | ebb3a795a351ca600eb539ed2bba013a6533d749 (patch) | |
tree | ccb81d6ffc6ed20b744560a8c83b71dcda8e6e12 | |
parent | a6ea51bbaf4b9edf3bab3fea5daf0d0bb30b5d7a (diff) | |
download | mate-panel-ebb3a795a351ca600eb539ed2bba013a6533d749.tar.bz2 mate-panel-ebb3a795a351ca600eb539ed2bba013a6533d749.tar.xz |
replace deprecated gtk-image-menu-item*
-rw-r--r-- | .build.yml | 33 | ||||
-rw-r--r-- | applets/notification_area/status-notifier/sn-dbus-menu-item.c | 18 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | mate-panel/menu.c | 9 | ||||
-rw-r--r-- | mate-panel/panel-menu-bar.c | 6 | ||||
-rw-r--r-- | mate-panel/panel-menu-items.c | 9 | ||||
-rw-r--r-- | mate-panel/panel-recent.c | 6 |
7 files changed, 60 insertions, 23 deletions
@@ -22,6 +22,9 @@ requires: - meson - which - yelp-tools + # mate-desktop dependencies + - iso-codes + - gobject-introspection debian: # Useful URL: https://github.com/mate-desktop/debian-packages @@ -57,6 +60,10 @@ requires: - mate-common - meson - yelp-tools + # mate-desktop dependencies + - iso-codes + - gobject-introspection + - libgirepository1.0-dev fedora: # Useful URL: https://src.fedoraproject.org/cgit/rpms/mate-panel.git @@ -80,6 +87,9 @@ requires: - meson - redhat-rpm-config - yelp-tools + # mate-desktop dependencies + - iso-codes-devel + - gobject-introspection-devel ubuntu: - autoconf-archive @@ -112,6 +122,10 @@ requires: - mate-common - meson - yelp-tools + # mate-desktop dependencies + - iso-codes + - gobject-introspection + - libgirepository1.0-dev variables: - 'CHECKERS=" @@ -130,10 +144,29 @@ variables: -enable-checker alpha.unix.cstring.OutOfBounds -enable-checker alpha.core.FixedAddr -enable-checker security.insecureAPI.strcpy"' + - MATE_DESKTOP_VERSION=1.27.1 before_scripts: build_scripts: + - cd ${START_DIR} + - if [ ! -f mate-desktop-${MATE_DESKTOP_VERSION}.tar.xz ];then + - curl -Ls -o mate-desktop-${MATE_DESKTOP_VERSION}.tar.xz https://github.com/mate-desktop/mate-desktop/releases/download/v${MATE_DESKTOP_VERSION}/mate-desktop-${MATE_DESKTOP_VERSION}.tar.xz + - fi + - tar xf mate-desktop-${MATE_DESKTOP_VERSION}.tar.xz + - cd mate-desktop-${MATE_DESKTOP_VERSION} + - if [ ${DISTRO_NAME} == "debian" -o ${DISTRO_NAME} == "ubuntu" ];then + - ./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu --libexecdir=/usr/lib/x86_64-linux-gnu + - else + - ./autogen.sh --prefix=/usr + - fi + - if [ ${TRAVIS} == "false" ]; then + - make clean + - fi + - make + - make install + + - cd ${START_DIR} - if [ ${DISTRO_NAME} == "debian" ];then - export CFLAGS+=" -Wsign-compare" - cppcheck --enable=warning,style,performance,portability,information,missingInclude -i'gtk-layer-shell-build' . diff --git a/applets/notification_area/status-notifier/sn-dbus-menu-item.c b/applets/notification_area/status-notifier/sn-dbus-menu-item.c index 48a34652..e5c668a2 100644 --- a/applets/notification_area/status-notifier/sn-dbus-menu-item.c +++ b/applets/notification_area/status-notifier/sn-dbus-menu-item.c @@ -16,6 +16,7 @@ */ #include <config.h> +#include <libmate-desktop/mate-image-menu-item.h> #include "sn-dbus-menu-item.h" @@ -203,9 +204,8 @@ sn_dbus_menu_item_new (GVariant *props) cairo_surface_destroy (surface); } - item->item = gtk_image_menu_item_new (); - gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (item->item), TRUE); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item->item), + item->item = mate_image_menu_item_new (); + mate_image_menu_item_set_image (MATE_IMAGE_MENU_ITEM (item->item), image); } @@ -326,7 +326,7 @@ sn_dbus_menu_item_update_props (SnDBusMenuItem *item, image = NULL; } - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item->item), + mate_image_menu_item_set_image (MATE_IMAGE_MENU_ITEM (item->item), image); } else if (g_strcmp0 (prop, "icon-data") == 0) @@ -348,7 +348,7 @@ sn_dbus_menu_item_update_props (SnDBusMenuItem *item, image = NULL; } - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item->item), + mate_image_menu_item_set_image (MATE_IMAGE_MENU_ITEM (item->item), image); } else if (g_strcmp0 (prop, "label") == 0) @@ -438,18 +438,18 @@ sn_dbus_menu_item_remove_props (SnDBusMenuItem *item, else if (g_strcmp0 (prop, "icon-name") == 0) { g_clear_pointer (&item->icon_name, g_free); - if (GTK_IS_IMAGE_MENU_ITEM (item->item)) + if (MATE_IS_IMAGE_MENU_ITEM (item->item)) { - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item->item), + mate_image_menu_item_set_image (MATE_IMAGE_MENU_ITEM (item->item), NULL); } } else if (g_strcmp0 (prop, "icon-data") == 0) { g_clear_object (&item->icon_data); - if (GTK_IS_IMAGE_MENU_ITEM (item->item)) + if (MATE_IS_IMAGE_MENU_ITEM (item->item)) { - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item->item), + mate_image_menu_item_set_image (MATE_IMAGE_MENU_ITEM (item->item), NULL); } } diff --git a/configure.ac b/configure.ac index 940eeb36..4ef1258e 100644 --- a/configure.ac +++ b/configure.ac @@ -53,7 +53,7 @@ fi LT_LIB_M -LIBMATE_DESKTOP_REQUIRED=1.17.0 +LIBMATE_DESKTOP_REQUIRED=1.27.1 GDK_PIXBUF_REQUIRED=2.26.0 PANGO_REQUIRED=1.15.4 GLIB_REQUIRED=2.50.0 diff --git a/mate-panel/menu.c b/mate-panel/menu.c index 2256d799..b72127ff 100644 --- a/mate-panel/menu.c +++ b/mate-panel/menu.c @@ -32,6 +32,7 @@ #include <gtk/gtk.h> #include <gdk/gdkkeysyms.h> #include <libmate-desktop/mate-gsettings.h> +#include <libmate-desktop/mate-image-menu-item.h> #include <matemenu-tree.h> #include <libpanel-util/panel-keyfile.h> @@ -768,7 +769,7 @@ setup_menuitem (GtkWidget *menuitem, gtk_icon_size_lookup (icon_size, NULL, &icon_height); gtk_widget_show (image); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), + mate_image_menu_item_set_image (MATE_IMAGE_MENU_ITEM (menuitem), image); gtk_image_set_pixel_size (GTK_IMAGE(image), icon_height); } @@ -964,9 +965,7 @@ panel_image_menu_item_new (void) { GtkWidget *menuitem; - menuitem = gtk_image_menu_item_new (); - gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (menuitem), - TRUE); + menuitem = mate_image_menu_item_new (); return menuitem; } @@ -983,7 +982,7 @@ create_submenu_entry (GtkWidget *menu, if (force_categories_icon) menuitem = panel_image_menu_item_new (); else - menuitem = gtk_image_menu_item_new (); + menuitem = mate_image_menu_item_new (); setup_menuitem_with_icon (menuitem, panel_menu_icon_get_size (), diff --git a/mate-panel/panel-menu-bar.c b/mate-panel/panel-menu-bar.c index 334f8c9f..fa35d57f 100644 --- a/mate-panel/panel-menu-bar.c +++ b/mate-panel/panel-menu-bar.c @@ -32,6 +32,8 @@ #include <string.h> #include <glib/gi18n.h> +#include <libmate-desktop/mate-image-menu-item.h> + #include <libpanel-util/panel-error.h> #include <libpanel-util/panel-launch.h> #include <libpanel-util/panel-show.h> @@ -135,12 +137,12 @@ panel_menu_bar_update_visibility (GSettings *settings, image = gtk_image_new_from_icon_name(str, icon_size); else image = gtk_image_new_from_icon_name(PANEL_ICON_MAIN_MENU, icon_size); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menubar->priv->applications_item), image); + mate_image_menu_item_set_image (MATE_IMAGE_MENU_ITEM (menubar->priv->applications_item), image); gtk_image_set_pixel_size (GTK_IMAGE (image), icon_height); g_free (str); } else - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menubar->priv->applications_item), NULL); + mate_image_menu_item_set_image (MATE_IMAGE_MENU_ITEM (menubar->priv->applications_item), NULL); } static void panel_menu_bar_init(PanelMenuBar* menubar) diff --git a/mate-panel/panel-menu-items.c b/mate-panel/panel-menu-items.c index aa4c5d1f..2605de9b 100644 --- a/mate-panel/panel-menu-items.c +++ b/mate-panel/panel-menu-items.c @@ -41,6 +41,7 @@ #include <glib/gi18n.h> #include <gio/gio.h> #include <libmate-desktop/mate-gsettings.h> +#include <libmate-desktop/mate-image-menu-item.h> #include <libpanel-util/panel-error.h> #include <libpanel-util/panel-glib.h> @@ -231,7 +232,7 @@ panel_menu_items_append_from_desktop (GtkWidget *menu, if (use_icon) { item = panel_image_menu_item_new (); } else { - item = gtk_image_menu_item_new (); + item = mate_image_menu_item_new (); } setup_menuitem_with_icon (item, panel_menu_icon_get_size (), @@ -312,7 +313,7 @@ panel_menu_items_create_action_item_full (PanelActionButtonType action_type, if (panel_action_get_is_disabled (action_type)) return NULL; - item = gtk_image_menu_item_new (); + item = mate_image_menu_item_new (); setup_menuitem_with_icon (item, panel_menu_icon_get_size (), NULL, @@ -458,7 +459,7 @@ panel_place_menu_item_append_gtk_bookmarks (GtkWidget *menu, guint max_items_or_ } else { GtkWidget *item; - item = gtk_image_menu_item_new (); + item = mate_image_menu_item_new (); setup_menuitem_with_icon (item, panel_menu_icon_get_size (), NULL, PANEL_ICON_BOOKMARKS, _("Bookmarks")); @@ -905,7 +906,7 @@ panel_place_menu_item_append_local_gio (PanelPlaceMenuItem *place_item, } else { GtkWidget *menu_item; - menu_item = gtk_image_menu_item_new (); + menu_item = mate_image_menu_item_new (); setup_menuitem_with_icon (menu_item, panel_menu_icon_get_size (), NULL, PANEL_ICON_REMOVABLE_MEDIA, diff --git a/mate-panel/panel-recent.c b/mate-panel/panel-recent.c index 69b92c93..2ed4715e 100644 --- a/mate-panel/panel-recent.c +++ b/mate-panel/panel-recent.c @@ -30,6 +30,8 @@ #include <glib/gi18n.h> #include <gio/gio.h> +#include <libmate-desktop/mate-image-menu-item.h> + #include <libpanel-util/panel-error.h> #include <libpanel-util/panel-show.h> #include <libpanel-util/panel-gtk.h> @@ -192,7 +194,7 @@ panel_recent_append_documents_menu (GtkWidget *top_menu, GtkWidget *menu_item; int size; - menu_item = gtk_image_menu_item_new (); + menu_item = mate_image_menu_item_new (); setup_menuitem_with_icon (menu_item, panel_menu_icon_get_size (), NULL, @@ -234,7 +236,7 @@ panel_recent_append_documents_menu (GtkWidget *top_menu, add_menu_separator (recent_menu); - menu_item = gtk_image_menu_item_new (); + menu_item = mate_image_menu_item_new (); setup_menuitem_with_icon (menu_item, panel_menu_icon_get_size (), NULL, |