Apply pre-commit

This commit is contained in:
qewer33
2023-09-03 23:51:49 +03:00
parent 8bff25d057
commit 9dec8d320b
5 changed files with 37 additions and 25 deletions

View File

@@ -68,4 +68,3 @@ INSTALL(FILES ${StartPage_PythonResources}
INSTALL(FILES ${StartPage_ImageResources}
DESTINATION ${CMAKE_INSTALL_DATADIR}/Mod/Start/StartPage/images
)

View File

@@ -386,4 +386,4 @@ ul.addonslist {
background: TEXTCOLOR;
background-clip: content-box;
border: 6px solid transparent;
}
}

View File

@@ -192,4 +192,4 @@
</div>
</body>
</html>
</html>

View File

@@ -262,9 +262,18 @@ def build_new_file_card(template):
quick start button"""
templates = {
"empty_file": [TranslationTexts.T_TEMPLATE_EMPTYFILE_NAME, TranslationTexts.T_TEMPLATE_EMPTYFILE_DESC],
"open_file": [TranslationTexts.T_TEMPLATE_OPENFILE_NAME, TranslationTexts.T_TEMPLATE_OPENFILE_DESC],
"parametric_part": [TranslationTexts.T_TEMPLATE_PARAMETRICPART_NAME, TranslationTexts.T_TEMPLATE_PARAMETRICPART_DESC],
"empty_file": [
TranslationTexts.T_TEMPLATE_EMPTYFILE_NAME,
TranslationTexts.T_TEMPLATE_EMPTYFILE_DESC,
],
"open_file": [
TranslationTexts.T_TEMPLATE_OPENFILE_NAME,
TranslationTexts.T_TEMPLATE_OPENFILE_DESC,
],
"parametric_part": [
TranslationTexts.T_TEMPLATE_PARAMETRICPART_NAME,
TranslationTexts.T_TEMPLATE_PARAMETRICPART_DESC,
],
# "csg_part": [TranslationTexts.T_TEMPLATE_CSGPART_NAME, TranslationTexts.T_TEMPLATE_CSGPART_DESC],
"2d_draft": [
TranslationTexts.T_TEMPLATE_2DDRAFT_NAME,
@@ -368,9 +377,14 @@ def handle():
JS = f.read()
with open(css_filename, "r") as f:
CSS = f.read()
HTML = HTML.replace("JS",JS)
HTML = HTML.replace("DEFAULT_CSS",CSS)
HTML = HTML.replace("CUSTOM_CSS",FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Start").GetString("CustomCSS","").replace("\n",""))
HTML = HTML.replace("JS", JS)
HTML = HTML.replace("DEFAULT_CSS", CSS)
HTML = HTML.replace(
"CUSTOM_CSS",
FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Start")
.GetString("CustomCSS", "")
.replace("\n", ""),
)
# set the language
@@ -718,27 +732,27 @@ def handle():
else:
BACKGROUND = gethexcolor(p.GetUnsigned("BackgroundColor1", 1331197183))
# linear gradient not supported by QT "linear-gradient("+gethexcolor(p.GetUnsigned("BackgroundColor1",1331197183))+","+gethexcolor(p.GetUnsigned("BackgroundColor2",2141107711))+")"
LINKCOLOR = gethexcolor(p.GetUnsigned("LinkColor",65535))
BASECOLOR = gethexcolor(p.GetUnsigned("PageColor",4294967295))
BOXCOLOR = gethexcolor(p.GetUnsigned("BoxColor",3722305023))
TEXTCOLOR = gethexcolor(p.GetUnsigned("PageTextColor",255))
BGTCOLOR = gethexcolor(p.GetUnsigned("BackgroundTextColor",1600086015))
LINKCOLOR = gethexcolor(p.GetUnsigned("LinkColor", 65535))
BASECOLOR = gethexcolor(p.GetUnsigned("PageColor", 4294967295))
BOXCOLOR = gethexcolor(p.GetUnsigned("BoxColor", 3722305023))
TEXTCOLOR = gethexcolor(p.GetUnsigned("PageTextColor", 255))
BGTCOLOR = gethexcolor(p.GetUnsigned("BackgroundTextColor", 1600086015))
SHADOW = "#888888"
if QtGui.QColor(BASECOLOR).valueF() < 0.5: # dark page - we need to make darker shadows
SHADOW = "#000000"
FONTFAMILY = p.GetString("FontFamily", "Arial,Helvetica,sans")
if not FONTFAMILY:
FONTFAMILY = "Arial,Helvetica,sans"
FONTSIZE = p.GetInt("FontSize",13)
HTML = HTML.replace("BASECOLOR",BASECOLOR)
HTML = HTML.replace("BOXCOLOR",BOXCOLOR)
HTML = HTML.replace("LINKCOLOR",LINKCOLOR)
HTML = HTML.replace("TEXTCOLOR",TEXTCOLOR)
HTML = HTML.replace("BGTCOLOR",BGTCOLOR)
HTML = HTML.replace("BACKGROUND",BACKGROUND)
HTML = HTML.replace("SHADOW",SHADOW)
HTML = HTML.replace("FONTFAMILY",FONTFAMILY)
HTML = HTML.replace("FONTSIZE",str(FONTSIZE)+"px")
FONTSIZE = p.GetInt("FontSize", 13)
HTML = HTML.replace("BASECOLOR", BASECOLOR)
HTML = HTML.replace("BOXCOLOR", BOXCOLOR)
HTML = HTML.replace("LINKCOLOR", LINKCOLOR)
HTML = HTML.replace("TEXTCOLOR", TEXTCOLOR)
HTML = HTML.replace("BGTCOLOR", BGTCOLOR)
HTML = HTML.replace("BACKGROUND", BACKGROUND)
HTML = HTML.replace("SHADOW", SHADOW)
HTML = HTML.replace("FONTFAMILY", FONTFAMILY)
HTML = HTML.replace("FONTSIZE", str(FONTSIZE) + "px")
# enable web access if permitted

View File

@@ -5,4 +5,3 @@
See \ref src/Mod/Draft/draft.dox as an example of how to populate this page
*/