[gimp] Use GtkAdjustment's accessors
- From: Michael Natterer <mitch src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gimp] Use GtkAdjustment's accessors
- Date: Fri, 9 Oct 2009 19:21:11 +0000 (UTC)
commit a651f4b056414d45f76818d6acb3e2131b31afd6
Author: Michael Natterer <mitch gimp org>
Date: Fri Oct 9 17:06:55 2009 +0200
Use GtkAdjustment's accessors
plug-ins/color-rotate/color-rotate-callbacks.c | 33 +++++++++++++++--------
1 files changed, 21 insertions(+), 12 deletions(-)
---
diff --git a/plug-ins/color-rotate/color-rotate-callbacks.c b/plug-ins/color-rotate/color-rotate-callbacks.c
index 91d985c..c218b89 100644
--- a/plug-ins/color-rotate/color-rotate-callbacks.c
+++ b/plug-ins/color-rotate/color-rotate-callbacks.c
@@ -142,10 +142,13 @@ rcm_spinbutton_to_degrees (GtkWidget *button,
GtkAdjustment *adj;
adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (button));
- adj->value = value * rcm_units_factor (Current.Units);
- adj->upper = 360.0;
- adj->step_increment = 0.01;
- adj->page_increment = 1.0;
+
+ gtk_adjustment_configure (adj,
+ value * rcm_units_factor (Current.Units),
+ gtk_adjustment_get_lower (adj), 360.0,
+ 0.01, 1.0,
+ gtk_adjustment_get_page_size (adj));
+
gtk_spin_button_set_digits (GTK_SPIN_BUTTON (button), 2);
gtk_label_set_text (GTK_LABEL (label), rcm_units_string (Current.Units));
@@ -193,10 +196,13 @@ rcm_spinbutton_to_radians (GtkWidget *button,
GtkAdjustment *adj;
adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (button));
- adj->value = value * rcm_units_factor (Current.Units);
- adj->upper = TP;
- adj->step_increment = 0.0001;
- adj->page_increment = 0.001;
+
+ gtk_adjustment_configure (adj,
+ value * rcm_units_factor (Current.Units),
+ gtk_adjustment_get_lower (adj), TP,
+ 0.0001, 0.001,
+ gtk_adjustment_get_page_size (adj));
+
gtk_spin_button_set_digits (GTK_SPIN_BUTTON (button), 4);
gtk_label_set_text (GTK_LABEL (label), rcm_units_string (Current.Units));
@@ -244,10 +250,13 @@ rcm_spinbutton_to_radians_over_PI (GtkWidget *button,
GtkAdjustment *adj;
adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (button));
- adj->value = value * rcm_units_factor (Current.Units);
- adj->upper = 2.0;
- adj->step_increment = 0.0001;
- adj->page_increment = 0.001;
+
+ gtk_adjustment_configure (adj,
+ value * rcm_units_factor (Current.Units),
+ gtk_adjustment_get_lower (adj), 2.0,
+ 0.0001, 0.001,
+ gtk_adjustment_get_page_size (adj));
+
gtk_spin_button_set_digits (GTK_SPIN_BUTTON (button), 4);
gtk_label_set_text (GTK_LABEL (label), rcm_units_string (Current.Units));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]