Skip to content

Commit

Permalink
Themes improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
PaddleStroke committed Jan 28, 2025
1 parent a30edd0 commit 8f814d9
Show file tree
Hide file tree
Showing 13 changed files with 345 additions and 64 deletions.
6 changes: 2 additions & 4 deletions src/Gui/PreferencePacks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ SET(PreferencePacks_Files
)

SET(PreferencePacks_Directories
"FreeCAD Classic"
"Dark behave"
"FreeCAD Light"
"FreeCAD Dark"
"Light"
"Dark"
)

ADD_CUSTOM_TARGET(PreferencePacks_data ALL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<FCText Name="OverlayActiveStyleSheet">Dark Theme + Dark Background.qss</FCText>
<FCText Name="QtStyle">Fusion</FCText>
<FCText Name="StyleSheet">FreeCAD Dark.qss</FCText>
<FCText Name="Theme">FreeCAD Dark</FCText>
<FCText Name="Theme">Dark</FCText>
</FCParamGroup>
<FCParamGroup Name="Mod">
<FCParamGroup Name="Arch">
Expand Down Expand Up @@ -98,8 +98,8 @@
<FCUInt Name="colorWarning" Value="4287913983"/>
</FCParamGroup>
<FCParamGroup Name="Themes">
<FCUInt Name="ThemeAccentColor1" Value="1252392959"/>
<FCUInt Name="ThemeAccentColor2" Value="3027763199"/>
<FCUInt Name="ThemeAccentColor1" Value="523652607"/>
<FCUInt Name="ThemeAccentColor2" Value="642476543"/>
<FCUInt Name="ThemeAccentColor3" Value="404564735"/>
</FCParamGroup>
<FCParamGroup Name="TreeView">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<FCText Name="OverlayActiveStyleSheet">Light Theme + Light Background.qss</FCText>
<FCText Name="QtStyle">Fusion</FCText>
<FCText Name="StyleSheet">FreeCAD Light.qss</FCText>
<FCText Name="Theme">FreeCAD Light</FCText>
<FCText Name="Theme">Light</FCText>
</FCParamGroup>
<FCParamGroup Name="Mod">
<FCParamGroup Name="Arch">
Expand Down Expand Up @@ -116,8 +116,8 @@
<FCUInt Name="colorWarning" Value="4252787455"/>
</FCParamGroup>
<FCParamGroup Name="Themes">
<FCUInt Name="ThemeAccentColor1" Value="1252392959"/>
<FCUInt Name="ThemeAccentColor2" Value="3027763199"/>
<FCUInt Name="ThemeAccentColor1" Value="2782461951"/>
<FCUInt Name="ThemeAccentColor2" Value="478074623"/>
<FCUInt Name="ThemeAccentColor3" Value="3353277951"/>
</FCParamGroup>
<FCParamGroup Name="TreeView">
Expand Down
14 changes: 2 additions & 12 deletions src/Gui/PreferencePacks/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,8 @@
<url type="repository">https://github.com/FreeCAD/FreeCAD</url>

<content>
<preferencepack>
<name>FreeCAD Classic</name>
<type>Theme</type>
<description>Removes stylesheets, and applies the classic purple/gray background. Resets all colors to default</description>
<version>1.0.0</version>
<tag>built-in</tag>
<tag>background</tag>
<tag>no stylesheet</tag>
<tag>classic theme</tag>
</preferencepack>
<preferencepack>
<name>FreeCAD Light</name>
<name>Light</name>
<type>Theme</type>
<description>Applies a basic light theme.</description>
<version>1.0.0</version>
Expand All @@ -28,7 +18,7 @@
<tag>light</tag>
</preferencepack>
<preferencepack>
<name>FreeCAD Dark</name>
<name>Dark</name>
<type>Theme</type>
<description>Applies a basic dark theme.</description>
<version>1.0.0</version>
Expand Down
57 changes: 36 additions & 21 deletions src/Gui/Stylesheets/FreeCAD Dark.qss
Original file line number Diff line number Diff line change
Expand Up @@ -936,12 +936,6 @@ QToolBar {
/* font-weight: bold; */
}

/* fix background color for toolbars that are the on menubar. */
QToolBar:only-one {
background-color: transparent;
/* margin-top: -3px; */
}

QToolBar:horizontal {
padding-top: 3px;
padding-left: 3px;
Expand All @@ -955,6 +949,15 @@ QToolBar:only-one {
/* margin-top: -3px; */
}

/* fix background color for toolbars that are the on menubar. */
QToolBar:only-one {
background-color: transparent;
border-bottom: none;
margin: 0;
/* margin-top: -3px; */
}


QToolBar:vertical {
padding-top: 3px;
padding-left: 3px;
Expand Down Expand Up @@ -1642,8 +1645,7 @@ QSint--ActionGroup QFrame[class="header"] {
border-top: 1px solid #020202;
border-left: 1px solid #020202;
border-right: 1px solid #020202;
/*background-color: #d4d4d4; /* Task Panel Header background color */
background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0,stop:0 #000000, stop:1 @ThemeAccentColor3);
background-color: #252525; /* Task Panel Header background color */
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-bottom-left-radius: 0px;
Expand All @@ -1654,8 +1656,7 @@ color: #cdf5ff;
}

QSint--ActionGroup QFrame[class="header"]:hover {
/* background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0,stop:0 #000000 stop:1 #313d61); */
color: #51cdf3;
background-color: @ThemeAccentColor1;
}

QSint--ActionGroup QToolButton[class="header"] {
Expand All @@ -1670,29 +1671,29 @@ padding: 0px;
QSint--ActionGroup QFrame[class="header"] QLabel[fold="false"] {
width: 30px;
height: 30px;
image: url(qss:images_classic/qsint_header_unfold_lightgray.png);
image: url(qss:images_dark-light/more_open_dark.svg);
}

QSint--ActionGroup QFrame[class="header"] QLabel:hover[fold="false"] {
width: 30px;
height: 30px;
image: url(qss:images_classic/qsint_header_unfold_white.png);
image: url(qss:images_dark-light/more_open_dark.svg);
}

QSint--ActionGroup QFrame[class="header"] QLabel[fold="true"] {
width: 30px;
height: 30px;
image: url(qss:images_classic/qsint_header_fold_lightgray.png);
image: url(qss:images_dark-light/more_closed_dark.svg);
}

QSint--ActionGroup QFrame[class="header"] QLabel[fold="true"]:hover {
width: 30px;
height: 30px;
image: url(qss:images_classic/qsint_header_fold_white.png);
image: url(qss:images_dark-light/more_closed_dark.svg);
}

QSint--ActionGroup QFrame[class="content"] {
background-color: @ThemeAccentColor3; /* Task Panel background color */
background-color: #333333;
margin: 0px;
padding: 0px;
border-bottom: 1px solid #020202;
Expand Down Expand Up @@ -2315,22 +2316,22 @@ QTreeView::branch:!has-children:!has-siblings:adjoins-item {

QTreeView::branch:closed:has-children:has-siblings {
border-image: none;
image: url(qss:images_classic/arrow-right-white.png);
image: url(qss:images_dark-light/more_open_dark.svg);
}

QTreeView::branch:has-children:!has-siblings:closed {
border-image: none;
image: url(qss:images_classic/arrow-right-white.png);
image: url(qss:images_dark-light/more_open_dark.svg);
}

QTreeView::branch:open:has-children:has-siblings {
border-image: none;
image: url(qss:images_classic/arrow-down-white.png);
image: url(qss:images_dark-light/more_closed_dark.svg);
}

QTreeView::branch:open:has-children:!has-siblings {
border-image: none;
image: url(qss:images_classic/arrow-down-white.png);
image: url(qss:images_dark-light/more_closed_dark.svg);
}

QTreeView::indicator,
Expand Down Expand Up @@ -2432,6 +2433,10 @@ QColumnView {
selection-background-color: @ThemeAccentColor1;
}

QTreeView {
selection-background-color: transparent; /* else the branch part of the items gets colored when selected */
}

QTableView,
QListView {
background-color: #252525; /* background of a lot of stuff including spreadsheets.*/
Expand Down Expand Up @@ -2461,28 +2466,37 @@ QColumnView:focus {
}

QTreeView::item {
background-color: #252525;
margin: 3px 0px 3px 0px;
padding: 0px 3px; /* add 3 px on the left of items. Centering the item content better.*/
border-radius: 2px;
}

Gui--TreeWidget > QTreeView::item {
background-color: #2E2E2E;
}

QTreeView::item:pressed,
QListView::item:pressed,
QTableView::item:pressed,
QColumnView::item:pressed {
background-color: @ThemeAccentColor1;
background-color: @ThemeAccentColor2;
border: 1px solid @ThemeAccentColor2;
}

QTreeView::item:selected:active,
QListView::item:selected:active,
QTableView::item:selected:active,
QColumnView::item:selected:active {
background-color: @ThemeAccentColor1;
border: 1px solid @ThemeAccentColor2;
}

QTreeView::item:selected:!active,
QListView::item:selected:!active,
QTableView::item:selected:!active,
QColumnView::item:selected:!active {
background-color: @ThemeAccentColor1;
border: 1px solid @ThemeAccentColor2;
}

QTreeView::item:!selected:hover,
Expand All @@ -2492,6 +2506,7 @@ QColumnView::item:!selected:hover {
outline: 0;
color: white;
background-color: @ThemeAccentColor1;
border: 1px solid @ThemeAccentColor2;
}

QTableView::item {
Expand Down
Loading

0 comments on commit 8f814d9

Please sign in to comment.