summaryrefslogtreecommitdiff
path: root/render/theme.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-05-31 15:40:41 +0000
committerDana Jansens <danakj@orodu.net>2007-05-31 15:40:41 +0000
commit5588c493355878e8243f889ec4225c02f044e822 (patch)
tree0280909357fdb1e5d80bfef8bda3e57306f2439b /render/theme.c
parent5e50b406d06147bfce746c24b5341321d55c4a3f (diff)
add an allow_fallback option when opening a theme
Diffstat (limited to 'render/theme.c')
-rw-r--r--render/theme.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/render/theme.c b/render/theme.c
index 08d4b07d..2b91e765 100644
--- a/render/theme.c
+++ b/render/theme.c
@@ -65,6 +65,7 @@ static gboolean find_appearance(ParseState *ps, xmlNodePtr n, const gchar *names
#define FIND(type, args...) find_##type(&ps, root, args)
RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
+ gboolean allow_fallback,
RrFont *active_window_font, RrFont *inactive_window_font,
RrFont *menu_title_font, RrFont *menu_item_font,
RrFont *osd_font)
@@ -85,12 +86,15 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
name = NULL;
}
}
- if (!name) {
+ if (name == NULL && allow_fallback) {
if (!parse_load_theme(DEFAULT_THEME, &ps.doc, &root, &ps.path)) {
g_message("Unable to load the theme '%s'", DEFAULT_THEME);
return NULL;
}
}
+ if (name == NULL)
+ return NULL;
+
ps.inst = inst;
theme = g_new0(RrTheme, 1);