mirror of
https://github.com/brl/mutter.git
synced 2024-12-25 20:32:16 +00:00
theme: Set object-name on style contexts
The default theme started to use them in GTK+ commit 371f50, so we need to update the style contexts to keep matching the style of client-side decorations. https://bugzilla.gnome.org/show_bug.cgi?id=757101
This commit is contained in:
parent
86a913d37a
commit
2750db2a89
@ -929,6 +929,7 @@ static GtkStyleContext *
|
||||
create_style_context (GType widget_type,
|
||||
GtkStyleContext *parent_style,
|
||||
GtkCssProvider *provider,
|
||||
const char *object_name,
|
||||
const char *first_class,
|
||||
...)
|
||||
{
|
||||
@ -948,6 +949,9 @@ create_style_context (GType widget_type,
|
||||
|
||||
gtk_widget_path_append_type (path, widget_type);
|
||||
|
||||
if (object_name)
|
||||
gtk_widget_path_iter_set_object_name (path, -1, object_name);
|
||||
|
||||
va_start (ap, first_class);
|
||||
for (name = first_class; name; name = va_arg (ap, const char *))
|
||||
gtk_widget_path_iter_add_class (path, -1, name);
|
||||
@ -987,6 +991,7 @@ meta_theme_create_style_info (GdkScreen *screen,
|
||||
create_style_context (META_TYPE_FRAMES,
|
||||
NULL,
|
||||
provider,
|
||||
"decoration",
|
||||
GTK_STYLE_CLASS_BACKGROUND,
|
||||
"window-frame",
|
||||
"ssd",
|
||||
@ -995,6 +1000,7 @@ meta_theme_create_style_info (GdkScreen *screen,
|
||||
create_style_context (GTK_TYPE_HEADER_BAR,
|
||||
style_info->styles[META_STYLE_ELEMENT_FRAME],
|
||||
provider,
|
||||
NULL,
|
||||
GTK_STYLE_CLASS_TITLEBAR,
|
||||
GTK_STYLE_CLASS_HORIZONTAL,
|
||||
"default-decoration",
|
||||
@ -1004,12 +1010,14 @@ meta_theme_create_style_info (GdkScreen *screen,
|
||||
create_style_context (GTK_TYPE_LABEL,
|
||||
style_info->styles[META_STYLE_ELEMENT_TITLEBAR],
|
||||
provider,
|
||||
NULL,
|
||||
GTK_STYLE_CLASS_TITLE,
|
||||
NULL);
|
||||
style_info->styles[META_STYLE_ELEMENT_BUTTON] =
|
||||
create_style_context (GTK_TYPE_BUTTON,
|
||||
style_info->styles[META_STYLE_ELEMENT_TITLEBAR],
|
||||
provider,
|
||||
NULL,
|
||||
GTK_STYLE_CLASS_BUTTON,
|
||||
"titlebutton",
|
||||
NULL);
|
||||
@ -1017,6 +1025,7 @@ meta_theme_create_style_info (GdkScreen *screen,
|
||||
create_style_context (GTK_TYPE_IMAGE,
|
||||
style_info->styles[META_STYLE_ELEMENT_BUTTON],
|
||||
provider,
|
||||
NULL,
|
||||
NULL);
|
||||
return style_info;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user