Load gesture images as symbolic icons

This makes them recolor in the dark theme, which looks better.
This commit is contained in:
Matthias Clasen 2015-11-23 10:07:44 -05:00
parent 454a4b7576
commit b6e03dbc26
19 changed files with 19 additions and 8 deletions

View File

@ -1201,9 +1201,9 @@ gtk.gresource.xml: Makefile.am inspector/Makefile.inc
n=`basename $$f`; \
echo " <file>cursor/$$n</file>" >> $@; \
done; \
for f in $(srcdir)/gesture/*.png; do \
for f in $(srcdir)/gesture/*.symbolic.png; do \
n=`basename $$f`; \
echo " <file>gesture/$$n</file>" >> $@; \
echo " <file alias='icons/64x64/actions/$$n'>gesture/$$n</file>" >> $@; \
done; \
for f in $(srcdir)/ui/*.ui; do \
n=`basename $$f`; \

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 B

View File

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 B

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 940 B

After

Width:  |  Height:  |  Size: 882 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 936 B

View File

@ -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);
}
}