mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-06 00:30:08 +00:00
remember the sensitivity of the steppers in GtkRangeLayout, update it in
2006-07-18 Michael Natterer <mitch@imendio.com> * gtk/gtkrange.c: remember the sensitivity of the steppers in GtkRangeLayout, update it in gtk_range_calc_layout() and check for changes in layout_changed(), so adjustment changes that leave the slider position unchanged are still able to update the steppers' sensitivity. Fixes bug #347902.
This commit is contained in:
parent
66180232be
commit
73e3187138
@ -1,3 +1,11 @@
|
|||||||
|
2006-07-18 Michael Natterer <mitch@imendio.com>
|
||||||
|
|
||||||
|
* gtk/gtkrange.c: remember the sensitivity of the steppers in
|
||||||
|
GtkRangeLayout, update it in gtk_range_calc_layout() and check for
|
||||||
|
changes in layout_changed(), so adjustment changes that leave the
|
||||||
|
slider position unchanged are still able to update the steppers'
|
||||||
|
sensitivity. Fixes bug #347902.
|
||||||
|
|
||||||
2006-07-18 Kristian Rietveld <kris@imendio.com>
|
2006-07-18 Kristian Rietveld <kris@imendio.com>
|
||||||
|
|
||||||
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_start_editing):
|
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_start_editing):
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
2006-07-18 Michael Natterer <mitch@imendio.com>
|
||||||
|
|
||||||
|
* gtk/gtkrange.c: remember the sensitivity of the steppers in
|
||||||
|
GtkRangeLayout, update it in gtk_range_calc_layout() and check for
|
||||||
|
changes in layout_changed(), so adjustment changes that leave the
|
||||||
|
slider position unchanged are still able to update the steppers'
|
||||||
|
sensitivity. Fixes bug #347902.
|
||||||
|
|
||||||
2006-07-18 Kristian Rietveld <kris@imendio.com>
|
2006-07-18 Kristian Rietveld <kris@imendio.com>
|
||||||
|
|
||||||
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_start_editing):
|
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_start_editing):
|
||||||
|
@ -88,11 +88,15 @@ struct _GtkRangeLayout
|
|||||||
/* last mouse coords we got, or -1 if mouse is outside the range */
|
/* last mouse coords we got, or -1 if mouse is outside the range */
|
||||||
gint mouse_x;
|
gint mouse_x;
|
||||||
gint mouse_y;
|
gint mouse_y;
|
||||||
|
|
||||||
/* "grabbed" mouse location, OUTSIDE for no grab */
|
/* "grabbed" mouse location, OUTSIDE for no grab */
|
||||||
MouseLocation grab_location;
|
MouseLocation grab_location;
|
||||||
gint grab_button; /* 0 if none */
|
guint grab_button : 8; /* 0 if none */
|
||||||
|
|
||||||
/* Stepper sensitivity */
|
/* Stepper sensitivity */
|
||||||
|
guint lower_sensitive : 1;
|
||||||
|
guint upper_sensitive : 1;
|
||||||
|
|
||||||
GtkSensitivityType lower_sensitivity;
|
GtkSensitivityType lower_sensitivity;
|
||||||
GtkSensitivityType upper_sensitivity;
|
GtkSensitivityType upper_sensitivity;
|
||||||
};
|
};
|
||||||
@ -532,6 +536,8 @@ gtk_range_init (GtkRange *range)
|
|||||||
range->layout->grab_button = 0;
|
range->layout->grab_button = 0;
|
||||||
range->layout->lower_sensitivity = GTK_SENSITIVITY_AUTO;
|
range->layout->lower_sensitivity = GTK_SENSITIVITY_AUTO;
|
||||||
range->layout->upper_sensitivity = GTK_SENSITIVITY_AUTO;
|
range->layout->upper_sensitivity = GTK_SENSITIVITY_AUTO;
|
||||||
|
range->layout->lower_sensitive = TRUE;
|
||||||
|
range->layout->upper_sensitive = TRUE;
|
||||||
range->timer = NULL;
|
range->timer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -716,7 +722,11 @@ gtk_range_set_lower_stepper_sensitivity (GtkRange *range,
|
|||||||
if (range->layout->lower_sensitivity != sensitivity)
|
if (range->layout->lower_sensitivity != sensitivity)
|
||||||
{
|
{
|
||||||
range->layout->lower_sensitivity = sensitivity;
|
range->layout->lower_sensitivity = sensitivity;
|
||||||
|
|
||||||
|
range->need_recalc = TRUE;
|
||||||
|
gtk_range_calc_layout (range, range->adjustment->value);
|
||||||
gtk_widget_queue_draw (GTK_WIDGET (range));
|
gtk_widget_queue_draw (GTK_WIDGET (range));
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (range), "lower-stepper-sensitivity");
|
g_object_notify (G_OBJECT (range), "lower-stepper-sensitivity");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -759,7 +769,11 @@ gtk_range_set_upper_stepper_sensitivity (GtkRange *range,
|
|||||||
if (range->layout->upper_sensitivity != sensitivity)
|
if (range->layout->upper_sensitivity != sensitivity)
|
||||||
{
|
{
|
||||||
range->layout->upper_sensitivity = sensitivity;
|
range->layout->upper_sensitivity = sensitivity;
|
||||||
|
|
||||||
|
range->need_recalc = TRUE;
|
||||||
|
gtk_range_calc_layout (range, range->adjustment->value);
|
||||||
gtk_widget_queue_draw (GTK_WIDGET (range));
|
gtk_widget_queue_draw (GTK_WIDGET (range));
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (range), "upper-stepper-sensitivity");
|
g_object_notify (G_OBJECT (range), "upper-stepper-sensitivity");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1079,40 +1093,11 @@ draw_stepper (GtkRange *range,
|
|||||||
(range->inverted && (arrow_type == GTK_ARROW_UP ||
|
(range->inverted && (arrow_type == GTK_ARROW_UP ||
|
||||||
arrow_type == GTK_ARROW_LEFT)))
|
arrow_type == GTK_ARROW_LEFT)))
|
||||||
{
|
{
|
||||||
switch (range->layout->upper_sensitivity)
|
arrow_sensitive = range->layout->upper_sensitive;
|
||||||
{
|
|
||||||
case GTK_SENSITIVITY_AUTO:
|
|
||||||
arrow_sensitive =
|
|
||||||
(range->adjustment->value <
|
|
||||||
(range->adjustment->upper - range->adjustment->page_size));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GTK_SENSITIVITY_ON:
|
|
||||||
arrow_sensitive = TRUE;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GTK_SENSITIVITY_OFF:
|
|
||||||
arrow_sensitive = FALSE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
switch (range->layout->lower_sensitivity)
|
arrow_sensitive = range->layout->lower_sensitive;
|
||||||
{
|
|
||||||
case GTK_SENSITIVITY_AUTO:
|
|
||||||
arrow_sensitive =
|
|
||||||
(range->adjustment->value > range->adjustment->lower);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GTK_SENSITIVITY_ON:
|
|
||||||
arrow_sensitive = TRUE;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GTK_SENSITIVITY_OFF:
|
|
||||||
arrow_sensitive = FALSE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!GTK_WIDGET_IS_SENSITIVE (range) || !arrow_sensitive)
|
if (!GTK_WIDGET_IS_SENSITIVE (range) || !arrow_sensitive)
|
||||||
@ -1947,6 +1932,9 @@ layout_changed (GtkRangeLayout *layout1,
|
|||||||
check_rectangle (layout1->stepper_b, layout2->stepper_b);
|
check_rectangle (layout1->stepper_b, layout2->stepper_b);
|
||||||
check_rectangle (layout1->stepper_c, layout2->stepper_c);
|
check_rectangle (layout1->stepper_c, layout2->stepper_c);
|
||||||
|
|
||||||
|
if (layout1->upper_sensitive != layout2->upper_sensitive) return TRUE;
|
||||||
|
if (layout1->lower_sensitive != layout2->lower_sensitive) return TRUE;
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2843,6 +2831,39 @@ gtk_range_calc_layout (GtkRange *range,
|
|||||||
}
|
}
|
||||||
|
|
||||||
gtk_range_update_mouse_location (range);
|
gtk_range_update_mouse_location (range);
|
||||||
|
|
||||||
|
switch (range->layout->upper_sensitivity)
|
||||||
|
{
|
||||||
|
case GTK_SENSITIVITY_AUTO:
|
||||||
|
range->layout->upper_sensitive =
|
||||||
|
(range->adjustment->value <
|
||||||
|
(range->adjustment->upper - range->adjustment->page_size));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GTK_SENSITIVITY_ON:
|
||||||
|
range->layout->upper_sensitive = TRUE;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GTK_SENSITIVITY_OFF:
|
||||||
|
range->layout->upper_sensitive = FALSE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (range->layout->lower_sensitivity)
|
||||||
|
{
|
||||||
|
case GTK_SENSITIVITY_AUTO:
|
||||||
|
range->layout->lower_sensitive =
|
||||||
|
(range->adjustment->value > range->adjustment->lower);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GTK_SENSITIVITY_ON:
|
||||||
|
range->layout->lower_sensitive = TRUE;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GTK_SENSITIVITY_OFF:
|
||||||
|
range->layout->lower_sensitive = FALSE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static GdkRectangle*
|
static GdkRectangle*
|
||||||
|
Loading…
Reference in New Issue
Block a user