[evince] libview: setting annotation window icons sizes
- From: Giselle Reis <gisellemnr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] libview: setting annotation window icons sizes
- Date: Fri, 29 Aug 2014 17:54:38 +0000 (UTC)
commit 63d0b4b3f281ddb42750d384066856934aed9ade
Author: Giselle Reis <gisellemnr src gnome org>
Date: Wed Aug 20 17:52:18 2014 +0200
libview: setting annotation window icons sizes
After a gtk update, the sizes of the icons on the
annotation window (close and resize handles) are
48x48. This patch fixes this by using GtkIconTheme
to force the loading of the icon on a different
size than the file.
https://bugzilla.gnome.org/show_bug.cgi?id=735110
libview/ev-annotation-window.c | 25 +++++++++++++++++++------
1 files changed, 19 insertions(+), 6 deletions(-)
---
diff --git a/libview/ev-annotation-window.c b/libview/ev-annotation-window.c
index 30a2fa7..630a146 100644
--- a/libview/ev-annotation-window.c
+++ b/libview/ev-annotation-window.c
@@ -291,9 +291,13 @@ ev_annotation_window_close (EvAnnotationWindow *window)
static void
ev_annotation_window_init (EvAnnotationWindow *window)
{
- GtkWidget *vbox, *hbox;
- GtkWidget *icon;
- GtkWidget *swindow;
+ GtkWidget *vbox, *hbox;
+ GtkWidget *icon;
+ GtkWidget *swindow;
+ GtkIconTheme *icon_theme;
+ GdkPixbuf *pixbuf;
+
+ icon_theme = gtk_icon_theme_get_default ();
gtk_widget_set_can_focus (GTK_WIDGET (window), TRUE);
@@ -316,7 +320,10 @@ ev_annotation_window_init (EvAnnotationWindow *window)
g_signal_connect_swapped (window->close_button, "clicked",
G_CALLBACK (ev_annotation_window_close),
window);
- icon = gtk_image_new_from_stock (EV_STOCK_CLOSE, EV_ICON_SIZE_ANNOT_WINDOW);
+ pixbuf = gtk_icon_theme_load_icon (icon_theme, EV_STOCK_CLOSE, 8,
+ GTK_ICON_LOOKUP_FORCE_SIZE, NULL);
+ icon = gtk_image_new_from_pixbuf (pixbuf);
+ g_object_unref (pixbuf);
gtk_container_add (GTK_CONTAINER (window->close_button), icon);
gtk_widget_show (icon);
@@ -352,7 +359,10 @@ ev_annotation_window_init (EvAnnotationWindow *window)
G_CALLBACK (ev_annotation_window_set_resize_cursor),
window);
- icon = gtk_image_new_from_stock (EV_STOCK_RESIZE_SW, EV_ICON_SIZE_ANNOT_WINDOW);
+ pixbuf = gtk_icon_theme_load_icon (icon_theme, EV_STOCK_RESIZE_SW, 8,
+ GTK_ICON_LOOKUP_FORCE_SIZE, NULL);
+ icon = gtk_image_new_from_pixbuf (pixbuf);
+ g_object_unref (pixbuf);
gtk_container_add (GTK_CONTAINER (window->resize_sw), icon);
gtk_widget_show (icon);
gtk_box_pack_start (GTK_BOX (hbox), window->resize_sw, FALSE, FALSE, 0);
@@ -367,7 +377,10 @@ ev_annotation_window_init (EvAnnotationWindow *window)
G_CALLBACK (ev_annotation_window_set_resize_cursor),
window);
- icon = gtk_image_new_from_stock (EV_STOCK_RESIZE_SE, EV_ICON_SIZE_ANNOT_WINDOW);
+ pixbuf = gtk_icon_theme_load_icon (icon_theme, EV_STOCK_RESIZE_SE, 8,
+ GTK_ICON_LOOKUP_FORCE_SIZE, NULL);
+ icon = gtk_image_new_from_pixbuf (pixbuf);
+ g_object_unref (pixbuf);
gtk_container_add (GTK_CONTAINER (window->resize_se), icon);
gtk_widget_show (icon);
gtk_box_pack_end (GTK_BOX (hbox), window->resize_se, FALSE, FALSE, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]