[gtk/wip/baedert/for-master] spinbutton: Fix adjustment value thinko
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master] spinbutton: Fix adjustment value thinko
- Date: Sun, 6 Oct 2019 12:37:30 +0000 (UTC)
commit 48edd56543c77bc9065747a36bf344adcd729e5f
Author: Timm Bäder <mail baedert org>
Date: Sun Oct 6 14:36:25 2019 +0200
spinbutton: Fix adjustment value thinko
Using ints here is wrong as it makes it impossible to e.g. edit a double
in the [0; 1] range.
gtk/gtkspinbutton.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index bae263878e..ce51cdb29d 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -994,9 +994,9 @@ static void
update_buttons_sensitivity (GtkSpinButton *spin_button)
{
GtkSpinButtonPrivate *priv = gtk_spin_button_get_instance_private (spin_button);
- int lower = gtk_adjustment_get_lower (priv->adjustment);
- int upper = gtk_adjustment_get_upper (priv->adjustment);
- int value = gtk_adjustment_get_value (priv->adjustment);
+ const double lower = gtk_adjustment_get_lower (priv->adjustment);
+ const double upper = gtk_adjustment_get_upper (priv->adjustment);
+ const double value = gtk_adjustment_get_value (priv->adjustment);
gtk_widget_set_sensitive (priv->up_button,
priv->wrap || upper - value > EPSILON);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]