[gtk+] range: don't trim the trough rectange by the trough margin
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] range: don't trim the trough rectange by the trough margin
- Date: Mon, 14 Jan 2013 15:20:50 +0000 (UTC)
commit aa77cd65017c191d2defc820f611dceb9734f20f
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Jan 14 10:09:10 2013 -0500
range: don't trim the trough rectange by the trough margin
Commit e32da246a84492f02b4dac5a448bb46cb23d68b8 made GtkRange's trough
respect the CSS margin property, but it also trimmed the box in which
the trough reacts to click events by the margin.
We still want to catch events in that area instead, and just make sure
the margin is applied when drawing (which was already implemented by
that commit).
This commit reverts the parts of
e32da246a84492f02b4dac5a448bb46cb23d68b8 that didn't involve drawing,
fixing the bug.
https://bugzilla.gnome.org/show_bug.cgi?id=691677
gtk/gtkrange.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index d18cf2b..775503a 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -3748,16 +3748,16 @@ gtk_range_calc_layout (GtkRange *range,
/* Now the trough is the remaining space between steppers B and C,
* if any, minus spacing
*/
- priv->trough.x = range_rect.x + trough_margin.left;
- priv->trough.y = priv->stepper_b.y + priv->stepper_b.height + stepper_spacing * has_steppers_ab + trough_margin.top;
- priv->trough.width = range_rect.width - trough_margin.left - trough_margin.right;
- priv->trough.height = priv->stepper_c.y - priv->trough.y - stepper_spacing * has_steppers_cd - trough_margin.bottom;
+ priv->trough.x = range_rect.x;
+ priv->trough.y = priv->stepper_b.y + priv->stepper_b.height + stepper_spacing * has_steppers_ab;
+ priv->trough.width = range_rect.width;
+ priv->trough.height = priv->stepper_c.y - priv->trough.y - stepper_spacing * has_steppers_cd;
/* Slider fits into the trough, with stepper_spacing on either side,
* and the size/position based on the adjustment or fixed, depending.
*/
- priv->slider.x = range_rect.x + focus_width + trough_border;
- priv->slider.width = range_rect.width - (focus_width + trough_border) * 2;
+ priv->slider.x = priv->trough.x + focus_width + trough_border;
+ priv->slider.width = priv->trough.width - (focus_width + trough_border) * 2;
/* Compute slider position/length */
{
@@ -3896,16 +3896,16 @@ gtk_range_calc_layout (GtkRange *range,
/* Now the trough is the remaining space between steppers B and C,
* if any
*/
- priv->trough.x = priv->stepper_b.x + priv->stepper_b.width + stepper_spacing * has_steppers_ab + trough_margin.left;
- priv->trough.y = range_rect.y + trough_margin.top;
- priv->trough.width = priv->stepper_c.x - priv->trough.x - stepper_spacing * has_steppers_cd - trough_margin.right;
- priv->trough.height = range_rect.height - trough_margin.top - trough_margin.bottom;
+ priv->trough.x = priv->stepper_b.x + priv->stepper_b.width + stepper_spacing * has_steppers_ab;
+ priv->trough.y = range_rect.y;
+ priv->trough.width = priv->stepper_c.x - priv->trough.x - stepper_spacing * has_steppers_cd;
+ priv->trough.height = range_rect.height;
/* Slider fits into the trough, with stepper_spacing on either side,
* and the size/position based on the adjustment or fixed, depending.
*/
- priv->slider.y = range_rect.y + focus_width + trough_border;
- priv->slider.height = range_rect.height - (focus_width + trough_border) * 2;
+ priv->slider.y = priv->trough.y + focus_width + trough_border;
+ priv->slider.height = priv->trough.height - (focus_width + trough_border) * 2;
/* Compute slider position/length */
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]