Commit 2dda89cb authored by Lars Uebernickel's avatar Lars Uebernickel

GtkButtonBox: remove spacing when buttons are linked

GtkButtonBox adds the "linked" class to its style context when its
layout is set to GTK_BUTTONBOX_EXPAND. It shouldn't ever make sense to
have spacing between buttons in that case, as themes generally draw
linked elements with a continuous border.

Thus, always set spacing to 0 and ignore GtkDialog's button-spacing
style property when the layout is set to EXPAND.

Also remove the now-redundant css rules which set button-spacing to 0
for message dialogs.

https://bugzilla.gnome.org/show_bug.cgi?id=752131
parent 0f479deb
......@@ -359,6 +359,7 @@ gtk_button_box_set_layout (GtkButtonBox *widget,
if (priv->layout_style == GTK_BUTTONBOX_EXPAND)
{
gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (widget)), "linked");
gtk_box_set_spacing (GTK_BOX (widget), 0);
gtk_box_set_homogeneous (GTK_BOX (widget), TRUE);
}
else
......
......@@ -81,7 +81,10 @@ struct _GtkButtonBoxClass
* @GTK_BUTTONBOX_END: Buttons are grouped towards the end of the box,
* (on the right for a HBox, or the bottom for a VBox).
* @GTK_BUTTONBOX_CENTER: Buttons are centered in the box. Since 2.12.
* @GTK_BUTTONBOX_EXPAND: Buttons expand to fill the box. Since 3.12.
* @GTK_BUTTONBOX_EXPAND: Buttons expand to fill the box. This entails giving
* buttons a "linked" appearance, making button sizes homogeneous, and
* setting spacing to 0 (same as calling gtk_box_set_homogeneous() and
* gtk_box_set_spacing() manually). Since 3.12.
*
* Used to dictate the style that a #GtkButtonBox uses to layout the buttons it
* contains.
......
......@@ -696,8 +696,9 @@ update_spacings (GtkDialog *dialog)
_gtk_box_set_spacing_set (GTK_BOX (priv->vbox), FALSE);
}
gtk_box_set_spacing (GTK_BOX (priv->action_area),
button_spacing);
/* don't set spacing when buttons are linked */
if (gtk_button_box_get_layout (GTK_BUTTON_BOX (priv->action_area)) != GTK_BUTTONBOX_EXPAND)
gtk_box_set_spacing (GTK_BOX (priv->action_area), button_spacing);
if (!_gtk_container_get_border_width_set (GTK_CONTAINER (priv->action_area)))
{
......
......@@ -2761,8 +2761,6 @@ GtkCalendar {
}
.message-dialog { // Message Dialog styling
-GtkDialog-button-spacing: 0;
@if $variant==light {
// the bright variant as a slightly darker bg which in this case clashes with the window decoration, overriding
&.background { background-color: $bg_color; }
......
......@@ -1998,7 +1998,6 @@ GtkCalendar {
}
.message-dialog { // Message Dialog styling
-GtkDialog-button-spacing: 0;
.titlebar {
border-style: none;
box-shadow: inset 0 1px $borders_edge;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment