/* load the theme specified in the rc file */
{
RrTheme *theme;
- if ((theme = RrThemeNew(ob_rr_inst, config_theme,
+ if ((theme = RrThemeNew(ob_rr_inst, config_theme, TRUE,
config_font_activewindow,
config_font_inactivewindow,
config_font_menutitle,
static void set_default_appearance(RrAppearance *a);
RrTheme* RrThemeNew(const RrInstance *inst, gchar *name,
+ gboolean allow_fallback,
RrFont *active_window_font, RrFont *inactive_window_font,
RrFont *menu_title_font, RrFont *menu_item_font,
RrFont *osd_font)
db = loaddb(name, &path);
if (db == NULL) {
g_message("Unable to load the theme '%s'", name);
- g_message("Falling back to the default theme '%s'",
- DEFAULT_THEME);
+ if (allow_fallback)
+ g_message("Falling back to the default theme '%s'",
+ DEFAULT_THEME);
/* fallback to the default theme */
name = NULL;
}
}
- if (db == NULL) {
+ if (name == NULL && allow_fallback) {
db = loaddb(DEFAULT_THEME, &path);
if (db == NULL) {
g_message("Unable to load the theme '%s'", DEFAULT_THEME);
return NULL;
}
}
+ if (name == NULL)
+ return NULL;
theme = g_new0(RrTheme, 1);
/*! The font values are all optional. If a NULL is used for any of them, then
the default font will be used. */
RrTheme* RrThemeNew(const RrInstance *inst, gchar *theme,
+ gboolean allow_fallback,
RrFont *active_window_font, RrFont *inactive_window_font,
RrFont *menu_title_font, RrFont *menu_item_font,
RrFont *osd_font);