mirror of https://gitlab.com/bashrc2/epicyon
Include font sizes within theme designer
parent
1bec325f3f
commit
97e132260f
|
@ -223,16 +223,29 @@ def htmlThemeDesigner(cssCache: {}, baseDir: str,
|
||||||
'name="submitThemeDesigner" accesskey="' + submitKey + '">' + \
|
'name="submitThemeDesigner" accesskey="' + submitKey + '">' + \
|
||||||
translate['Submit'] + '</button>\n </center>\n'
|
translate['Submit'] + '</button>\n </center>\n'
|
||||||
|
|
||||||
themeForm += ' <table class="accesskeys">\n'
|
tableStr = ' <table class="accesskeys">\n'
|
||||||
themeForm += ' <colgroup>\n'
|
tableStr += ' <colgroup>\n'
|
||||||
themeForm += ' <col span="1" class="accesskeys-left">\n'
|
tableStr += ' <col span="1" class="accesskeys-left">\n'
|
||||||
themeForm += ' <col span="1" class="accesskeys-center">\n'
|
tableStr += ' <col span="1" class="accesskeys-center">\n'
|
||||||
themeForm += ' </colgroup>\n'
|
tableStr += ' </colgroup>\n'
|
||||||
themeForm += ' <tbody>\n'
|
tableStr += ' <tbody>\n'
|
||||||
|
|
||||||
|
fontStr = ' <div class="container">\n' + tableStr
|
||||||
|
colorStr = ' <div class="container">\n' + tableStr
|
||||||
for variableName, value in themeJson.items():
|
for variableName, value in themeJson.items():
|
||||||
if variableName.endswith('-color') or \
|
if 'font-size' in variableName:
|
||||||
variableName.endswith('-text'):
|
variableNameStr = variableName.replace('-', ' ')
|
||||||
|
variableNameStr = variableNameStr.replace('font size', '').strip()
|
||||||
|
variableNameStr = variableNameStr.title()
|
||||||
|
fontStr += \
|
||||||
|
' <tr><td><label class="labels">' + \
|
||||||
|
variableNameStr + '</label></td>'
|
||||||
|
fontStr += \
|
||||||
|
'<td><input type="text" name="themeSetting_' + \
|
||||||
|
variableName + '" value="' + str(value) + \
|
||||||
|
'" title="' + variableNameStr + '"></p></td></tr>\n'
|
||||||
|
elif (variableName.endswith('-color') or
|
||||||
|
variableName.endswith('-text')):
|
||||||
# only use colors defined as hex
|
# only use colors defined as hex
|
||||||
if not value.startswith('#'):
|
if not value.startswith('#'):
|
||||||
if color_to_hex.get(value):
|
if color_to_hex.get(value):
|
||||||
|
@ -249,15 +262,17 @@ def htmlThemeDesigner(cssCache: {}, baseDir: str,
|
||||||
if variableNameStr == 'cw':
|
if variableNameStr == 'cw':
|
||||||
variableNameStr = 'content warning'
|
variableNameStr = 'content warning'
|
||||||
variableNameStr = variableNameStr.title()
|
variableNameStr = variableNameStr.title()
|
||||||
themeForm += \
|
colorStr += \
|
||||||
' <tr><td><label class="labels">' + \
|
' <tr><td><label class="labels">' + \
|
||||||
variableNameStr + '</label></td>'
|
variableNameStr + '</label></td>'
|
||||||
themeForm += \
|
colorStr += \
|
||||||
'<td><input type="color" name="themeSetting_' + \
|
'<td><input type="color" name="themeSetting_' + \
|
||||||
variableName + '" value="' + str(value) + \
|
variableName + '" value="' + str(value) + \
|
||||||
'" title="' + variableNameStr + '"></p></td></tr>\n'
|
'" title="' + variableNameStr + '"></p></td></tr>\n'
|
||||||
|
|
||||||
themeForm += ' </table>\n'
|
colorStr += ' </table>\n </div>\n'
|
||||||
|
fontStr += ' </table>\n </div>\n'
|
||||||
|
themeForm += colorStr + fontStr
|
||||||
themeForm += ' </form>\n'
|
themeForm += ' </form>\n'
|
||||||
themeForm += '</div>\n'
|
themeForm += '</div>\n'
|
||||||
themeForm += htmlFooter()
|
themeForm += htmlFooter()
|
||||||
|
|
Loading…
Reference in New Issue