diff options
author | Stefano Karapetsas <[email protected]> | 2014-01-24 11:30:43 +0100 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2014-01-24 11:30:43 +0100 |
commit | e34bef124252b86e118019b78e2abbb8abfe0540 (patch) | |
tree | 67ab63dd22903d1a0d625e0a40e0f30c39061004 /src/ui/theme.c | |
parent | e7548428cd64022b6b1c39265e0a6fa63a7f78d8 (diff) | |
download | marco-e34bef124252b86e118019b78e2abbb8abfe0540.tar.bz2 marco-e34bef124252b86e118019b78e2abbb8abfe0540.tar.xz |
ui: Improve GTK3 support
Diffstat (limited to 'src/ui/theme.c')
-rw-r--r-- | src/ui/theme.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/src/ui/theme.c b/src/ui/theme.c index 655c63f3..589c68e5 100644 --- a/src/ui/theme.c +++ b/src/ui/theme.c @@ -3387,6 +3387,31 @@ fill_env (MetaPositionExprEnv *env, env->theme = meta_current_theme; } +#if GTK_CHECK_VERSION (3, 0, 0) +static GtkStateFlags +state_flags_from_gtk_state (GtkStateType state) +{ + switch (state) + { + case GTK_STATE_NORMAL: + return 0; + case GTK_STATE_PRELIGHT: + return GTK_STATE_FLAG_PRELIGHT; + case GTK_STATE_ACTIVE: + return GTK_STATE_FLAG_ACTIVE; + case GTK_STATE_SELECTED: + return GTK_STATE_FLAG_SELECTED; + case GTK_STATE_INSENSITIVE: + return GTK_STATE_FLAG_INSENSITIVE; + case GTK_STATE_INCONSISTENT: + return GTK_STATE_FLAG_INCONSISTENT; + case GTK_STATE_FOCUSED: + return GTK_STATE_FLAG_FOCUSED; + } + return 0; +} +#endif + /* This code was originally rendering anti-aliased using X primitives, and * now has been switched to draw anti-aliased using cairo. In general, the * closest correspondence between X rendering and cairo rendering is given @@ -4728,13 +4753,10 @@ meta_frame_style_draw_with_style (MetaFrameStyle *style, j = 0; while (j < META_BUTTON_TYPE_LAST) { - MetaButtonState button_state; button_rect (j, fgeom, middle_bg_offset, &rect); - - button_state = map_button_state (j, fgeom, middle_bg_offset, button_states); - op_list = get_button (style, j, button_state); + op_list = get_button (style, j, button_states[j]); if (op_list) { |