[mutter/wip/cb2eb3: 25/55] theme: Split GtkStateFlags grabbing code out
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/cb2eb3: 25/55] theme: Split GtkStateFlags grabbing code out
- Date: Wed, 1 Oct 2014 15:49:32 +0000 (UTC)
commit 2da1ed1ae0bbef9cba81310f85c3b0e81ff92d01
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Fri Apr 27 02:42:58 2012 -0400
theme: Split GtkStateFlags grabbing code out
src/ui/theme.c | 21 ++++++++++++++-------
1 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 2f5ee86..ac417c7 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]