From 0c7459d7d7acab562fffaf4e2e9861a482c98ab2 Mon Sep 17 00:00:00 2001 From: qewer33 Date: Thu, 31 Aug 2023 17:39:34 +0300 Subject: [PATCH 1/8] StartPage CSS fixes --- src/Mod/Start/StartPage/StartPage.css | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/Mod/Start/StartPage/StartPage.css b/src/Mod/Start/StartPage/StartPage.css index 60bb15dfc1..c842a88265 100644 --- a/src/Mod/Start/StartPage/StartPage.css +++ b/src/Mod/Start/StartPage/StartPage.css @@ -44,6 +44,10 @@ h2 { padding-top: 5px; } +img, a { + -webkit-user-drag: none; +} + .hidden { display: none !important; } @@ -113,7 +117,7 @@ ul.tabs { position: absolute; top: 2em; left: 50%; - transform: translateX(-50%); + transform: translateX(calc(-50% - 1em)); } ul.tabs li { @@ -130,7 +134,6 @@ ul.tabs li a { text-decoration: none; outline: 0; font-size: 1.3em; - transition: 100ms; } ul.tabs li a img { @@ -186,12 +189,17 @@ ul.icons { width: 130px; height: THUMBCARDSIZE; background: BOXCOLOR; + border: solid 2px BOXCOLOR; border-radius: 8px; margin: 10px; word-wrap: break-word; text-align: center; } +.file-card:hover { + border-color: LINKCOLOR; +} + .file-card h4 { margin: 5px 0; } @@ -233,11 +241,16 @@ a .caption:visited { width: 18em; height: 5em; background: BOXCOLOR; + border: solid 2px BOXCOLOR; border-radius: 8px; margin: 10px; word-wrap: break-word; } +.quickstart-button-card:hover { + border-color: LINKCOLOR; +} + .quickstart-button-card a { display: flex; } From a1d20ec97d523bffc9953711a5c2c828b9ad5699 Mon Sep 17 00:00:00 2001 From: qewer33 Date: Thu, 31 Aug 2023 22:04:50 +0300 Subject: [PATCH 2/8] Turn StartPage "Import" quickstart button into "Open" --- src/Mod/Start/StartPage/CMakeLists.txt | 2 +- src/Mod/Start/StartPage/LoadNew.py | 10 ++++++---- src/Mod/Start/StartPage/StartPage.py | 6 +++--- src/Mod/Start/StartPage/TranslationTexts.py | 4 ++-- .../{new_import_file.png => new_open_file.png} | Bin 5 files changed, 12 insertions(+), 10 deletions(-) rename src/Mod/Start/StartPage/images/{new_import_file.png => new_open_file.png} (100%) diff --git a/src/Mod/Start/StartPage/CMakeLists.txt b/src/Mod/Start/StartPage/CMakeLists.txt index b09ccbea0e..0bbedbb8cc 100644 --- a/src/Mod/Start/StartPage/CMakeLists.txt +++ b/src/Mod/Start/StartPage/CMakeLists.txt @@ -27,7 +27,7 @@ SET(StartPage_ImageResources images/new_file_thumbnail.svg images/icon_settings.png images/new_empty_file.png - images/new_import_file.png + images/new_open_file.png images/new_parametric_part.png images/new_csg_part.png images/new_2d_draft.png diff --git a/src/Mod/Start/StartPage/LoadNew.py b/src/Mod/Start/StartPage/LoadNew.py index be697589ae..3668632f33 100644 --- a/src/Mod/Start/StartPage/LoadNew.py +++ b/src/Mod/Start/StartPage/LoadNew.py @@ -29,10 +29,12 @@ template_name = str(template) if template_name == "empty_file": FreeCADGui.runCommand('Std_New') StartPage.postStart() -elif template_name == "import_file": - FreeCADGui.runCommand('Std_New') - StartPage.postStart() - FreeCADGui.runCommand("Std_Import") +elif template_name == "open_file": + previous_doc = FreeCADGui.ActiveDocument + FreeCADGui.runCommand("Std_Open") + # workaround to not run postStart() if user cancels the Open dialog + if FreeCADGui.ActiveDocument != previous_doc: + StartPage.postStart() elif template_name == "parametric_part": FreeCADGui.runCommand('Std_New') FreeCADGui.activateWorkbench("PartDesignWorkbench") diff --git a/src/Mod/Start/StartPage/StartPage.py b/src/Mod/Start/StartPage/StartPage.py index 803044d944..f02928d392 100644 --- a/src/Mod/Start/StartPage/StartPage.py +++ b/src/Mod/Start/StartPage/StartPage.py @@ -258,7 +258,7 @@ def build_new_file_card(template): templates = { "empty_file": [TranslationTexts.T_TEMPLATE_EMPTYFILE_NAME, TranslationTexts.T_TEMPLATE_EMPTYFILE_DESC], - "import_file": [TranslationTexts.T_TEMPLATE_IMPORTFILE_NAME, TranslationTexts.T_TEMPLATE_IMPORTFILE_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, TranslationTexts.T_TEMPLATE_2DDRAFT_DESC], @@ -266,7 +266,7 @@ def build_new_file_card(template): } if template not in templates: - return + return "" image = 'file:///'+os.path.join(os.path.join(FreeCAD.getResourceDir(), "Mod", "Start", "StartPage"), 'images/new_'+template+".png").replace('\\','/') @@ -439,7 +439,7 @@ def handle(): SECTION_NEW_FILE = "

"+TranslationTexts.T_NEWFILE+"

" SECTION_NEW_FILE += "