mirror of
https://github.com/brl/mutter.git
synced 2025-02-16 13:24:09 +00:00
theme: Split GtkStateFlags grabbing code out
This commit is contained in:
parent
58f04c7284
commit
2da1ed1ae0
@ -298,6 +298,19 @@ meta_frame_layout_unref (MetaFrameLayout *layout)
|
||||
}
|
||||
}
|
||||
|
||||
static GtkStateFlags
|
||||
get_style_flags (MetaFrameFlags flags)
|
||||
{
|
||||
GtkStateFlags gtk_flags;
|
||||
|
||||
gtk_flags = GTK_STATE_FLAG_NORMAL;
|
||||
|
||||
if ((flags & META_FRAME_HAS_FOCUS) == 0)
|
||||
gtk_flags |= GTK_STATE_FLAG_BACKDROP;
|
||||
|
||||
return gtk_flags;
|
||||
}
|
||||
|
||||
void
|
||||
meta_frame_layout_get_borders (const MetaFrameLayout *layout,
|
||||
int text_height,
|
||||
@ -4118,7 +4131,6 @@ meta_frame_style_draw_with_style (MetaFrameStyle *style,
|
||||
GdkPixbuf *mini_icon,
|
||||
GdkPixbuf *icon)
|
||||
{
|
||||
GtkStateFlags gtk_flags;
|
||||
GdkRectangle visible_rect;
|
||||
const MetaFrameBorders *borders;
|
||||
|
||||
@ -4129,14 +4141,9 @@ meta_frame_style_draw_with_style (MetaFrameStyle *style,
|
||||
visible_rect.width = fgeom->width - borders->invisible.left - borders->invisible.right;
|
||||
visible_rect.height = fgeom->height - borders->invisible.top - borders->invisible.bottom;
|
||||
|
||||
gtk_flags = GTK_STATE_FLAG_NORMAL;
|
||||
|
||||
if ((flags & META_FRAME_HAS_FOCUS) == 0)
|
||||
gtk_flags |= GTK_STATE_FLAG_BACKDROP;
|
||||
|
||||
gtk_style_context_save (style_gtk);
|
||||
|
||||
gtk_style_context_set_state (style_gtk, gtk_flags);
|
||||
gtk_style_context_set_state (style_gtk, get_style_flags (flags));
|
||||
|
||||
gtk_render_background (style_gtk, cr,
|
||||
visible_rect.x,
|
||||
|
Loading…
x
Reference in New Issue
Block a user