diff options
author | Owen W. Taylor <[email protected]> | 2014-09-27 17:06:36 +0300 |
---|---|---|
committer | Victor Kareh <[email protected]> | 2018-08-28 09:38:37 -0400 |
commit | c9c3f858e28edf0856a263941007401923adbabd (patch) | |
tree | 702b2c5d7a41d8ea9b72ef5d2c11ad8116bab136 /src/ui/theme.c | |
parent | 37fecf49392eb10ada1f4bf481d6ad6be56891dd (diff) | |
download | marco-c9c3f858e28edf0856a263941007401923adbabd.tar.bz2 marco-c9c3f858e28edf0856a263941007401923adbabd.tar.xz |
Add frame type for attached modal dialogs
Add a new frame type META_FRAME_TYPE_ATTACHED which is used for
attached modal dialogs.
The theme format version is bumped to 3.2, and attached windows
can have borders defined in a metacity-theme-3.xml as:
<window version=">= 3.2" type="attached" style_set="[name]"/>
If no style is defined for "attached", drawing will fall back
to the "border" type.
https://bugzilla.gnome.org/show_bug.cgi?id=592382
NOTE: Patch copied from mutter and adapted for metacity.
Diffstat (limited to 'src/ui/theme.c')
-rw-r--r-- | src/ui/theme.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ui/theme.c b/src/ui/theme.c index 4385b7c6..667e60ff 100644 --- a/src/ui/theme.c +++ b/src/ui/theme.c @@ -5193,7 +5193,7 @@ meta_theme_validate (MetaTheme *theme, } for (i = 0; i < (int)META_FRAME_TYPE_LAST; i++) - if (theme->style_sets_by_type[i] == NULL) + if (i != (int)META_FRAME_TYPE_ATTACHED && theme->style_sets_by_type[i] == NULL) { g_set_error (error, META_THEME_ERROR, META_THEME_ERROR_FAILED, _("No frame style set for window type \"%s\" in theme \"%s\", add a <window type=\"%s\" style_set=\"whatever\"/> element"), @@ -5271,7 +5271,10 @@ theme_get_style (MetaTheme *theme, style_set = theme->style_sets_by_type[type]; - /* Right now the parser forces a style set for all types, + if (style_set == NULL && type == META_FRAME_TYPE_ATTACHED) + style_set = theme->style_sets_by_type[META_FRAME_TYPE_BORDER]; + + /* Right now the parser forces a style set for all other types, * but this fallback code is here in case I take that out. */ if (style_set == NULL) @@ -6229,6 +6232,8 @@ meta_frame_type_from_string (const char *str) return META_FRAME_TYPE_MENU; else if (strcmp ("border", str) == 0) return META_FRAME_TYPE_BORDER; + else if (strcmp ("attached", str) == 0) + return META_FRAME_TYPE_ATTACHED; #if 0 else if (strcmp ("toolbar", str) == 0) return META_FRAME_TYPE_TOOLBAR; @@ -6254,6 +6259,8 @@ meta_frame_type_to_string (MetaFrameType type) return "menu"; case META_FRAME_TYPE_BORDER: return "border"; + case META_FRAME_TYPE_ATTACHED: + return "attached"; #if 0 case META_FRAME_TYPE_TOOLBAR: return "toolbar"; |