From 2056cd94f976d1c422c7f2442be6ec19acfcc56e Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Thu, 2 Feb 2023 17:29:01 +0100 Subject: [PATCH] Start: Added option to hide start page scrollbars --- src/Mod/Start/Gui/DlgStartPreferences.ui | 140 +++++++++++-------- src/Mod/Start/Gui/DlgStartPreferencesImp.cpp | 2 + src/Mod/Start/StartPage/StartPage.css | 3 + src/Mod/Start/StartPage/StartPage.py | 2 + 4 files changed, 90 insertions(+), 57 deletions(-) diff --git a/src/Mod/Start/Gui/DlgStartPreferences.ui b/src/Mod/Start/Gui/DlgStartPreferences.ui index 342c11ee69..71d8218be6 100644 --- a/src/Mod/Start/Gui/DlgStartPreferences.ui +++ b/src/Mod/Start/Gui/DlgStartPreferences.ui @@ -6,8 +6,8 @@ 0 0 - 482 - 795 + 537 + 942 @@ -42,10 +42,25 @@ Contents - - + + + + Displays help tips in the Start workbench Documents tab + + + Qt::RightToLeft + - Show notepad + + + + true + + + ShowTips + + + Mod/Start @@ -68,6 +83,63 @@ + + + + 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 + + + + + + + Show tips + + + + + + + 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 + + + @@ -104,72 +176,26 @@ - - - - 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 - - - - - + + - Show forum + Show scrollbars - - - - If this is checked, the latest posts from the FreeCAD forum will be displayed on the Activity tab - + + Qt::RightToLeft - - ShowForum - - - Mod/Start - - - - - - - Show tips - - - - - - - Qt::RightToLeft - - - Displays help tips in the Start workbench Documents tab - - - - true - ShowTips + ShowScrollBars Mod/Start diff --git a/src/Mod/Start/Gui/DlgStartPreferencesImp.cpp b/src/Mod/Start/Gui/DlgStartPreferencesImp.cpp index 5812c8b50b..013fe78e3a 100644 --- a/src/Mod/Start/Gui/DlgStartPreferencesImp.cpp +++ b/src/Mod/Start/Gui/DlgStartPreferencesImp.cpp @@ -110,6 +110,7 @@ void DlgStartPreferencesImp::saveSettings() ui->checkBox_5->onSave(); ui->checkBox_6->onSave(); ui->checkBox_7->onSave(); + ui->checkBox_8->onSave(); ui->lineEdit->onSave(); ui->spinBox->onSave(); } @@ -141,6 +142,7 @@ void DlgStartPreferencesImp::loadSettings() ui->checkBox_5->onRestore(); ui->checkBox_6->onRestore(); ui->checkBox_7->onRestore(); + ui->checkBox_8->onRestore(); ui->lineEdit->onRestore(); ui->spinBox->onRestore(); } diff --git a/src/Mod/Start/StartPage/StartPage.css b/src/Mod/Start/StartPage/StartPage.css index 72f8ff55b1..7792c7da9a 100644 --- a/src/Mod/Start/StartPage/StartPage.css +++ b/src/Mod/Start/StartPage/StartPage.css @@ -4,6 +4,9 @@ body { font-family: FONTFAMILY; font-size: FONTSIZE; } +body::-webkit-scrollbar { + display: OVERFLOW; +} a, a:link, a:visited { text-decoration: none; color: LINKCOLOR; diff --git a/src/Mod/Start/StartPage/StartPage.py b/src/Mod/Start/StartPage/StartPage.py index eb1c6f3554..1e3fd5f9b1 100644 --- a/src/Mod/Start/StartPage/StartPage.py +++ b/src/Mod/Start/StartPage/StartPage.py @@ -563,6 +563,7 @@ def handle(): BOXCOLOR = gethexcolor(p.GetUnsigned("BoxColor",3722305023)) TEXTCOLOR = gethexcolor(p.GetUnsigned("PageTextColor",255)) BGTCOLOR = gethexcolor(p.GetUnsigned("BackgroundTextColor",4294703103)) + OVERFLOW = "normal" if p.GetBool("ShowScrollBars",True) else "none" SHADOW = "#888888" if QtGui.QColor(BASECOLOR).valueF() < 0.5: # dark page - we need to make darker shadows SHADOW = "#000000" @@ -579,6 +580,7 @@ def handle(): HTML = HTML.replace("SHADOW",SHADOW) HTML = HTML.replace("FONTFAMILY",FONTFAMILY) HTML = HTML.replace("FONTSIZE",str(FONTSIZE)+"px") + HTML = HTML.replace("OVERFLOW",OVERFLOW) # enable web access if permitted