Skip to content

Commit eba96e4

Browse files
committed
Unify light theme surfaces and style Fluent navigation for readability
1 parent 34db4cd commit eba96e4

File tree

1 file changed

+97
-27
lines changed

1 file changed

+97
-27
lines changed

markitdowngui/ui/themes.py

Lines changed: 97 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from PySide6.QtGui import QColor, QPalette
44
from qfluentwidgets import Theme, isDarkTheme, setTheme, setThemeColor
55

6-
SOLARIZED_ACCENT = "#268BD2"
6+
SOLARIZED_ACCENT = "#2AA198"
77
NORD_ACCENT = "#88C0D0"
88
ACCENT_COLOR = SOLARIZED_ACCENT
99

@@ -28,6 +28,10 @@ def build_app_stylesheet(is_dark: bool) -> str:
2828
if is_dark:
2929
panel_bg_a = "#2E3440"
3030
panel_bg_b = "#3B4252"
31+
window_bg = "#2B313D"
32+
stack_bg = "#313947"
33+
nav_bg = "#2E3440"
34+
nav_border = "#4C566A"
3135
card_bg = "#3B4252"
3236
card_bg_alt = "#434C5E"
3337
border = "#4C566A"
@@ -39,96 +43,162 @@ def build_app_stylesheet(is_dark: bool) -> str:
3943
accent = NORD_ACCENT
4044
else:
4145
panel_bg_a = "#FDF6E3"
42-
panel_bg_b = "#EEE8D5"
43-
card_bg = "#FDF8E8"
44-
card_bg_alt = "#FAF3DF"
45-
border = "#D8CCAA"
46-
text = "#586E75"
47-
subtext = "#657B83"
48-
input_bg = "#FFFDF5"
49-
hover = "#EEE8D5"
50-
title = "#073642"
46+
panel_bg_b = "#F7F0DB"
47+
window_bg = "#F6EFD8"
48+
stack_bg = "#FAF4E2"
49+
nav_bg = "#F2EAD3"
50+
nav_border = "#D9CCA8"
51+
card_bg = "#FFFDF7"
52+
card_bg_alt = "#FFF9EB"
53+
border = "#D9CCA8"
54+
text = "#4F646A"
55+
subtext = "#61767C"
56+
input_bg = "#FFFDF6"
57+
hover = "#EFE5CB"
58+
title = "#2B3F45"
5159
accent = SOLARIZED_ACCENT
5260

5361
return f"""
62+
FluentWindowBase {{
63+
background-color: {window_bg};
64+
}}
65+
66+
FluentTitleBar, SplitTitleBar {{
67+
background-color: transparent;
68+
}}
69+
70+
FluentTitleBar>QLabel#titleLabel, SplitTitleBar>QLabel#titleLabel {{
71+
color: {title};
72+
font-size: 14px;
73+
font-weight: 600;
74+
}}
75+
76+
StackedWidget {{
77+
background-color: {stack_bg};
78+
border: 1px solid {border};
79+
border-right: none;
80+
border-bottom: none;
81+
border-top-left-radius: 12px;
82+
}}
83+
84+
NavigationInterface {{
85+
background-color: {nav_bg};
86+
}}
87+
88+
NavigationPanel[menu=false] {{
89+
background-color: {nav_bg};
90+
border: none;
91+
border-right: 1px solid {nav_border};
92+
border-top-right-radius: 0px;
93+
border-bottom-right-radius: 0px;
94+
}}
95+
96+
NavigationPanel[menu=true] {{
97+
background-color: {nav_bg};
98+
border: 1px solid {nav_border};
99+
border-top-right-radius: 8px;
100+
border-bottom-right-radius: 8px;
101+
}}
102+
103+
NavigationPanel QScrollArea, NavigationPanel #scrollWidget {{
104+
border: none;
105+
background: transparent;
106+
}}
107+
54108
QWidget#SettingsInterface, QWidget#HelpInterface, QWidget#HomeInterface {{
55109
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 {panel_bg_a}, stop:1 {panel_bg_b});
56-
font-size: 15px;
110+
font-size: 14px;
57111
}}
112+
58113
CardWidget, ElevatedCardWidget, SimpleCardWidget {{
59114
background: {card_bg};
60115
border: 1px solid {border};
61116
border-radius: 14px;
62117
}}
118+
63119
QGroupBox {{
64120
border: 1px solid {border};
65121
border-radius: 12px;
66122
margin-top: 16px;
67123
padding: 14px 14px 14px 14px;
68-
font-size: 17px;
124+
font-size: 16px;
69125
font-weight: 700;
70126
color: {title};
71127
background: {card_bg_alt};
72128
}}
129+
73130
QGroupBox::title {{
74131
subcontrol-origin: margin;
75132
left: 12px;
76133
padding: 0 8px;
77134
color: {title};
78-
font-size: 18px;
79-
font-weight: 800;
135+
font-size: 16px;
136+
font-weight: 700;
80137
background: transparent;
81138
}}
139+
82140
BodyLabel, CaptionLabel, TitleLabel, SubtitleLabel {{
83141
color: {text};
84142
}}
143+
85144
TitleLabel {{
86-
font-size: 34px;
145+
font-size: 30px;
87146
font-weight: 800;
88147
color: {title};
89-
letter-spacing: 0.3px;
148+
letter-spacing: 0.2px;
90149
}}
150+
91151
SubtitleLabel {{
92-
font-size: 20px;
152+
font-size: 18px;
93153
font-weight: 700;
94154
color: {title};
95155
}}
156+
96157
BodyLabel {{
97-
font-size: 16px;
98-
font-weight: 600;
158+
font-size: 15px;
159+
font-weight: 500;
99160
}}
161+
100162
CaptionLabel {{
101-
font-size: 14px;
163+
font-size: 13px;
102164
color: {subtext};
103165
}}
166+
104167
QPushButton, PrimaryPushButton, PillPushButton, HyperlinkButton, QRadioButton, QCheckBox {{
105168
font-size: 14px;
106-
font-weight: 600;
169+
font-weight: 500;
107170
}}
171+
108172
QComboBox, ComboBox, SpinBox, QAbstractSpinBox, QLineEdit {{
109173
font-size: 15px;
110174
}}
175+
111176
QTextEdit, QTextBrowser, QListWidget, QLineEdit {{
112177
background: {input_bg};
113178
border: 1px solid {border};
114179
border-radius: 8px;
115180
color: {text};
116181
font-size: 15px;
117182
}}
183+
118184
QTextEdit:focus, QTextBrowser:focus, QListWidget:focus, QLineEdit:focus {{
119185
border: 1px solid {accent};
120186
}}
187+
121188
QListWidget::item {{
122189
padding: 8px 10px;
123190
}}
191+
124192
QListWidget::item:selected {{
125193
background: {hover};
126194
}}
195+
127196
QSplitter::handle {{
128197
background: {border};
129198
margin: 2px;
130199
border-radius: 2px;
131200
}}
201+
132202
QSplitter::handle:hover {{
133203
background: {subtext};
134204
}}
@@ -145,12 +215,12 @@ def markdown_html_css(is_dark: bool) -> str:
145215
border = "#4C566A"
146216
muted = "#D8DEE9"
147217
else:
148-
bg = "#FFFDF5"
149-
text = "#586E75"
150-
link = "#268BD2"
151-
code_bg = "#FAF3DF"
152-
border = "#D8CCAA"
153-
muted = "#657B83"
218+
bg = "#FFFDF6"
219+
text = "#4F646A"
220+
link = "#2AA198"
221+
code_bg = "#FFF9EB"
222+
border = "#D9CCA8"
223+
muted = "#61767C"
154224

155225
return (
156226
"body {"

0 commit comments

Comments
 (0)