Allow defining an invisible resize area for GtkPaned's handle.

This should allow theme developers to use a very small width for
the resize handle, but still let users easily move the handle by
defining a wider resize area.

The additional resize area follows the "margin" style property.

https://bugzilla.gnome.org/show_bug.cgi?id=728073
This commit is contained in:
Victor Martinez 2014-04-11 20:50:48 -06:00 committed by Matthias Clasen
parent ee3d00c391
commit 75f90ee424

View File

@ -1277,24 +1277,30 @@ gtk_paned_size_allocate (GtkWidget *widget,
if (gtk_widget_get_realized (widget))
{
GtkBorder margin;
gtk_style_context_get_margin (gtk_widget_get_style_context (widget),
gtk_widget_get_state_flags (widget),
&margin);
if (gtk_widget_get_mapped (widget))
gdk_window_show (priv->handle);
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
{
gdk_window_move_resize (priv->handle,
priv->handle_pos.x,
priv->handle_pos.x - margin.left,
priv->handle_pos.y,
handle_size,
handle_size + margin.left + margin.right,
priv->handle_pos.height);
}
else
{
gdk_window_move_resize (priv->handle,
priv->handle_pos.x,
priv->handle_pos.y,
priv->handle_pos.y - margin.top,
priv->handle_pos.width,
handle_size);
handle_size + margin.top + margin.bottom);
}
}
@ -2842,4 +2848,4 @@ gtk_paned_get_handle_window (GtkPaned *paned)
g_return_val_if_fail (GTK_IS_PANED (paned), NULL);
return paned->priv->handle;
}
}