Add a built-in, hidden display theme for the preview images

It contains only the Sun, with no aspects nor antiscia
This commit is contained in:
Gergely Polonkai 2014-09-27 22:44:21 +02:00
parent 02fcb0ad93
commit 6656f52959
2 changed files with 28 additions and 0 deletions

View File

@ -35,6 +35,8 @@ static gchar *builtin_theme_name[AG_DISPLAY_THEME_COUNT] = {
NC_("Display theme name", "No comets"),
};
static AgDisplayTheme *preview_theme = NULL;
gchar *
ag_display_theme_to_css(AgDisplayTheme *theme)
{
@ -337,3 +339,27 @@ ag_display_theme_free(AgDisplayTheme *display_theme)
g_list_free(display_theme->antiscia);
g_free(display_theme);
}
AgDisplayTheme *
ag_display_theme_get_preview_theme(void)
{
if (!preview_theme) {
preview_theme = g_new0(AgDisplayTheme, 1);
preview_theme->id = 0;
preview_theme->name = "Preview theme";
preview_theme->builtin = TRUE;
preview_theme->planets_include = TRUE;
preview_theme->planets = NULL;
preview_theme->aspects_include = TRUE;
preview_theme->aspects = NULL;
preview_theme->antiscia_include = TRUE;
preview_theme->antiscia = NULL;
preview_theme->planets = g_list_prepend(
preview_theme->planets,
GINT_TO_POINTER(GSWE_PLANET_SUN)
);
}
return preview_theme;
}

View File

@ -49,4 +49,6 @@ GList *ag_display_theme_get_list(void);
void ag_display_theme_free(AgDisplayTheme *display_theme);
AgDisplayTheme *ag_display_theme_get_preview_theme(void);
#endif /* __AG_DISPLAY_THEME_H__ */