Setting default theme from json

merge-requests/30/head
Bob Mottram 2022-04-05 12:29:06 +01:00
parent 0143c7c5a0
commit 972aa3e880
1 changed files with 24 additions and 18 deletions

View File

@ -575,24 +575,30 @@ def _set_theme_default(base_dir: str, allow_local_network_access: bool):
name = 'default' name = 'default'
_remove_theme(base_dir) _remove_theme(base_dir)
_set_theme_in_config(base_dir, name) _set_theme_in_config(base_dir, name)
bg_params = {
"login": "jpg", variables_file = base_dir + '/theme/' + name + '/theme.json'
"follow": "jpg", if os.path.isfile(variables_file):
"options": "jpg", _read_variables_file(base_dir, name, variables_file,
"search": "jpg" allow_local_network_access)
} else:
theme_params = { bg_params = {
"newswire-publish-icon": True, "login": "jpg",
"full-width-timeline-buttons": False, "follow": "jpg",
"icons-as-buttons": False, "options": "jpg",
"rss-icon-at-top": True, "search": "jpg"
"publish-button-at-top": False, }
"banner-height": "20vh", theme_params = {
"banner-height-mobile": "10vh", "newswire-publish-icon": True,
"search-banner-height-mobile": "15vh" "full-width-timeline-buttons": False,
} "icons-as-buttons": False,
_set_theme_from_dict(base_dir, name, theme_params, bg_params, "rss-icon-at-top": True,
allow_local_network_access) "publish-button-at-top": False,
"banner-height": "20vh",
"banner-height-mobile": "10vh",
"search-banner-height-mobile": "15vh"
}
_set_theme_from_dict(base_dir, name, theme_params, bg_params,
allow_local_network_access)
def _set_theme_fonts(base_dir: str, theme_name: str) -> None: def _set_theme_fonts(base_dir: str, theme_name: str) -> None: