diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-11-23 10:07:44 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-11-23 10:08:14 -0500 |
commit | b6e03dbc260a26f47a9b4a5ba609c72dd8eec440 (patch) | |
tree | 2a54f1ef9ce4e87a4526e9da2d0834eac1fd861f /gtk/gtkshortcutsshortcut.c | |
parent | 454a4b7576904c2858a5b6b28cca5637a9fbe5e9 (diff) | |
download | gtk+-b6e03dbc260a26f47a9b4a5ba609c72dd8eec440.tar.gz |
Load gesture images as symbolic icons
This makes them recolor in the dark theme, which looks better.
Diffstat (limited to 'gtk/gtkshortcutsshortcut.c')
-rw-r--r-- | gtk/gtkshortcutsshortcut.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/gtk/gtkshortcutsshortcut.c b/gtk/gtkshortcutsshortcut.c index 6b5bdcad0d..28aab42a8d 100644 --- a/gtk/gtkshortcutsshortcut.c +++ b/gtk/gtkshortcutsshortcut.c @@ -189,36 +189,47 @@ gtk_shortcuts_shortcut_set_subtitle (GtkShortcutsShortcut *self, static void update_icon_from_type (GtkShortcutsShortcut *self) { + GIcon *icon; + if (self->icon_set) return; switch (self->shortcut_type) { case GTK_SHORTCUT_GESTURE_PINCH: - gtk_image_set_from_resource (self->image, "/org/gtk/libgtk/gesture/pinch.png"); + icon = g_themed_icon_new ("gesture-pinch-symbolic"); break; case GTK_SHORTCUT_GESTURE_STRETCH: - gtk_image_set_from_resource (self->image, "/org/gtk/libgtk/gesture/stretch.png"); + icon = g_themed_icon_new ("gesture-stretch-symbolic"); break; case GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE: - gtk_image_set_from_resource (self->image, "/org/gtk/libgtk/gesture/rotate-clockwise.png"); + icon = g_themed_icon_new ("gesture-rotate-clockwise-symbolic"); break; case GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE: - gtk_image_set_from_resource (self->image, "/org/gtk/libgtk/gesture/rotate-anticlockwise.png"); + icon = g_themed_icon_new ("gesture-rotate-anticlockwise-symbolic"); break; case GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT: - gtk_image_set_from_resource (self->image, "/org/gtk/libgtk/gesture/two-finger-swipe-left.png"); + icon = g_themed_icon_new ("gesture-two-finger-swipe-left-symbolic"); break; case GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT: - gtk_image_set_from_resource (self->image, "/org/gtk/libgtk/gesture/two-finger-swipe-right.png"); + icon = g_themed_icon_new ("gesture-two-finger-swipe-right-symbolic"); break; default: ; + icon = NULL; + break; + } + + if (icon) + { + gtk_image_set_from_gicon (self->image, icon, GTK_ICON_SIZE_DIALOG); + gtk_image_set_pixel_size (self->image, 64); + g_object_unref (icon); } } |