theme: Update style context hierarchy (again)

GtkWindow actually uses two CSS nodes, 'window' and 'decoration'.
Simulate that by using two separate style contexts for the frame.
This commit is contained in:
Florian Müllner 2016-01-18 19:31:20 +01:00
parent 247909e161
commit a809055470
3 changed files with 13 additions and 3 deletions

View File

@ -1362,6 +1362,10 @@ meta_ui_frame_get_mask (MetaUIFrame *frame,
borders.invisible.left / scale,
borders.invisible.top / scale,
frame_rect.width / scale, frame_rect.height / scale);
gtk_render_background (frame->style_info->styles[META_STYLE_ELEMENT_TITLEBAR], cr,
borders.invisible.left / scale,
borders.invisible.top / scale,
frame_rect.width / scale, borders.total.top / scale);
}
/* XXX -- this is disgusting. Find a better approach here.

View File

@ -167,6 +167,7 @@ typedef enum
typedef enum
{
META_STYLE_ELEMENT_WINDOW,
META_STYLE_ELEMENT_FRAME,
META_STYLE_ELEMENT_TITLEBAR,
META_STYLE_ELEMENT_TITLE,

View File

@ -1033,15 +1033,20 @@ meta_theme_create_style_info (GdkScreen *screen,
style_info = g_new0 (MetaStyleInfo, 1);
style_info->refcount = 1;
style_info->styles[META_STYLE_ELEMENT_FRAME] =
style_info->styles[META_STYLE_ELEMENT_WINDOW] =
create_style_context (META_TYPE_FRAMES,
NULL,
provider,
"decoration",
"window",
GTK_STYLE_CLASS_BACKGROUND,
"window-frame",
"ssd",
NULL);
style_info->styles[META_STYLE_ELEMENT_FRAME] =
create_style_context (META_TYPE_FRAMES,
style_info->styles[META_STYLE_ELEMENT_WINDOW],
provider,
"decoration",
NULL);
style_info->styles[META_STYLE_ELEMENT_TITLEBAR] =
create_style_context (GTK_TYPE_HEADER_BAR,
style_info->styles[META_STYLE_ELEMENT_FRAME],