diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/idoalarmmenuitem.c | 4 | ||||
-rw-r--r-- | src/idoappointmentmenuitem.c | 3 | ||||
-rw-r--r-- | src/idobasicmenuitem.c | 23 | ||||
-rw-r--r-- | src/idolevelmenuitem.c | 19 | ||||
-rw-r--r-- | src/idolocationmenuitem.c | 3 | ||||
-rw-r--r-- | src/idomediaplayermenuitem.c | 2 | ||||
-rw-r--r-- | src/idoplaybackmenuitem.c | 10 | ||||
-rw-r--r-- | src/idoremovablemenuitem.c | 21 | ||||
-rw-r--r-- | src/idousermenuitem.c | 4 |
9 files changed, 25 insertions, 64 deletions
diff --git a/src/idoalarmmenuitem.c b/src/idoalarmmenuitem.c index 7b70e6d..1547809 100644 --- a/src/idoalarmmenuitem.c +++ b/src/idoalarmmenuitem.c @@ -1,9 +1,11 @@ /* * Copyright 2013 Canonical Ltd. + * Copyright 2021-2023 Robert Tari * * Authors: * Charles Kerr <charles.kerr@canonical.com> * Ted Gould <ted@canonical.com> + * Robert Tari <robert@tari.in> * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -91,8 +93,6 @@ ido_alarm_menu_item_new_from_model (GMenuItem * menu_item, for (i=0; i<n; i++) g_value_unset (&values[i]); - g_free(names); - /* add an ActionHelper */ if (g_menu_item_get_attribute (menu_item, "action", "s", &str)) diff --git a/src/idoappointmentmenuitem.c b/src/idoappointmentmenuitem.c index 0219c2c..dcdc3a8 100644 --- a/src/idoappointmentmenuitem.c +++ b/src/idoappointmentmenuitem.c @@ -1,6 +1,6 @@ /* * Copyright 2013 Canonical Ltd. - * Copyright 2021 Robert Tari + * Copyright 2021-2023 Robert Tari * * Authors: * Charles Kerr <charles.kerr@canonical.com> @@ -136,6 +136,7 @@ ido_appointment_menu_item_new_from_model (GMenuItem * menu_item, for (i=0; i<n; i++) g_value_unset (&values[i]); + g_free (values); /* add an ActionHelper */ diff --git a/src/idobasicmenuitem.c b/src/idobasicmenuitem.c index 5077546..5106144 100644 --- a/src/idobasicmenuitem.c +++ b/src/idobasicmenuitem.c @@ -1,6 +1,6 @@ /* * Copyright 2013 Canonical Ltd. - * Copyright 2021-2022 Robert Tari + * Copyright 2021-2023 Robert Tari * * Authors: * Charles Kerr <charles.kerr@canonical.com> @@ -163,25 +163,8 @@ ido_basic_menu_item_update_image (IdoBasicMenuItem *self) } else if (p->icon) { - GtkIconInfo *info; - const gchar *filename; - - info = gtk_icon_theme_lookup_by_gicon (gtk_icon_theme_get_default (), p->icon, 16, 0); - filename = gtk_icon_info_get_filename (info); - - if (filename) - { - GdkPixbuf *pixbuf; - - pixbuf = gdk_pixbuf_new_from_file_at_scale (filename, -1, 16, TRUE, NULL); - gtk_image_set_from_pixbuf (GTK_IMAGE (p->image), pixbuf); - - g_object_unref (pixbuf); - } - - gtk_widget_set_visible (p->image, filename != NULL); - - g_object_unref (info); + gtk_image_set_from_gicon (GTK_IMAGE (p->image), p->icon, GTK_ICON_SIZE_MENU); + gtk_widget_set_visible (p->image, TRUE); } } } diff --git a/src/idolevelmenuitem.c b/src/idolevelmenuitem.c index b7ce543..5f4f5bb 100644 --- a/src/idolevelmenuitem.c +++ b/src/idolevelmenuitem.c @@ -143,23 +143,8 @@ static void idoLevelMenuItemStyleUpdateImage (IdoLevelMenuItem *self) } else { - GtkIconInfo *pInfo; - const gchar *sFilename; - - pInfo = gtk_icon_theme_lookup_by_gicon (gtk_icon_theme_get_default(), pPrivate->pIcon, 16, 0); - sFilename = gtk_icon_info_get_filename (pInfo); - - if (sFilename) - { - GdkPixbuf *pPixbuf; - - pPixbuf = gdk_pixbuf_new_from_file_at_scale (sFilename, -1, 16, TRUE, NULL); - gtk_image_set_from_pixbuf (GTK_IMAGE (pPrivate->pImage), pPixbuf); - g_object_unref (pPixbuf); - } - - gtk_widget_set_visible (pPrivate->pImage, sFilename != NULL); - g_object_unref (pInfo); + gtk_image_set_from_gicon (GTK_IMAGE (pPrivate->pImage), pPrivate->pIcon, GTK_ICON_SIZE_MENU); + gtk_widget_set_visible (pPrivate->pImage, TRUE); } } diff --git a/src/idolocationmenuitem.c b/src/idolocationmenuitem.c index 6999cc1..2748e54 100644 --- a/src/idolocationmenuitem.c +++ b/src/idolocationmenuitem.c @@ -1,8 +1,10 @@ /* * Copyright 2013 Canonical Ltd. + * Copyright 2023 Robert Tari * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -337,6 +339,7 @@ ido_location_menu_item_new_from_model (GMenuItem * menu_item, for (i=0; i<n; i++) g_value_unset (&values[i]); + g_free (values); /* give it an ActionHelper */ diff --git a/src/idomediaplayermenuitem.c b/src/idomediaplayermenuitem.c index 801d57b..071c4af 100644 --- a/src/idomediaplayermenuitem.c +++ b/src/idomediaplayermenuitem.c @@ -1,5 +1,6 @@ /* * Copyright 2013 Canonical Ltd. + * Copyright 2023 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -17,6 +18,7 @@ * Conor Curran <conor.curran@canonical.com> * Mirco Müller <mirco.mueller@canonical.com> * Lars Uebernickel <lars.uebernickel@canonical.com> + * Robert Tari <robert@tari.in> */ #include "idomediaplayermenuitem.h" diff --git a/src/idoplaybackmenuitem.c b/src/idoplaybackmenuitem.c index 7f19718..fc42b6d 100644 --- a/src/idoplaybackmenuitem.c +++ b/src/idoplaybackmenuitem.c @@ -1,5 +1,6 @@ /* * Copyright 2013 Canonical Ltd. + * Copyright 2023 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -18,6 +19,7 @@ * Mirco Müller <mirco.mueller@canonical.com> * Andrea Cimitan <andrea.cimitan@canonical.com> * Lars Uebernickel <lars.uebernickel@canonical.com> + * Robert Tari <robert@tari.in> */ #include "idoplaybackmenuitem.h" @@ -290,14 +292,8 @@ ido_playback_menu_item_button_release_event (GtkWidget *menuitem, GdkEventButton *event) { IdoPlaybackMenuItem *item = IDO_PLAYBACK_MENU_ITEM (menuitem); - Button button; - const gchar *action = action; - button = ido_playback_menu_item_get_button_at_pos (menuitem, event->x, event->y); - if (button != item->cur_pushed_button) - button = BUTTON_NONE; - - action = item->button_actions[item->cur_pushed_button]; + const gchar *action = item->button_actions[item->cur_pushed_button]; if (item->action_group && action) g_action_group_activate_action (item->action_group, action, NULL); diff --git a/src/idoremovablemenuitem.c b/src/idoremovablemenuitem.c index 946ffb3..d857fd4 100644 --- a/src/idoremovablemenuitem.c +++ b/src/idoremovablemenuitem.c @@ -1,8 +1,10 @@ /* * Copyright 2013 Canonical Ltd. + * Copyright 2023 Robert Tari * * Authors: * Charles Kerr <charles.kerr@canonical.com> + * Robert Tari <robert@tari.in> * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -131,23 +133,8 @@ static void idoRemovableMenuItemStyleUpdateImage(IdoRemovableMenuItem *self) } else { - GtkIconInfo *pInfo; - const gchar *sFilename; - - pInfo = gtk_icon_theme_lookup_by_gicon(gtk_icon_theme_get_default(), pPrivate->pIcon, 16, 0); - sFilename = gtk_icon_info_get_filename(pInfo); - - if (sFilename) - { - GdkPixbuf *pPixbuf; - - pPixbuf = gdk_pixbuf_new_from_file_at_scale(sFilename, -1, 16, TRUE, NULL); - gtk_image_set_from_pixbuf(GTK_IMAGE(pPrivate->pImage), pPixbuf); - g_object_unref (pPixbuf); - } - - gtk_widget_set_visible(pPrivate->pImage, sFilename != NULL); - g_object_unref(pInfo); + gtk_image_set_from_gicon (GTK_IMAGE (pPrivate->pImage), pPrivate->pIcon, GTK_ICON_SIZE_MENU); + gtk_widget_set_visible (pPrivate->pImage, TRUE); } } diff --git a/src/idousermenuitem.c b/src/idousermenuitem.c index 1f157ae..4279723 100644 --- a/src/idousermenuitem.c +++ b/src/idousermenuitem.c @@ -1,10 +1,12 @@ /* Copyright 2011 Canonical Ltd. +Copyright 2023 Robert Tari Authors: Conor Curran <conor.curran@canonical.com> Mirco Müller <mirco.mueller@canonical.com> Charles Kerr <charles.kerr@canonical.com> + Robert Tari <robert@tari.in> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3, as published @@ -445,6 +447,8 @@ user_menu_item_new_from_model (GMenuItem * menuitem, for (i=0; i<n; i++) g_value_unset (&values[i]); + g_free (values); + /* gie it an ActionHelper */ if (g_menu_item_get_attribute (menuitem, G_MENU_ATTRIBUTE_ACTION, "s", &action)) |