[gnome-settings-daemon] wacom: add a new icon for stylii without an eraser
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] wacom: add a new icon for stylii without an eraser
- Date: Wed, 1 Apr 2015 09:15:14 +0000 (UTC)
commit 7620ded4756268a9ea18548d18f132eae37a6144
Author: Benjamin Tissoires <benjamin tissoires redhat com>
Date: Fri Mar 13 17:04:17 2015 -0400
wacom: add a new icon for stylii without an eraser
https://bugzilla.gnome.org/show_bug.cgi?id=746182
plugins/wacom/gsd-wacom-device.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-device.c b/plugins/wacom/gsd-wacom-device.c
index 2e0ea7b..b109444 100644
--- a/plugins/wacom/gsd-wacom-device.c
+++ b/plugins/wacom/gsd-wacom-device.c
@@ -122,8 +122,10 @@ gsd_wacom_stylus_finalize (GObject *object)
}
static const char *
-get_icon_name_from_type (WacomStylusType type)
+get_icon_name_from_type (const WacomStylus *wstylus)
{
+ WacomStylusType type = libwacom_stylus_get_type (wstylus);
+
switch (type) {
case WSTYLUS_INKING:
case WSTYLUS_STROKE:
@@ -137,6 +139,8 @@ get_icon_name_from_type (WacomStylusType type)
case WSTYLUS_CLASSIC:
return "wacom-stylus-classic";
default:
+ if (!libwacom_stylus_has_eraser (wstylus))
+ return "wacom-stylus-no-eraser";
return "wacom-stylus";
}
}
@@ -158,7 +162,7 @@ gsd_wacom_stylus_new (GsdWacomDevice *device,
stylus->priv->name = g_strdup (libwacom_stylus_get_name (wstylus));
stylus->priv->settings = settings;
stylus->priv->type = libwacom_stylus_get_type (wstylus);
- stylus->priv->icon_name = get_icon_name_from_type (stylus->priv->type);
+ stylus->priv->icon_name = get_icon_name_from_type (wstylus);
stylus->priv->has_eraser = libwacom_stylus_has_eraser (wstylus);
stylus->priv->num_buttons = libwacom_stylus_get_num_buttons (wstylus);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]