[gnome-color-manager] trivial: use floating point in the fine adjustment pane



commit ccb243cf46e4a120c48355138528cb16fcd4e861
Author: Richard Hughes <richard hughsie com>
Date:   Sun Nov 29 21:54:39 2009 +0000

    trivial: use floating point in the fine adjustment pane

 data/gcm-prefs.ui |    2 --
 src/gcm-prefs.c   |   12 +++++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/data/gcm-prefs.ui b/data/gcm-prefs.ui
index e784c0a..54d53cd 100644
--- a/data/gcm-prefs.ui
+++ b/data/gcm-prefs.ui
@@ -591,7 +591,6 @@
                                         <property name="can_focus">True</property>
                                         <property name="restrict_to_fill_level">False</property>
                                         <property name="fill_level">1</property>
-                                        <property name="digits">0</property>
                                         <property name="value_pos">right</property>
                                       </object>
                                       <packing>
@@ -607,7 +606,6 @@
                                         <property name="can_focus">True</property>
                                         <property name="restrict_to_fill_level">False</property>
                                         <property name="fill_level">1</property>
-                                        <property name="digits">0</property>
                                         <property name="value_pos">right</property>
                                       </object>
                                       <packing>
diff --git a/src/gcm-prefs.c b/src/gcm-prefs.c
index 2061cd8..c8f95d0 100644
--- a/src/gcm-prefs.c
+++ b/src/gcm-prefs.c
@@ -802,7 +802,7 @@ gcm_prefs_reset_cb (GtkWidget *widget, gpointer data)
 	setting_up_device = FALSE;
 	/* we only want one save, not three */
 	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hscale_contrast"));
-	gtk_range_set_value (GTK_RANGE (widget), 100.0f);
+	gtk_range_set_value (GTK_RANGE (widget), 1.0f);
 }
 
 /**
@@ -1500,8 +1500,8 @@ gcm_prefs_slider_changed_cb (GtkRange *range, gpointer *user_data)
 
 	g_object_set (current_device,
 		      "gamma", localgamma,
-		      "brightness", brightness,
-		      "contrast", contrast,
+		      "brightness", brightness * 100.0f,
+		      "contrast", contrast * 100.0f,
 		      NULL);
 
 	/* save new profile */
@@ -2034,11 +2034,13 @@ main (int argc, char **argv)
 
 	/* set ranges */
 	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hscale_brightness"));
-	gtk_range_set_range (GTK_RANGE (widget), 0.0f, 99.0f);
+	gtk_range_set_range (GTK_RANGE (widget), 0.0f, 0.9f);
+//	gtk_scale_add_mark (GTK_SCALE (widget), 0.0f, GTK_POS_TOP, "");
 
 	/* set ranges */
 	widget = GTK_WIDGET (gtk_builder_get_object (builder, "hscale_contrast"));
-	gtk_range_set_range (GTK_RANGE (widget), 1.0f, 100.0f);
+	gtk_range_set_range (GTK_RANGE (widget), 0.1f, 1.0f);
+//	gtk_scale_add_mark (GTK_SCALE (widget), 1.0f, GTK_POS_TOP, "");
 
 	/* set alignment */
 	size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);



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