mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-01 08:20:36 +00:00
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:
parent
ee3d00c391
commit
75f90ee424
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user