Skip to content

Commit

Permalink
Merge pull request FreeCAD#16281 from benj5378/aboutStylesheet
Browse files Browse the repository at this point in the history
[Gui] Add style, theme and qtstyle info to clipboard about info
  • Loading branch information
chennes authored Sep 8, 2024
2 parents cf2b98b + 50863c7 commit 2383ba7
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/Doc/CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Bartlomiej Niemiec
Bas Ruigrok (Rexbas)
bejant
Benjamin Alterauge
Benjamin Bræstrup Sayoc
Bernd Hahnebach
bgbsww
blobfish (tanderson69)
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/PreferencePacks/FreeCAD Classic/post.FCMacro
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import FreeCAD
editorPrefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Editor")
editorPrefs.RemInt("Text")

appPrefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/General")
appPrefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/MainWindow")
appPrefs.RemString("QtStyle")
4 changes: 1 addition & 3 deletions src/Gui/PreferencePacks/FreeCAD Dark/FreeCAD Dark.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
<FCParamGroup Name="Root">
<FCParamGroup Name="BaseApp">
<FCParamGroup Name="Preferences">
<FCParamGroup Name="General">
<FCText Name="QtStyle">Fusion</FCText>
</FCParamGroup>
<FCParamGroup Name="Themes">
<FCUInt Name="ThemeAccentColor1" Value="1252392959"/>
<FCUInt Name="ThemeAccentColor2" Value="3027763199"/>
Expand Down Expand Up @@ -179,6 +176,7 @@
<FCInt Name="FontSize" Value="11"/>
</FCParamGroup>
<FCParamGroup Name="MainWindow">
<FCText Name="QtStyle">Fusion</FCText>
<FCBool Name="TiledBackground" Value="0"/>
<FCText Name="Theme">FreeCAD Dark</FCText>
<FCText Name="StyleSheet">FreeCAD Dark.qss</FCText>
Expand Down
4 changes: 1 addition & 3 deletions src/Gui/PreferencePacks/FreeCAD Light/FreeCAD Light.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
<FCParamGroup Name="Root">
<FCParamGroup Name="BaseApp">
<FCParamGroup Name="Preferences">
<FCParamGroup Name="General">
<FCText Name="QtStyle">Fusion</FCText>
</FCParamGroup>
<FCParamGroup Name="Themes">
<FCUInt Name="ThemeAccentColor1" Value="1252392959"/>
<FCUInt Name="ThemeAccentColor2" Value="3027763199"/>
Expand Down Expand Up @@ -209,6 +206,7 @@
<FCUInt Name="BaseColor" Value="3505127423"/>
</FCParamGroup>
<FCParamGroup Name="MainWindow">
<FCText Name="QtStyle">Fusion</FCText>
<FCText Name="Theme">FreeCAD Light</FCText>
<FCText Name="StyleSheet">FreeCAD Light.qss</FCText>
<FCText Name="OverlayActiveStyleSheet">Light Theme + Light Background.qss</FCText>
Expand Down
9 changes: 9 additions & 0 deletions src/Gui/Splashscreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,15 @@ void AboutDialog::copyToClipboard()
}
str << "\n";

std::string styleSheet = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/MainWindow")->GetASCII("StyleSheet");
std::string theme = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/MainWindow")->GetASCII("Theme");
std::string style = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/MainWindow")->GetASCII("QtStyle");

str << "Stylesheet/Theme/QtStyle: "
<< QString::fromStdString(styleSheet) << "/"
<< QString::fromStdString(theme) << "/"
<< QString::fromStdString(style) << "\n";

// Add installed module information:
auto modDir = fs::path(App::Application::getUserAppDataDir()) / "Mod";
bool firstMod = true;
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/StartupProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ void StartupPostProcess::setCursorFlashing()

void StartupPostProcess::setQtStyle()
{
ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("General");
ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("MainWindow");
auto qtStyle = hGrp->GetASCII("QtStyle");
QApplication::setStyle(QString::fromStdString(qtStyle));
}
Expand Down

0 comments on commit 2383ba7

Please sign in to comment.