summaryrefslogtreecommitdiff
path: root/stickynotes/stickynotes.c
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-01-04 17:50:08 +0300
committermonsta <[email protected]>2016-01-04 17:50:08 +0300
commit4a9c10288ab7dcd26c667c5d8fefbbc44e8c4cf3 (patch)
treeb592eb6f48349da2080d8a5ef351c72f714e1663 /stickynotes/stickynotes.c
parent4dbb7347a4b344658d28cfd49f6a925f000422ee (diff)
downloadmate-applets-4a9c10288ab7dcd26c667c5d8fefbbc44e8c4cf3.tar.bz2
mate-applets-4a9c10288ab7dcd26c667c5d8fefbbc44e8c4cf3.tar.xz
stickynotes: new icon names and paths + fix deprecations
adapted from https://git.gnome.org/browse/gnome-applets/commit/?id=76982eb73ce1bd912cc19a55d3b6682b9da93687
Diffstat (limited to 'stickynotes/stickynotes.c')
-rw-r--r--stickynotes/stickynotes.c38
1 files changed, 4 insertions, 34 deletions
diff --git a/stickynotes/stickynotes.c b/stickynotes/stickynotes.c
index acfa2b30..3ffc88dd 100644
--- a/stickynotes/stickynotes.c
+++ b/stickynotes/stickynotes.c
@@ -40,9 +40,7 @@
/* Stop gcc complaining about xmlChar's signedness */
#define XML_CHAR(str) ((xmlChar *) (str))
-#if GTK_CHECK_VERSION (3, 0, 0)
#define STICKYNOTES_ICON_SIZE 8
-#endif
static gboolean save_scheduled = FALSE;
@@ -107,9 +105,6 @@ stickynote_new_aux (GdkScreen *screen, gint x, gint y, gint w, gint h)
{
StickyNote *note;
GtkBuilder *builder;
-#if !GTK_CHECK_VERSION (3, 0, 0)
- GtkIconSize size;
-#endif
note = g_new (StickyNote, 1);
@@ -202,24 +197,15 @@ stickynote_new_aux (GdkScreen *screen, gint x, gint y, gint w, gint h)
note->y);
/* Set the button images */
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_image_set_from_icon_name (note->img_close, STICKYNOTES_STOCK_CLOSE, GTK_ICON_SIZE_MENU);
gtk_image_set_pixel_size (note->img_close, STICKYNOTES_ICON_SIZE);
- gtk_image_set_from_stock (note->img_resize_se, STICKYNOTES_STOCK_RESIZE_SE, GTK_ICON_SIZE_MENU);
+ gtk_image_set_from_icon_name (note->img_resize_se, STICKYNOTES_STOCK_RESIZE_SE, GTK_ICON_SIZE_MENU);
gtk_image_set_pixel_size (note->img_resize_se, STICKYNOTES_ICON_SIZE);
- gtk_image_set_from_stock (note->img_resize_sw, STICKYNOTES_STOCK_RESIZE_SW, GTK_ICON_SIZE_MENU);
+ gtk_image_set_from_icon_name (note->img_resize_sw, STICKYNOTES_STOCK_RESIZE_SW, GTK_ICON_SIZE_MENU);
gtk_image_set_pixel_size (note->img_resize_sw, STICKYNOTES_ICON_SIZE);
-#else
- size = gtk_icon_size_from_name ("stickynotes_icon_size");
- gtk_image_set_from_stock (note->img_close,
- STICKYNOTES_STOCK_CLOSE, size);
- gtk_image_set_from_stock (note->img_resize_se,
- STICKYNOTES_STOCK_RESIZE_SE, size);
- gtk_image_set_from_stock (note->img_resize_sw,
- STICKYNOTES_STOCK_RESIZE_SW, size);
-#endif
+
gtk_widget_show(note->w_lock);
gtk_widget_show(note->w_close);
gtk_widget_show(GTK_WIDGET (gtk_builder_get_object (builder, "resize_bar")));
@@ -692,40 +678,24 @@ stickynote_set_font (StickyNote *note, const gchar *font_str, gboolean save)
/* Lock/Unlock a sticky note from editing */
void stickynote_set_locked(StickyNote *note, gboolean locked)
{
-#if !GTK_CHECK_VERSION (3, 0, 0)
- GtkIconSize size;
-#endif
note->locked = locked;
/* Set cursor visibility and editability */
gtk_text_view_set_editable(GTK_TEXT_VIEW(note->w_body), !locked);
gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(note->w_body), !locked);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- size = gtk_icon_size_from_name ("stickynotes_icon_size");
-#endif
-
/* Show appropriate icon and tooltip */
if (locked) {
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_image_set_from_icon_name (note->img_lock, STICKYNOTES_STOCK_LOCKED, GTK_ICON_SIZE_MENU);
gtk_widget_set_tooltip_text(note->w_lock, _("This note is locked."));
}
else {
gtk_image_set_from_icon_name (note->img_lock, STICKYNOTES_STOCK_UNLOCKED, GTK_ICON_SIZE_MENU);
-#else
- gtk_image_set_from_stock(note->img_lock, STICKYNOTES_STOCK_LOCKED, size);
- gtk_widget_set_tooltip_text(note->w_lock, _("This note is locked."));
- }
- else {
- gtk_image_set_from_stock(note->img_lock, STICKYNOTES_STOCK_UNLOCKED, size);
-#endif
gtk_widget_set_tooltip_text(note->w_lock, _("This note is unlocked."));
}
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_image_set_pixel_size (note->img_lock, STICKYNOTES_ICON_SIZE);
-#endif
+
gtk_toggle_action_set_active(note->ta_lock_toggle_item, locked);
stickynotes_applet_update_menus();