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:
parent
247909e161
commit
a809055470
@ -1362,6 +1362,10 @@ meta_ui_frame_get_mask (MetaUIFrame *frame,
|
|||||||
borders.invisible.left / scale,
|
borders.invisible.left / scale,
|
||||||
borders.invisible.top / scale,
|
borders.invisible.top / scale,
|
||||||
frame_rect.width / scale, frame_rect.height / 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.
|
/* XXX -- this is disgusting. Find a better approach here.
|
||||||
|
@ -167,6 +167,7 @@ typedef enum
|
|||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
META_STYLE_ELEMENT_WINDOW,
|
||||||
META_STYLE_ELEMENT_FRAME,
|
META_STYLE_ELEMENT_FRAME,
|
||||||
META_STYLE_ELEMENT_TITLEBAR,
|
META_STYLE_ELEMENT_TITLEBAR,
|
||||||
META_STYLE_ELEMENT_TITLE,
|
META_STYLE_ELEMENT_TITLE,
|
||||||
|
@ -1033,15 +1033,20 @@ meta_theme_create_style_info (GdkScreen *screen,
|
|||||||
style_info = g_new0 (MetaStyleInfo, 1);
|
style_info = g_new0 (MetaStyleInfo, 1);
|
||||||
style_info->refcount = 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,
|
create_style_context (META_TYPE_FRAMES,
|
||||||
NULL,
|
NULL,
|
||||||
provider,
|
provider,
|
||||||
"decoration",
|
"window",
|
||||||
GTK_STYLE_CLASS_BACKGROUND,
|
GTK_STYLE_CLASS_BACKGROUND,
|
||||||
"window-frame",
|
|
||||||
"ssd",
|
"ssd",
|
||||||
NULL);
|
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] =
|
style_info->styles[META_STYLE_ELEMENT_TITLEBAR] =
|
||||||
create_style_context (GTK_TYPE_HEADER_BAR,
|
create_style_context (GTK_TYPE_HEADER_BAR,
|
||||||
style_info->styles[META_STYLE_ELEMENT_FRAME],
|
style_info->styles[META_STYLE_ELEMENT_FRAME],
|
||||||
|
Loading…
Reference in New Issue
Block a user