[gnome-color-manager] trivial: mark the color temperatures with thier Dxx identification



commit 0d4e90cf34caf3d08a09b6f45f0573697e8bb9a5
Author: Richard Hughes <richard hughsie com>
Date:   Mon Apr 18 07:05:56 2011 +0100

    trivial: mark the color temperatures with thier Dxx identification

 src/gcm-viewer.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/gcm-viewer.c b/src/gcm-viewer.c
index f1e6635..fa1645a 100644
--- a/src/gcm-viewer.c
+++ b/src/gcm-viewer.c
@@ -28,6 +28,7 @@
 #include <locale.h>
 #include <canberra-gtk.h>
 #include <colord.h>
+#include <math.h>
 
 #ifdef HAVE_CLUTTER
  #include <clutter-gtk/clutter-gtk.h>
@@ -839,7 +840,13 @@ gcm_viewer_set_profile (GcmViewerPrivate *viewer, CdProfile *profile)
 	/* set whitepoint */
 	temperature = gcm_profile_get_temperature (gcm_profile);
 	widget = GTK_WIDGET (gtk_builder_get_object (viewer->builder, "label_temp"));
-	temp = g_strdup_printf ("%i°K", temperature);
+	if (fabs (temperature - 5000) < 10) {
+		temp = g_strdup_printf ("%i°K (D50)", temperature);
+	} else if (fabs (temperature - 6500) < 10) {
+		temp = g_strdup_printf ("%i°K (D65)", temperature);
+	} else {
+		temp = g_strdup_printf ("%i°K", temperature);
+	}
 	gtk_label_set_label (GTK_LABEL (widget), temp);
 	g_free (temp);
 	widget = GTK_WIDGET (gtk_builder_get_object (viewer->builder, "hbox_temp"));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]