From 23ad8ffcd215c03e88dfc9d9ca4371625ce01031 Mon Sep 17 00:00:00 2001 From: qewer33 Date: Mon, 28 Aug 2023 16:50:19 +0300 Subject: [PATCH 1/4] Change default StartPage BackgroundTextColor value --- src/Gui/PreferencePacks/Classic/Classic.cfg | 2 +- src/Mod/Start/Gui/DlgStartPreferences.ui | 6 +++--- src/Mod/Start/StartPage/StartPage.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Gui/PreferencePacks/Classic/Classic.cfg b/src/Gui/PreferencePacks/Classic/Classic.cfg index 3b8c7de79b..763d721adb 100644 --- a/src/Gui/PreferencePacks/Classic/Classic.cfg +++ b/src/Gui/PreferencePacks/Classic/Classic.cfg @@ -37,7 +37,7 @@ - + diff --git a/src/Mod/Start/Gui/DlgStartPreferences.ui b/src/Mod/Start/Gui/DlgStartPreferences.ui index 1ebc5769b1..fbfd1beb4b 100644 --- a/src/Mod/Start/Gui/DlgStartPreferences.ui +++ b/src/Mod/Start/Gui/DlgStartPreferences.ui @@ -349,9 +349,9 @@ By using ";;" to separate paths, you can add several folders here - 255 - 251 - 247 + 95 + 95 + 95 diff --git a/src/Mod/Start/StartPage/StartPage.py b/src/Mod/Start/StartPage/StartPage.py index a6178eea8a..9549e72178 100644 --- a/src/Mod/Start/StartPage/StartPage.py +++ b/src/Mod/Start/StartPage/StartPage.py @@ -602,7 +602,7 @@ def handle(): BASECOLOR = gethexcolor(p.GetUnsigned("PageColor",4294967295)) BOXCOLOR = gethexcolor(p.GetUnsigned("BoxColor",3722305023)) TEXTCOLOR = gethexcolor(p.GetUnsigned("PageTextColor",255)) - BGTCOLOR = gethexcolor(p.GetUnsigned("BackgroundTextColor",4294703103)) + BGTCOLOR = gethexcolor(p.GetUnsigned("BackgroundTextColor",1600086015)) OVERFLOW = "" if p.GetBool("ShowScrollBars",True) else "body::-webkit-scrollbar {display: none;}" SHADOW = "#888888" if QtGui.QColor(BASECOLOR).valueF() < 0.5: # dark page - we need to make darker shadows From 53ca19458e2b9723eafb520fa528d528cd327096 Mon Sep 17 00:00:00 2001 From: qewer33 Date: Mon, 28 Aug 2023 16:52:34 +0300 Subject: [PATCH 2/4] Make StartPage tips use BackgroundTextColor --- src/Mod/Start/StartPage/StartPage.css | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Mod/Start/StartPage/StartPage.css b/src/Mod/Start/StartPage/StartPage.css index 418427efde..f219917ac1 100644 --- a/src/Mod/Start/StartPage/StartPage.css +++ b/src/Mod/Start/StartPage/StartPage.css @@ -150,6 +150,7 @@ ul.tabs li a.active:hover { } .footnote { + color: BGTCOLOR; text-align: center; display: block; /* footnote tips display */ clear: both; From 230501d3d585b32e635ac501ed155830cb65b47d Mon Sep 17 00:00:00 2001 From: qewer33 Date: Mon, 28 Aug 2023 18:07:33 +0300 Subject: [PATCH 3/4] Add file thumbnail icons hide and size options to StartPage --- src/Mod/Start/Gui/DlgStartPreferences.ui | 306 ++++++++++++------- src/Mod/Start/Gui/DlgStartPreferencesImp.cpp | 4 + src/Mod/Start/StartPage/StartPage.css | 21 +- src/Mod/Start/StartPage/StartPage.py | 10 + 4 files changed, 224 insertions(+), 117 deletions(-) diff --git a/src/Mod/Start/Gui/DlgStartPreferences.ui b/src/Mod/Start/Gui/DlgStartPreferences.ui index fbfd1beb4b..a88215a6db 100644 --- a/src/Mod/Start/Gui/DlgStartPreferences.ui +++ b/src/Mod/Start/Gui/DlgStartPreferences.ui @@ -6,8 +6,8 @@ 0 0 - 401 - 690 + 548 + 894 @@ -21,7 +21,7 @@ - + An optional HTML template that will be used instead of the default start page. @@ -42,71 +42,6 @@ Contents - - - - Displays help tips in the Start workbench Documents tab - - - Qt::RightToLeft - - - - - - true - - - ShowTips - - - Mod/Start - - - - - - - Shows a notepad next to the file thumbnails, where you can keep notes across sessions - - - Qt::RightToLeft - - - - - - ShowNotes - - - Mod/Start - - - - - - - Show notepad - - - - - - - An optional custom folder to be displayed at the bottom of the first page. -By using ";;" to separate paths, you can add several folders here - - - Gui::FileChooser::Directory - - - ShowCustomFolder - - - Mod/Start - - - @@ -114,36 +49,10 @@ By using ";;" to separate paths, you can add several folders here - - + + - Show forum - - - - - - - If this is checked, the latest posts from the FreeCAD forum will be displayed on the Activity tab - - - Qt::RightToLeft - - - - - - ShowForum - - - Mod/Start - - - - - - - Show examples folder contents + Show additional folder @@ -169,10 +78,60 @@ By using ";;" to separate paths, you can add several folders here - - + + + + If this is checked, the latest posts from the FreeCAD forum will be displayed on the Activity tab + + + Qt::RightToLeft + - Show additional folder + + + + ShowForum + + + Mod/Start + + + + + + + Qt::RightToLeft + + + + + + true + + + ShowFileThumbnailIcons + + + Mod/Start + + + + + + + Shows a notepad next to the file thumbnails, where you can keep notes across sessions + + + Qt::RightToLeft + + + + + + ShowNotes + + + Mod/Start @@ -183,6 +142,34 @@ By using ";;" to separate paths, you can add several folders here + + + + Show notepad + + + + + + + Show forum + + + + + + + An optional custom folder to be displayed at the bottom of the first page. +By using ";;" to separate paths, you can add several folders here + + + ShowCustomFolder + + + Mod/Start + + + @@ -202,6 +189,109 @@ By using ";;" to separate paths, you can add several folders here + + + + Show file thumbnails + + + + + + + Show examples folder contents + + + + + + + Displays help tips in the Start workbench Documents tab + + + Qt::RightToLeft + + + + + + true + + + ShowTips + + + Mod/Start + + + + + + + + 0 + 0 + + + + File thumbnail size + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 100 + 16777215 + + + + The size of file thumbnail icons in recent files and examples sections + + + Qt::LeftToRight + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + px + + + 32 + + + 128 + + + 128 + + + FileThumbnailIconsSize + + + Mod/Start + + + + + @@ -255,7 +345,7 @@ By using ";;" to separate paths, you can add several folders here The background color behind the panels - + 79 88 @@ -294,7 +384,7 @@ By using ";;" to separate paths, you can add several folders here The down gradient for the background color (currently unsupported) - + 127 158 @@ -317,7 +407,7 @@ By using ";;" to separate paths, you can add several folders here - + An optional image to display as background @@ -347,7 +437,7 @@ By using ";;" to separate paths, you can add several folders here The color of the version text - + 95 95 @@ -380,7 +470,7 @@ By using ";;" to separate paths, you can add several folders here The background of the main start page area - + 255 255 @@ -413,7 +503,7 @@ By using ";;" to separate paths, you can add several folders here The color of the text on the main pages - + 0 0 @@ -446,7 +536,7 @@ By using ";;" to separate paths, you can add several folders here The background color of the boxes inside the pages - + 221 221 @@ -479,7 +569,7 @@ By using ";;" to separate paths, you can add several folders here The color of the links - + 0 0 diff --git a/src/Mod/Start/Gui/DlgStartPreferencesImp.cpp b/src/Mod/Start/Gui/DlgStartPreferencesImp.cpp index 67b13bb85d..eab8120c2b 100644 --- a/src/Mod/Start/Gui/DlgStartPreferencesImp.cpp +++ b/src/Mod/Start/Gui/DlgStartPreferencesImp.cpp @@ -111,6 +111,8 @@ void DlgStartPreferencesImp::saveSettings() ui->checkBox_7->onSave(); ui->lineEdit->onSave(); ui->spinBox->onSave(); + ui->showFileThumbnailIconsCheckBox->onSave(); + ui->fileThumbnailIconSizeSpinBox->onSave(); } void DlgStartPreferencesImp::loadSettings() @@ -142,6 +144,8 @@ void DlgStartPreferencesImp::loadSettings() ui->checkBox_7->onRestore(); ui->lineEdit->onRestore(); ui->spinBox->onRestore(); + ui->showFileThumbnailIconsCheckBox->onRestore(); + ui->fileThumbnailIconSizeSpinBox->onRestore(); } /** diff --git a/src/Mod/Start/StartPage/StartPage.css b/src/Mod/Start/StartPage/StartPage.css index f219917ac1..9c1a16dd03 100644 --- a/src/Mod/Start/StartPage/StartPage.css +++ b/src/Mod/Start/StartPage/StartPage.css @@ -174,23 +174,26 @@ ul.icons { .file-card { list-style: none; display: inline; - padding: 10px 0px 15px 10px; - width: 138px; - height: 200px; + padding: 10px; + width: 130px; + height: THUMBCARDSIZE; background: BOXCOLOR; border-radius: 8px; margin: 10px; word-wrap: break-word; + text-align: center; } .file-card h4 { - margin: 3px 0; - max-width: 90%; + margin: 5px 0; } .file-card img { - width: 128px; - height: 128px; + display: block; /* thumb icons display */ + /* don't change this line */ + margin: auto; + width: THUMBSIZE; + height: THUMBSIZE; border-radius: 4px; } @@ -239,8 +242,8 @@ a .caption:visited { } .quickstart-button-card img { - width: 64px; - height: 64px; + width: 60px; + height: 60px; margin-right: 10px; } diff --git a/src/Mod/Start/StartPage/StartPage.py b/src/Mod/Start/StartPage/StartPage.py index 9549e72178..803044d944 100644 --- a/src/Mod/Start/StartPage/StartPage.py +++ b/src/Mod/Start/StartPage/StartPage.py @@ -390,6 +390,16 @@ def handle(): ALTCSS = f.read() HTML = HTML.replace("","") + # handle file thumbnail icons visiblity and size + + if not FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Start").GetBool("ShowFileThumbnailIcons",True): + HTML = HTML.replace("display: block; /* thumb icons display */","display: none; /* thumb icons display */") + HTML = HTML.replace("THUMBCARDSIZE","75px") + + thumb_icons_size = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Start").GetInt("FileThumbnailIconsSize", 128) + HTML = HTML.replace("THUMBSIZE",str(thumb_icons_size)+"px") + HTML = HTML.replace("THUMBCARDSIZE",str(thumb_icons_size + 75)+"px") + # turn tips off if needed if not FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Start").GetBool("ShowTips",True): From 584e766d5cf69beaebe437d8e03ccf7239d6042c Mon Sep 17 00:00:00 2001 From: qewer33 Date: Mon, 28 Aug 2023 18:15:15 +0300 Subject: [PATCH 4/4] Add StartPage CSS warning comment --- src/Mod/Start/StartPage/StartPage.css | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Mod/Start/StartPage/StartPage.css b/src/Mod/Start/StartPage/StartPage.css index 9c1a16dd03..60bb15dfc1 100644 --- a/src/Mod/Start/StartPage/StartPage.css +++ b/src/Mod/Start/StartPage/StartPage.css @@ -1,3 +1,10 @@ +/* + * !!! WARNING !!! + * DO NOT change lines that have comment labels right beside them + * these lines are marked with "don't change this line" + * they get replaced by StartPage.py according to the preferences +*/ + /* --- MAIN --- */ html { @@ -150,9 +157,10 @@ ul.tabs li a.active:hover { } .footnote { + /* don't change this line */ + display: block; /* footnote tips display */ color: BGTCOLOR; text-align: center; - display: block; /* footnote tips display */ clear: both; padding-top: 10px; } @@ -189,8 +197,8 @@ ul.icons { } .file-card img { - display: block; /* thumb icons display */ /* don't change this line */ + display: block; /* thumb icons display */ margin: auto; width: THUMBSIZE; height: THUMBSIZE; @@ -252,8 +260,8 @@ a .caption:visited { } .notes { - display: none; /* notes display */ /* don't change this line */ + display: none; /* notes display */ width: 100%; } @@ -347,8 +355,8 @@ ul.addonslist { } .forum { - display: none; /* forum display */ /* don't change this line */ + display: none; /* forum display */ } .forum pre {