forked from AuroraMiddleware/gtk
widget: Remove gtk_widget_get_margin_allocation
It's not needed anymore with get_outer_allocation (which will be replaced by something more appropriately named).
This commit is contained in:
parent
c3aacbecdf
commit
9c7e089fc2
@ -2310,7 +2310,7 @@ gtk_notebook_gesture_pressed (GtkGestureMultiPress *gesture,
|
||||
priv->drag_begin_x = priv->mouse_x;
|
||||
priv->drag_begin_y = priv->mouse_y;
|
||||
|
||||
gtk_widget_get_margin_allocation (page->tab_widget, &allocation);
|
||||
gtk_widget_get_outer_allocation (page->tab_widget, &allocation);
|
||||
|
||||
priv->drag_offset_x = priv->drag_begin_x - allocation.x;
|
||||
priv->drag_offset_y = priv->drag_begin_y - allocation.y;
|
||||
|
@ -954,7 +954,7 @@ gtk_range_get_slider_range (GtkRange *range,
|
||||
|
||||
priv = range->priv;
|
||||
|
||||
gtk_widget_get_margin_allocation (priv->slider_widget, &slider_alloc);
|
||||
gtk_widget_get_outer_allocation (priv->slider_widget, &slider_alloc);
|
||||
|
||||
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
||||
{
|
||||
@ -1831,7 +1831,7 @@ coord_to_value (GtkRange *range,
|
||||
gint slider_length;
|
||||
GtkAllocation slider_alloc, trough_alloc;
|
||||
|
||||
gtk_widget_get_margin_allocation (priv->slider_widget, &slider_alloc);
|
||||
gtk_widget_get_outer_allocation (priv->slider_widget, &slider_alloc);
|
||||
gtk_widget_get_content_allocation (priv->trough_widget, &trough_alloc);
|
||||
|
||||
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
||||
@ -1888,7 +1888,7 @@ gtk_range_key_press (GtkWidget *widget,
|
||||
{
|
||||
GtkAllocation slider_alloc;
|
||||
|
||||
gtk_widget_get_margin_allocation (priv->slider_widget, &slider_alloc);
|
||||
gtk_widget_get_outer_allocation (priv->slider_widget, &slider_alloc);
|
||||
|
||||
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
||||
priv->slide_initial_slider_position = slider_alloc.y;
|
||||
@ -1936,7 +1936,7 @@ gtk_range_long_press_gesture_pressed (GtkGestureLongPress *gesture,
|
||||
{
|
||||
GtkAllocation slider_alloc;
|
||||
|
||||
gtk_widget_get_margin_allocation (priv->slider_widget, &slider_alloc);
|
||||
gtk_widget_get_outer_allocation (priv->slider_widget, &slider_alloc);
|
||||
update_initial_slider_position (range, x, y, &slider_alloc);
|
||||
update_zoom_state (range, TRUE);
|
||||
}
|
||||
@ -1977,7 +1977,7 @@ gtk_range_multipress_gesture_pressed (GtkGestureMultiPress *gesture,
|
||||
priv->mouse_y = y;
|
||||
|
||||
gtk_range_update_mouse_location (range);
|
||||
gtk_widget_get_margin_allocation (priv->slider_widget, &slider_alloc);
|
||||
gtk_widget_get_outer_allocation (priv->slider_widget, &slider_alloc);
|
||||
|
||||
g_object_get (gtk_widget_get_settings (widget),
|
||||
"gtk-primary-button-warps-slider", &primary_warps,
|
||||
@ -2116,7 +2116,7 @@ update_slider_position (GtkRange *range,
|
||||
{
|
||||
GtkAllocation trough_alloc;
|
||||
|
||||
gtk_widget_get_margin_allocation (priv->trough_widget, &trough_alloc);
|
||||
gtk_widget_get_outer_allocation (priv->trough_widget, &trough_alloc);
|
||||
|
||||
zoom = MIN(1.0, (priv->orientation == GTK_ORIENTATION_VERTICAL ?
|
||||
trough_alloc.height : trough_alloc.width) /
|
||||
@ -2135,7 +2135,7 @@ update_slider_position (GtkRange *range,
|
||||
{
|
||||
GtkAllocation slider_alloc;
|
||||
|
||||
gtk_widget_get_margin_allocation (priv->slider_widget, &slider_alloc);
|
||||
gtk_widget_get_outer_allocation (priv->slider_widget, &slider_alloc);
|
||||
|
||||
if (priv->orientation == GTK_ORIENTATION_VERTICAL)
|
||||
priv->slide_initial_slider_position = (zoom * (mouse_y - priv->slide_initial_coordinate_delta) - slider_alloc.y) / (zoom - 1.0);
|
||||
|
@ -948,7 +948,7 @@ gtk_widget_real_pick (GtkWidget *widget,
|
||||
!gtk_widget_is_drawable (child))
|
||||
continue;
|
||||
|
||||
gtk_widget_get_margin_allocation (child, &allocation);
|
||||
gtk_widget_get_outer_allocation (child, &allocation);
|
||||
|
||||
if (gdk_rectangle_contains_point (&allocation, tx, ty))
|
||||
{
|
||||
@ -13283,26 +13283,6 @@ gtk_widget_get_border_allocation (GtkWidget *widget,
|
||||
margin.bottom + border.bottom;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_widget_get_margin_allocation (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
{
|
||||
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
|
||||
GtkBorder margin, border;
|
||||
GtkCssStyle *style;
|
||||
|
||||
style = gtk_css_node_get_style (priv->cssnode);
|
||||
get_box_margin (style, &margin);
|
||||
get_box_border (style, &border);
|
||||
|
||||
*allocation = priv->allocation;
|
||||
|
||||
allocation->x += margin.left;
|
||||
allocation->y += margin.top;
|
||||
allocation->width -= margin.left + margin.right;
|
||||
allocation->height -= margin.top + margin.bottom;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_widget_get_allocated_width:
|
||||
* @widget: the widget to query
|
||||
|
@ -318,8 +318,6 @@ void gtk_widget_get_content_allocation (GtkWidget *wi
|
||||
GtkAllocation *allocation);
|
||||
void gtk_widget_get_border_allocation (GtkWidget *widget,
|
||||
GtkAllocation *allocation);
|
||||
void gtk_widget_get_margin_allocation (GtkWidget *widget,
|
||||
GtkAllocation *allocation);
|
||||
void gtk_widget_get_outer_allocation (GtkWidget *widget,
|
||||
GtkAllocation *allocation);
|
||||
void gtk_widget_get_own_allocation (GtkWidget *widget,
|
||||
|
Loading…
Reference in New Issue
Block a user