[gnome-applets] stickynotes: don't use deprecated gtk_icon_size_register
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-applets] stickynotes: don't use deprecated gtk_icon_size_register
- Date: Thu, 26 Mar 2015 14:07:38 +0000 (UTC)
commit 15dbeb582ce09516eb886e620b13e7e64aeabbcf
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Thu Mar 26 14:03:11 2015 +0200
stickynotes: don't use deprecated gtk_icon_size_register
stickynotes/stickynotes.c | 31 +++++++++++++++++--------------
stickynotes/stickynotes_applet.c | 3 ---
2 files changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/stickynotes/stickynotes.c b/stickynotes/stickynotes.c
index 1a325c5..24ec89d 100644
--- a/stickynotes/stickynotes.c
+++ b/stickynotes/stickynotes.c
@@ -31,6 +31,7 @@
/* Stop gcc complaining about xmlChar's signedness */
#define XML_CHAR(str) ((xmlChar *) (str))
+#define STICKYNOTES_ICON_SIZE 8
static gboolean save_scheduled = FALSE;
@@ -134,7 +135,6 @@ stickynote_new_aux (GdkScreen *screen, gint x, gint y, gint w, gint h)
{
StickyNote *note;
GtkBuilder *builder;
- GtkIconSize size;
note = g_new (StickyNote, 1);
@@ -224,13 +224,15 @@ stickynote_new_aux (GdkScreen *screen, gint x, gint y, gint w, gint h)
note->y);
/* Set the button images */
- 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);
+ 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_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_pixel_size (note->img_resize_sw, STICKYNOTES_ICON_SIZE);
+
gtk_widget_show(note->w_lock);
gtk_widget_show(note->w_close);
gtk_widget_show(GTK_WIDGET (gtk_builder_get_object (builder, "resize_bar")));
@@ -619,27 +621,28 @@ 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)
+void
+stickynote_set_locked (StickyNote *note,
+ gboolean locked)
{
- GtkIconSize size;
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);
- size = gtk_icon_size_from_name ("stickynotes_icon_size");
-
/* Show appropriate icon and tooltip */
if (locked) {
- gtk_image_set_from_stock(note->img_lock, STICKYNOTES_STOCK_LOCKED, size);
+ 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_stock(note->img_lock, STICKYNOTES_STOCK_UNLOCKED, size);
+ gtk_image_set_from_icon_name (note->img_lock, STICKYNOTES_STOCK_UNLOCKED, GTK_ICON_SIZE_MENU);
gtk_widget_set_tooltip_text(note->w_lock, _("This note is unlocked."));
}
+ gtk_image_set_pixel_size (note->img_lock, STICKYNOTES_ICON_SIZE);
+
stickynotes_applet_update_menus();
}
diff --git a/stickynotes/stickynotes_applet.c b/stickynotes/stickynotes_applet.c
index b94723e..bd931af 100644
--- a/stickynotes/stickynotes_applet.c
+++ b/stickynotes/stickynotes_applet.c
@@ -126,9 +126,6 @@ stickynotes_applet_init (PanelApplet *panel_applet)
g_set_application_name (_("Sticky Notes"));
- /* Register size for icons */
- gtk_icon_size_register ("stickynotes_icon_size", 8,8);
-
gtk_window_set_default_icon_name ("gnome-sticky-notes-applet");
stickynotes->icon_normal = gtk_icon_theme_load_icon (
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]