range: use border box for slider area
Since we can use negative margins, we should not use the margin box for the slider area. Use the border box instead, since that's what is typically mapped to the visible area.
This commit is contained in:
		@ -1279,7 +1279,7 @@ gtk_range_get_slider_range (GtkRange *range,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  priv = range->priv;
 | 
					  priv = range->priv;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  gtk_css_gadget_get_margin_box (priv->slider_gadget, &slider_alloc);
 | 
					  gtk_css_gadget_get_border_box (priv->slider_gadget, &slider_alloc);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (priv->orientation == GTK_ORIENTATION_VERTICAL)
 | 
					  if (priv->orientation == GTK_ORIENTATION_VERTICAL)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
@ -2469,7 +2469,7 @@ coord_to_value (GtkRange *range,
 | 
				
			|||||||
  gint    slider_length;
 | 
					  gint    slider_length;
 | 
				
			||||||
  GtkAllocation slider_alloc, trough_alloc;
 | 
					  GtkAllocation slider_alloc, trough_alloc;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  gtk_css_gadget_get_margin_box (priv->slider_gadget, &slider_alloc);
 | 
					  gtk_css_gadget_get_border_box (priv->slider_gadget, &slider_alloc);
 | 
				
			||||||
  gtk_css_gadget_get_content_box (priv->trough_gadget, &trough_alloc);
 | 
					  gtk_css_gadget_get_content_box (priv->trough_gadget, &trough_alloc);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (priv->orientation == GTK_ORIENTATION_VERTICAL)
 | 
					  if (priv->orientation == GTK_ORIENTATION_VERTICAL)
 | 
				
			||||||
@ -2512,7 +2512,7 @@ gtk_range_key_press (GtkWidget   *widget,
 | 
				
			|||||||
  device = gdk_event_get_device ((GdkEvent *) event);
 | 
					  device = gdk_event_get_device ((GdkEvent *) event);
 | 
				
			||||||
  device = gdk_device_get_associated_device (device);
 | 
					  device = gdk_device_get_associated_device (device);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  gtk_css_gadget_get_margin_box (priv->slider_gadget, &slider_alloc);
 | 
					  gtk_css_gadget_get_border_box (priv->slider_gadget, &slider_alloc);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (gtk_gesture_is_active (priv->drag_gesture) &&
 | 
					  if (gtk_gesture_is_active (priv->drag_gesture) &&
 | 
				
			||||||
      device == gtk_gesture_get_device (priv->drag_gesture) &&
 | 
					      device == gtk_gesture_get_device (priv->drag_gesture) &&
 | 
				
			||||||
@ -2549,7 +2549,7 @@ gtk_range_long_press_gesture_pressed (GtkGestureLongPress *gesture,
 | 
				
			|||||||
  GtkAllocation slider_alloc;
 | 
					  GtkAllocation slider_alloc;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  gtk_range_update_mouse_location (range);
 | 
					  gtk_range_update_mouse_location (range);
 | 
				
			||||||
  gtk_css_gadget_get_margin_box (priv->slider_gadget, &slider_alloc);
 | 
					  gtk_css_gadget_get_border_box (priv->slider_gadget, &slider_alloc);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (priv->mouse_location == MOUSE_SLIDER && !priv->zoom)
 | 
					  if (priv->mouse_location == MOUSE_SLIDER && !priv->zoom)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
@ -2603,7 +2603,7 @@ gtk_range_multipress_gesture_pressed (GtkGestureMultiPress *gesture,
 | 
				
			|||||||
  priv->mouse_y = y;
 | 
					  priv->mouse_y = y;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  gtk_range_update_mouse_location (range);
 | 
					  gtk_range_update_mouse_location (range);
 | 
				
			||||||
  gtk_css_gadget_get_margin_box (priv->slider_gadget, &slider_alloc);
 | 
					  gtk_css_gadget_get_border_box (priv->slider_gadget, &slider_alloc);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  g_object_get (gtk_widget_get_settings (widget),
 | 
					  g_object_get (gtk_widget_get_settings (widget),
 | 
				
			||||||
                "gtk-primary-button-warps-slider", &primary_warps,
 | 
					                "gtk-primary-button-warps-slider", &primary_warps,
 | 
				
			||||||
@ -2780,7 +2780,7 @@ update_slider_position (GtkRange *range,
 | 
				
			|||||||
  gint i;
 | 
					  gint i;
 | 
				
			||||||
  GtkAllocation slider_alloc, trough_alloc;
 | 
					  GtkAllocation slider_alloc, trough_alloc;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  gtk_css_gadget_get_margin_box (priv->slider_gadget, &slider_alloc);
 | 
					  gtk_css_gadget_get_border_box (priv->slider_gadget, &slider_alloc);
 | 
				
			||||||
  gtk_css_gadget_get_margin_box (priv->trough_gadget, &trough_alloc);
 | 
					  gtk_css_gadget_get_margin_box (priv->trough_gadget, &trough_alloc);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (priv->zoom)
 | 
					  if (priv->zoom)
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user