paned: Allocate the handle input area properly

Drop the margin misuse and use the border allocation of the
handle gadget. We use negative margins to make the border allocation
larger without pushing the paned children out.
This commit is contained in:
Matthias Clasen 2015-12-15 21:06:53 -05:00
parent b14dc6b5a4
commit 152326bd24
4 changed files with 66 additions and 72 deletions

View File

@ -1498,32 +1498,15 @@ gtk_paned_allocate (GtkCssGadget *gadget,
if (gtk_widget_get_realized (widget))
{
GtkBorder margin;
GtkStyleContext *context = gtk_widget_get_style_context (widget);
gtk_style_context_get_margin (context,
gtk_style_context_get_state (context),
&margin);
GtkAllocation border_alloc;
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 - margin.left,
priv->handle_pos.y,
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 - margin.top,
priv->handle_pos.width,
handle_size + margin.top + margin.bottom);
}
gtk_css_gadget_get_border_allocation (priv->handle_gadget, &border_alloc, NULL);
gdk_window_move_resize (priv->handle,
border_alloc.x, border_alloc.y,
border_alloc.width, border_alloc.height);
}
/* Now allocate the childen, making sure, when resizing not to

View File

@ -2948,14 +2948,7 @@ placesview {
* Paned *
*********/
paned { // this is for the standard paned separator
-gtk-icon-source: none; // removes handle decoration
margin: 0 8px 8px 0; // drag area of the separator, not a real margin
&:dir(rtl) {
margin-right: 0;
margin-left: 8px;
}
paned {
separator {
min-width: 1px;
min-height: 1px;
@ -2964,6 +2957,18 @@ paned { // this is for the standard paned separator
background-color: $backdrop_borders_color;
}
}
&:dir(ltr).horizontal separator {
margin: 0 -8px 0 0;
padding: 0 8px 0 0;
}
&:dir(rtl).horizontal separator {
margin: 0 0 0 -8px;
padding: 0 0 0 8px;
}
&.vertical separator {
margin: 0 0 -8px 0;
padding: 0 0 8px 0;
}
separator:selected {
background-color: $selected_bg_color;
}

View File

@ -4111,27 +4111,30 @@ placesview row.activatable:hover {
/*********
* Paned *
*********/
paned {
-gtk-icon-source: none;
margin: 0 8px 8px 0; }
paned:dir(rtl) {
margin-right: 0;
margin-left: 8px; }
paned separator {
min-width: 1px;
min-height: 1px;
background-color: #1c1f1f; }
paned separator:backdrop {
background-color: #1f2222; }
paned separator:selected {
background-color: #215d9c; }
paned separator.wide {
min-width: 5px;
min-height: 5px;
background-color: transparent;
border-style: none solid;
border-color: #1c1f1f;
border-width: 1px; }
paned separator {
min-width: 1px;
min-height: 1px;
background-color: #1c1f1f; }
paned separator:backdrop {
background-color: #1f2222; }
paned:dir(ltr).horizontal separator {
margin: 0 -8px 0 0;
padding: 0 8px 0 0; }
paned:dir(rtl).horizontal separator {
margin: 0 0 0 -8px;
padding: 0 0 0 8px; }
paned.vertical separator {
margin: 0 0 -8px 0;
padding: 0 0 8px 0; }
paned separator:selected {
background-color: #215d9c; }
paned separator.wide {
min-width: 5px;
min-height: 5px;
background-color: transparent;
border-style: none solid;
border-color: #1c1f1f;
border-width: 1px; }
/**************
* GtkInfoBar *

View File

@ -4283,27 +4283,30 @@ placesview row.activatable:hover {
/*********
* Paned *
*********/
paned {
-gtk-icon-source: none;
margin: 0 8px 8px 0; }
paned:dir(rtl) {
margin-right: 0;
margin-left: 8px; }
paned separator {
min-width: 1px;
min-height: 1px;
background-color: #9d9d99; }
paned separator:backdrop {
background-color: #a5a5a1; }
paned separator:selected {
background-color: #4a90d9; }
paned separator.wide {
min-width: 5px;
min-height: 5px;
background-color: transparent;
border-style: none solid;
border-color: #9d9d99;
border-width: 1px; }
paned separator {
min-width: 1px;
min-height: 1px;
background-color: #9d9d99; }
paned separator:backdrop {
background-color: #a5a5a1; }
paned:dir(ltr).horizontal separator {
margin: 0 -8px 0 0;
padding: 0 8px 0 0; }
paned:dir(rtl).horizontal separator {
margin: 0 0 0 -8px;
padding: 0 0 0 8px; }
paned.vertical separator {
margin: 0 0 -8px 0;
padding: 0 0 8px 0; }
paned separator:selected {
background-color: #4a90d9; }
paned separator.wide {
min-width: 5px;
min-height: 5px;
background-color: transparent;
border-style: none solid;
border-color: #9d9d99;
border-width: 1px; }
/**************
* GtkInfoBar *