summaryrefslogtreecommitdiff
path: root/gtk/gtkpaned.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2016-02-14 16:07:06 +0100
committerBenjamin Otte <otte@redhat.com>2016-02-14 16:07:06 +0100
commit88f0885638674295bb73171e0c852fc78662106a (patch)
tree9d594f816ec0dd8b0b3afed1485660a0ac14a672 /gtk/gtkpaned.c
parent7e47418d0cf93acc73a6ad2d274aa0ac45470d8c (diff)
downloadgtk+-88f0885638674295bb73171e0c852fc78662106a.tar.gz
paned: Use content allocation instead of widget allocation
We don't want to include padding and borders in our calculations involving the handle.
Diffstat (limited to 'gtk/gtkpaned.c')
-rw-r--r--gtk/gtkpaned.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index 33d5a07f5f..336b06af96 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -718,7 +718,7 @@ initiates_touch_drag (GtkPaned *paned,
GtkAllocation allocation;
#define TOUCH_EXTRA_AREA_WIDTH 50
- gtk_widget_get_allocation (GTK_WIDGET (paned), &allocation);
+ gtk_css_gadget_get_content_allocation (priv->gadget, &allocation, NULL);
gtk_css_gadget_get_preferred_size (priv->handle_gadget,
priv->orientation,
-1,
@@ -761,7 +761,7 @@ gesture_drag_begin_cb (GtkGestureDrag *gesture,
sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
event = gtk_gesture_get_last_event (GTK_GESTURE (gesture), sequence);
device = gdk_event_get_source_device (event);
- gtk_widget_get_allocation (GTK_WIDGET (paned), &allocation);
+ gtk_css_gadget_get_content_allocation (priv->gadget, &allocation, NULL);
paned->priv->panning = FALSE;
is_touch = (event->type == GDK_TOUCH_BEGIN ||
@@ -1626,7 +1626,7 @@ gtk_paned_create_child_window (GtkPaned *paned,
NULL, &handle_size,
NULL, NULL);
- gtk_widget_get_allocation (widget, &allocation);
+ gtk_css_gadget_get_content_allocation (priv->gadget, &allocation, NULL);
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL &&
child == priv->child2 && priv->child1 &&
gtk_widget_get_visible (priv->child1))
@@ -1963,14 +1963,13 @@ update_drag (GtkPaned *paned,
{
GtkPanedPrivate *priv = paned->priv;
GtkAllocation allocation;
- GtkWidget *widget = GTK_WIDGET (paned);
gint pos;
gint handle_size;
gint size;
gint x, y;
gdk_window_get_position (priv->handle, &x, &y);
- gtk_widget_get_allocation (widget, &allocation);
+ gtk_css_gadget_get_content_allocation (priv->gadget, &allocation, NULL);
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
pos = xpos;
else