From 9dec8d320bfe648714f450d42778d5e5e14d6c11 Mon Sep 17 00:00:00 2001 From: qewer33 Date: Sun, 3 Sep 2023 23:51:49 +0300 Subject: [PATCH] Apply pre-commit --- src/Mod/Start/StartPage/CMakeLists.txt | 1 - src/Mod/Start/StartPage/StartPage.css | 2 +- src/Mod/Start/StartPage/StartPage.html | 2 +- src/Mod/Start/StartPage/StartPage.py | 56 ++++++++++++++++---------- src/Mod/Start/start.dox | 1 - 5 files changed, 37 insertions(+), 25 deletions(-) diff --git a/src/Mod/Start/StartPage/CMakeLists.txt b/src/Mod/Start/StartPage/CMakeLists.txt index 0bbedbb8cc..5d363bb972 100644 --- a/src/Mod/Start/StartPage/CMakeLists.txt +++ b/src/Mod/Start/StartPage/CMakeLists.txt @@ -68,4 +68,3 @@ INSTALL(FILES ${StartPage_PythonResources} INSTALL(FILES ${StartPage_ImageResources} DESTINATION ${CMAKE_INSTALL_DATADIR}/Mod/Start/StartPage/images ) - diff --git a/src/Mod/Start/StartPage/StartPage.css b/src/Mod/Start/StartPage/StartPage.css index 116782e3ae..6691267d30 100644 --- a/src/Mod/Start/StartPage/StartPage.css +++ b/src/Mod/Start/StartPage/StartPage.css @@ -386,4 +386,4 @@ ul.addonslist { background: TEXTCOLOR; background-clip: content-box; border: 6px solid transparent; -} \ No newline at end of file +} diff --git a/src/Mod/Start/StartPage/StartPage.html b/src/Mod/Start/StartPage/StartPage.html index f3bcbeabe6..d48f062fa6 100644 --- a/src/Mod/Start/StartPage/StartPage.html +++ b/src/Mod/Start/StartPage/StartPage.html @@ -192,4 +192,4 @@ - \ No newline at end of file + diff --git a/src/Mod/Start/StartPage/StartPage.py b/src/Mod/Start/StartPage/StartPage.py index 5a619ffeeb..4951d960bf 100644 --- a/src/Mod/Start/StartPage/StartPage.py +++ b/src/Mod/Start/StartPage/StartPage.py @@ -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 diff --git a/src/Mod/Start/start.dox b/src/Mod/Start/start.dox index 00d0df3869..0d1fe3c8c0 100644 --- a/src/Mod/Start/start.dox +++ b/src/Mod/Start/start.dox @@ -5,4 +5,3 @@ See \ref src/Mod/Draft/draft.dox as an example of how to populate this page */ -