>From b5bfc43aec5cae79d8c3e257f62b0556607a0cdd Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofour...@redhat.com>
Date: Fri, 30 Nov 2012 11:55:30 +0100
Subject: [PATCH] tools: simplify label printing

Signed-off-by: Olivier Fourdan <ofour...@redhat.com>
---
 tools/show-svg-image.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/show-svg-image.c b/tools/show-svg-image.c
index d9e1ec0..af57b37 100644
--- a/tools/show-svg-image.c
+++ b/tools/show-svg-image.c
@@ -163,10 +163,9 @@ print_button_labels (cairo_t *cairo_context, Tablet *tablet)
 
 		flags = libwacom_get_button_flag(tablet->device, button);
 		sub = g_strdup_printf ("#Label%c", button);
-		if (button == tablet->active_button)
-			label = g_strdup_printf ("<span foreground=\"" ACTIVE_COLOR "\" >Button %c</span>", button);
-		else
-			label = g_strdup_printf ("<span foreground=\"" INACTIVE_COLOR "\" >Button %c</span>", button);
+		label = g_strdup_printf ("<span foreground=\"%s\" >Button %c</span>",
+		                         (button == tablet->active_button) ? ACTIVE_COLOR : INACTIVE_COLOR,
+		                         button);
 		print_label (cairo_context, tablet, sub, label, flags);
 		g_free (label);
 		g_free (sub);
-- 
1.7.1

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
TUNE You got it built. Now make it sing. Tune shows you how.
http://goparallel.sourceforge.net
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to