Gui: Move style parameters to yaml files

This commit is contained in:
Kacper Donat
2025-08-16 13:26:07 +02:00
parent f87a9646a7
commit 56d8d37ab4
5 changed files with 131 additions and 125 deletions

View File

@@ -104,68 +104,6 @@
<FCUInt Name="ThemeAccentColor1" Value="1252392959"/>
<FCUInt Name="ThemeAccentColor2" Value="3027763199"/>
<FCUInt Name="ThemeAccentColor3" Value="1434171135"/>
<FCParamGroup Name="UserTokens">
<FCText Name="3DViewBackgroundRefColor">@BackgroundColor</FCText>
<FCText Name="ButtonBackgroundHooverColor">@ButtonTopBackgroundColor</FCText>
<FCText Name="ButtonBorderColor">@GeneralBorderColor</FCText>
<FCText Name="ButtonBorderHooverColor">@GeneralBorderColor</FCText>
<FCText Name="ButtonBottomBackgroundColor">@PrimaryColorLighten2</FCText>
<FCText Name="ButtonTopBackgroundColor">@PrimaryColorLighten3</FCText>
<FCText Name="CheckBoxBackgroundColor">@TextEditFieldBackgroundColor</FCText>
<FCText Name="CheckBoxBorderColor">@GeneralBorderColor</FCText>
<FCText Name="DialogBackgroundColor">@PrimaryColorLighten3</FCText>
<FCText Name="GeneralAlternateBackgroundColor">@PrimaryColorLighten2</FCText>
<FCText Name="GeneralBackgroundColor">@PrimaryColor</FCText>
<FCText Name="GeneralBackgroundHoverColor">@PrimaryColorLighten4</FCText>
<FCText Name="GeneralBorderColor">@PrimaryColorDarken5</FCText>
<FCText Name="GeneralBorderHoverColor">@PrimaryColorLighten6</FCText>
<FCText Name="GeneralDisabledBackgroundColor">@PrimaryColorDarken3</FCText>
<FCText Name="GeneralGridLinesColor">@PrimaryColorLighten3</FCText>
<FCText Name="GeneralHeaderBackgroundColor">@PrimaryColor</FCText>
<FCText Name="GroupboxBackgroundColor">@PrimaryColorLighten4</FCText>
<FCText Name="GroupboxBorderColor">lighten(@GroupboxBackgroundColor,20)</FCText>
<FCText Name="IconsLocationFolderName">images_classic</FCText>
<FCText Name="InputFieldBorderRadius">3px</FCText>
<FCText Name="MenuBackgroundColor">@PrimaryColorDarken4</FCText>
<FCText Name="PrimaryColor">#191919</FCText>
<FCText Name="PrimaryColorDarken1">darken(@PrimaryColor,5)</FCText>
<FCText Name="PrimaryColorDarken2">darken(@PrimaryColor,8)</FCText>
<FCText Name="PrimaryColorDarken3">darken(@PrimaryColor,15)</FCText>
<FCText Name="PrimaryColorDarken4">darken(@PrimaryColor,20)</FCText>
<FCText Name="PrimaryColorDarken5">darken(@PrimaryColor,200)</FCText>
<FCText Name="PrimaryColorDarken6">darken(@PrimaryColor,5890)</FCText>
<FCText Name="PrimaryColorLighten1">lighten(@PrimaryColor,20)</FCText>
<FCText Name="PrimaryColorLighten2">lighten(@PrimaryColor,40)</FCText>
<FCText Name="PrimaryColorLighten3">lighten(@PrimaryColor,80)</FCText>
<FCText Name="PrimaryColorLighten4">lighten(@PrimaryColor,100)</FCText>
<FCText Name="PrimaryColorLighten5">lighten(@PrimaryColor,300)</FCText>
<FCText Name="PrimaryColorLighten6">lighten(@PrimaryColor,5890)</FCText>
<FCText Name="RadioButtonBackgroundColor">@CheckBoxBackgroundColor</FCText>
<FCText Name="RadioButtonBorderColor">@GeneralBorderColor</FCText>
<FCText Name="ScrollbarBackgroundColor">@GeneralDisabledBackgroundColor</FCText>
<FCText Name="SketcherConflictingConstraintsColor">#fc6c6c</FCText>
<FCText Name="SketcherEmptySketchColor">#ffffff</FCText>
<FCText Name="SketcherFullyConstrainedColor">#8cff5b</FCText>
<FCText Name="SketcherMalformedConstraintsColor">#fc6c6c</FCText>
<FCText Name="SketcherPartiallyRedundantConstraintsColor">#77cbff</FCText>
<FCText Name="SketcherRedundantConstraintsColor">#ffa256</FCText>
<FCText Name="SketcherSolverFailedColor">#ff9090</FCText>
<FCText Name="SketcherUnderConstrainedColor">#ffffff</FCText>
<FCText Name="StylesheetIconsColor">white</FCText>
<FCText Name="TabbarBackgroundColor">@PrimaryColorDarken5</FCText>
<FCText Name="InActiveTabBackgroundColor">@PrimaryColorDarken2</FCText>
<FCText Name="ActiveTabBackgroundColor">@3DViewBackgroundRefColor</FCText>
<FCText Name="TextDisabledColor">darken(@TextForegroundColor,40)</FCText>
<FCText Name="TextEditFieldBackgroundColor">@PrimaryColor</FCText>
<FCText Name="TextForegroundColor">#ffffff</FCText>
<FCText Name="TextSelectBackgroundColor">darken(@AccentColor,100)</FCText>
<FCText Name="TextUrlColor">#0095ff</FCText>
<FCText Name="ToolbarButtonsPadding">2px</FCText>
<FCText Name="AccentColor">@ThemeAccentColor1</FCText>
<FCText Name="AccentBackgroundColor">blend(@GeneralBackgroundColor,@AccentColor,60)</FCText>
<FCText Name="AccentHoverColor">blend(@GeneralBackgroundHoverColor,@AccentColor,30)</FCText>
</FCParamGroup>
<FCParamGroup Name="Tokens"/>
</FCParamGroup>
<FCParamGroup Name="TreeView">
<FCInt Name="FontSize" Value="11"/>

View File

@@ -119,68 +119,6 @@
<FCUInt Name="ThemeAccentColor1" Value="1252392959"/>
<FCUInt Name="ThemeAccentColor2" Value="3027763199"/>
<FCUInt Name="ThemeAccentColor3" Value="1434171135"/>
<FCParamGroup Name="UserTokens">
<FCText Name="3DViewBackgroundRefColor">@BackgroundColor</FCText>
<FCText Name="ButtonBackgroundHooverColor">@ButtonTopBackgroundColor</FCText>
<FCText Name="ButtonBorderColor">@GeneralBorderColor</FCText>
<FCText Name="ButtonBorderHooverColor">@GeneralBorderColor</FCText>
<FCText Name="ButtonBottomBackgroundColor">@PrimaryColorDarken1</FCText>
<FCText Name="ButtonTopBackgroundColor">@PrimaryColorLighten3</FCText>
<FCText Name="CheckBoxBackgroundColor">@TextEditFieldBackgroundColor</FCText>
<FCText Name="CheckBoxBorderColor">@GeneralBorderColor</FCText>
<FCText Name="DialogBackgroundColor">@PrimaryColorLighten4</FCText>
<FCText Name="GeneralAlternateBackgroundColor">@PrimaryColor</FCText>
<FCText Name="GeneralBackgroundColor">@PrimaryColor</FCText>
<FCText Name="GeneralBackgroundHoverColor">@PrimaryColorLighten5</FCText>
<FCText Name="GeneralBorderColor">@PrimaryColorDarken4</FCText>
<FCText Name="GeneralBorderHoverColor">@PrimaryColorDarken5</FCText>
<FCText Name="GeneralDisabledBackgroundColor">@PrimaryColorDarken3</FCText>
<FCText Name="GeneralGridLinesColor">@PrimaryColorDarken4</FCText>
<FCText Name="GeneralHeaderBackgroundColor">@PrimaryColorDarken2</FCText>
<FCText Name="GroupboxBackgroundColor">@PrimaryColorLighten2</FCText>
<FCText Name="GroupboxBorderColor">darken(@GroupboxBackgroundColor,20)</FCText>
<FCText Name="IconsLocationFolderName">images_classic</FCText>
<FCText Name="InputFieldBorderRadius">3px</FCText>
<FCText Name="MenuBackgroundColor">@PrimaryColorLighten1</FCText>
<FCText Name="PrimaryColor">#F0F0F0</FCText>
<FCText Name="PrimaryColorDarken1">darken(@PrimaryColor,4)</FCText>
<FCText Name="PrimaryColorDarken2">darken(@PrimaryColor,8)</FCText>
<FCText Name="PrimaryColorDarken3">darken(@PrimaryColor,10)</FCText>
<FCText Name="PrimaryColorDarken4">darken(@PrimaryColor,20)</FCText>
<FCText Name="PrimaryColorDarken5">darken(@PrimaryColor,200)</FCText>
<FCText Name="PrimaryColorDarken6">darken(@PrimaryColor,5890)</FCText>
<FCText Name="PrimaryColorLighten1">lighten(@PrimaryColor,2)</FCText>
<FCText Name="PrimaryColorLighten2">lighten(@PrimaryColor,3)</FCText>
<FCText Name="PrimaryColorLighten3">lighten(@PrimaryColor,4)</FCText>
<FCText Name="PrimaryColorLighten4">lighten(@PrimaryColor,5)</FCText>
<FCText Name="PrimaryColorLighten5">lighten(@PrimaryColor,6)</FCText>
<FCText Name="PrimaryColorLighten6">lighten(@PrimaryColor,7)</FCText>
<FCText Name="RadioButtonBackgroundColor">@CheckBoxBackgroundColor</FCText>
<FCText Name="RadioButtonBorderColor">@GeneralBorderColor</FCText>
<FCText Name="ScrollbarBackgroundColor">@GeneralDisabledBackgroundColor</FCText>
<FCText Name="SketcherConflictingConstraintsColor">#9d0000</FCText>
<FCText Name="SketcherEmptySketchColor">#000000</FCText>
<FCText Name="SketcherFullyConstrainedColor">#278100</FCText>
<FCText Name="SketcherMalformedConstraintsColor">#9d0000</FCText>
<FCText Name="SketcherPartiallyRedundantConstraintsColor">#005991</FCText>
<FCText Name="SketcherRedundantConstraintsColor">#ab4d00</FCText>
<FCText Name="SketcherSolverFailedColor">#9d0000</FCText>
<FCText Name="SketcherUnderConstrainedColor">#000000</FCText>
<FCText Name="StylesheetIconsColor">black</FCText>
<FCText Name="TabbarBackgroundColor">@PrimaryColorDarken4</FCText>
<FCText Name="InActiveTabBackgroundColor">@PrimaryColorDarken2</FCText>
<FCText Name="ActiveTabBackgroundColor">@3DViewBackgroundRefColor</FCText>
<FCText Name="TextDisabledColor">darken(@TabbarBackgroundColor,80)</FCText>
<FCText Name="TextEditFieldBackgroundColor">@PrimaryColorLighten3</FCText>
<FCText Name="TextForegroundColor">#000000</FCText>
<FCText Name="TextSelectBackgroundColor">@AccentHoverColor</FCText>
<FCText Name="TextUrlColor">#0061a7</FCText>
<FCText Name="AccentColor">@ThemeAccentColor1</FCText>
<FCText Name="AccentBackgroundColor">blend(@GeneralBackgroundColor,@AccentColor,60)</FCText>
<FCText Name="AccentHoverColor">blend(@GeneralBackgroundHoverColor,@AccentColor,30)</FCText>
<FCText Name="ToolbarButtonsPadding">2px</FCText>
</FCParamGroup>
<FCParamGroup Name="Tokens"/>
</FCParamGroup>
<FCParamGroup Name="TreeView">
<FCUInt Name="TreeActiveColor" Value="1538528255"/>

View File

@@ -6,6 +6,11 @@ SET(Stylesheets_Files
"FreeCAD Light.qss"
)
SET(Parameters_Files
"parameters/FreeCAD Dark.yaml"
"parameters/FreeCAD Light.yaml"
)
SET(Overlay_Stylesheets_Files
"overlay/Freecad Overlay.qss"
#remove below after testing new stylesheet system 8/6/2025
@@ -35,11 +40,12 @@ SOURCE_GROUP("overlay_icons" FILES ${Overlay_icons})
ADD_CUSTOM_TARGET(Stylesheets_data ALL
SOURCES ${Stylesheets_Files} ${Images_Files} ${Images_Files2} ${Overlay_Stylesheets_Files} ${Overlay_icons}
SOURCES ${Stylesheets_Files} ${Parameters_Files} ${Images_Files} ${Images_Files2} ${Overlay_Stylesheets_Files} ${Overlay_icons}
)
fc_copy_sources(Stylesheets_data "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Gui/Stylesheets"
${Stylesheets_Files}
${Parameters_Files}
${Images_Files}
${Images_Files2}
${Overlay_Stylesheets_Files}
@@ -51,6 +57,12 @@ INSTALL(
DESTINATION
${CMAKE_INSTALL_DATADIR}/Gui/Stylesheets
)
INSTALL(
FILES
${Parameters_Files}
DESTINATION
${CMAKE_INSTALL_DATADIR}/Gui/Stylesheets/parameters
)
INSTALL(
FILES
${Overlay_Stylesheets_Files}

View File

@@ -0,0 +1,59 @@
3DViewBackgroundRefColor: "@BackgroundColor"
ButtonBackgroundHooverColor: "@ButtonTopBackgroundColor"
ButtonBorderColor: "@GeneralBorderColor"
ButtonBorderHooverColor: "@GeneralBorderColor"
ButtonBottomBackgroundColor: "@PrimaryColorLighten2"
ButtonTopBackgroundColor: "@PrimaryColorLighten3"
CheckBoxBackgroundColor: "@TextEditFieldBackgroundColor"
CheckBoxBorderColor: "@GeneralBorderColor"
DialogBackgroundColor: "@PrimaryColorLighten3"
GeneralAlternateBackgroundColor: "@PrimaryColorLighten2"
GeneralBackgroundColor: "@PrimaryColor"
GeneralBackgroundHoverColor: "@PrimaryColorLighten4"
GeneralBorderColor: "@PrimaryColorDarken5"
GeneralBorderHoverColor: "@PrimaryColorLighten6"
GeneralDisabledBackgroundColor: "@PrimaryColorDarken3"
GeneralGridLinesColor: "@PrimaryColorLighten3"
GeneralHeaderBackgroundColor: "@PrimaryColor"
GroupboxBackgroundColor: "@PrimaryColorLighten4"
GroupboxBorderColor: "lighten(@GroupboxBackgroundColor,20)"
IconsLocationFolderName: "images_classic"
InputFieldBorderRadius: "3px"
MenuBackgroundColor: "@PrimaryColorDarken4"
PrimaryColor: "#191919"
PrimaryColorDarken1: "darken(@PrimaryColor,5)"
PrimaryColorDarken2: "darken(@PrimaryColor,8)"
PrimaryColorDarken3: "darken(@PrimaryColor,15)"
PrimaryColorDarken4: "darken(@PrimaryColor,20)"
PrimaryColorDarken5: "darken(@PrimaryColor,200)"
PrimaryColorDarken6: "darken(@PrimaryColor,5890)"
PrimaryColorLighten1: "lighten(@PrimaryColor,20)"
PrimaryColorLighten2: "lighten(@PrimaryColor,40)"
PrimaryColorLighten3: "lighten(@PrimaryColor,80)"
PrimaryColorLighten4: "lighten(@PrimaryColor,100)"
PrimaryColorLighten5: "lighten(@PrimaryColor,300)"
PrimaryColorLighten6: "lighten(@PrimaryColor,5890)"
RadioButtonBackgroundColor: "@CheckBoxBackgroundColor"
RadioButtonBorderColor: "@GeneralBorderColor"
ScrollbarBackgroundColor: "@GeneralDisabledBackgroundColor"
SketcherConflictingConstraintsColor: "#fc6c6c"
SketcherEmptySketchColor: "#ffffff"
SketcherFullyConstrainedColor: "#8cff5b"
SketcherMalformedConstraintsColor: "#fc6c6c"
SketcherPartiallyRedundantConstraintsColor: "#77cbff"
SketcherRedundantConstraintsColor: "#ffa256"
SketcherSolverFailedColor: "#ff9090"
SketcherUnderConstrainedColor: "#ffffff"
StylesheetIconsColor: "white"
TabbarBackgroundColor: "@PrimaryColorDarken5"
InActiveTabBackgroundColor: "@PrimaryColorDarken2"
ActiveTabBackgroundColor: "@3DViewBackgroundRefColor"
TextDisabledColor: "darken(@TextForegroundColor,40)"
TextEditFieldBackgroundColor: "@PrimaryColor"
TextForegroundColor: "#ffffff"
TextSelectBackgroundColor: "darken(@AccentColor,100)"
TextUrlColor: "#0095ff"
ToolbarButtonsPadding: "2px"
AccentColor: "@ThemeAccentColor1"
AccentBackgroundColor: "blend(@GeneralBackgroundColor,@AccentColor,60)"
AccentHoverColor: "blend(@GeneralBackgroundHoverColor,@AccentColor,30)"

View File

@@ -0,0 +1,59 @@
3DViewBackgroundRefColor: "@BackgroundColor"
ButtonBackgroundHooverColor: "@ButtonTopBackgroundColor"
ButtonBorderColor: "@GeneralBorderColor"
ButtonBorderHooverColor: "@GeneralBorderColor"
ButtonBottomBackgroundColor: "@PrimaryColorDarken1"
ButtonTopBackgroundColor: "@PrimaryColorLighten3"
CheckBoxBackgroundColor: "@TextEditFieldBackgroundColor"
CheckBoxBorderColor: "@GeneralBorderColor"
DialogBackgroundColor: "@PrimaryColorLighten4"
GeneralAlternateBackgroundColor: "@PrimaryColor"
GeneralBackgroundColor: "@PrimaryColor"
GeneralBackgroundHoverColor: "@PrimaryColorLighten5"
GeneralBorderColor: "@PrimaryColorDarken4"
GeneralBorderHoverColor: "@PrimaryColorDarken5"
GeneralDisabledBackgroundColor: "@PrimaryColorDarken3"
GeneralGridLinesColor: "@PrimaryColorDarken4"
GeneralHeaderBackgroundColor: "@PrimaryColorDarken2"
GroupboxBackgroundColor: "@PrimaryColorLighten2"
GroupboxBorderColor: "darken(@GroupboxBackgroundColor,20)"
IconsLocationFolderName: "images_classic"
InputFieldBorderRadius: "3px"
MenuBackgroundColor: "@PrimaryColorLighten1"
PrimaryColor: "#F0F0F0"
PrimaryColorDarken1: "darken(@PrimaryColor,4)"
PrimaryColorDarken2: "darken(@PrimaryColor,8)"
PrimaryColorDarken3: "darken(@PrimaryColor,10)"
PrimaryColorDarken4: "darken(@PrimaryColor,20)"
PrimaryColorDarken5: "darken(@PrimaryColor,200)"
PrimaryColorDarken6: "darken(@PrimaryColor,5890)"
PrimaryColorLighten1: "lighten(@PrimaryColor,2)"
PrimaryColorLighten2: "lighten(@PrimaryColor,3)"
PrimaryColorLighten3: "lighten(@PrimaryColor,4)"
PrimaryColorLighten4: "lighten(@PrimaryColor,5)"
PrimaryColorLighten5: "lighten(@PrimaryColor,6)"
PrimaryColorLighten6: "lighten(@PrimaryColor,7)"
RadioButtonBackgroundColor: "@CheckBoxBackgroundColor"
RadioButtonBorderColor: "@GeneralBorderColor"
ScrollbarBackgroundColor: "@GeneralDisabledBackgroundColor"
SketcherConflictingConstraintsColor: "#9d0000"
SketcherEmptySketchColor: "#000000"
SketcherFullyConstrainedColor: "#278100"
SketcherMalformedConstraintsColor: "#9d0000"
SketcherPartiallyRedundantConstraintsColor: "#005991"
SketcherRedundantConstraintsColor: "#ab4d00"
SketcherSolverFailedColor: "#9d0000"
SketcherUnderConstrainedColor: "#000000"
StylesheetIconsColor: "black"
TabbarBackgroundColor: "@PrimaryColorDarken4"
InActiveTabBackgroundColor: "@PrimaryColorDarken2"
ActiveTabBackgroundColor: "@3DViewBackgroundRefColor"
TextDisabledColor: "darken(@TabbarBackgroundColor,80)"
TextEditFieldBackgroundColor: "@PrimaryColorLighten3"
TextForegroundColor: "#000000"
TextSelectBackgroundColor: "@AccentHoverColor"
TextUrlColor: "#0061a7"
AccentColor: "@ThemeAccentColor1"
AccentBackgroundColor: "blend(@GeneralBackgroundColor,@AccentColor,60)"
AccentHoverColor: "blend(@GeneralBackgroundHoverColor,@AccentColor,30)"
ToolbarButtonsPadding: "2px"