mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-19 18:00:09 +00:00
widget: Set .default class when widget is default
Don't just conditionally set it on buttons.
This commit is contained in:
parent
60eff87d08
commit
1d54e4e867
@ -1720,8 +1720,6 @@ _gtk_button_paint (GtkButton *button,
|
||||
y += default_border.top;
|
||||
width -= default_border.left + default_border.right;
|
||||
height -= default_border.top + default_border.bottom;
|
||||
|
||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_DEFAULT);
|
||||
}
|
||||
else if (gtk_widget_get_can_default (widget))
|
||||
{
|
||||
|
@ -6994,7 +6994,16 @@ void
|
||||
_gtk_widget_set_has_default (GtkWidget *widget,
|
||||
gboolean has_default)
|
||||
{
|
||||
GtkStyleContext *context;
|
||||
|
||||
widget->priv->has_default = has_default;
|
||||
|
||||
context = gtk_widget_get_style_context (widget);
|
||||
|
||||
if (has_default)
|
||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_DEFAULT);
|
||||
else
|
||||
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_DEFAULT);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user