Skip to content

Commit 5ebc12c

Browse files
Merge pull request #9 from taylorwilsdon/improve_styles
Update stylesheet & layout
2 parents 86b147d + f7f6e0a commit 5ebc12c

File tree

2 files changed

+105
-90
lines changed

2 files changed

+105
-90
lines changed

reclaimed/ui/styles.py

+101-87
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,118 @@
11
"""Shared styles for reclaimed"""
22

3-
# Solarized Dark color scheme hex values
4-
BASE03 = "#002b36"
5-
BASE02 = "#073642"
6-
BASE01 = "#586e75"
7-
BASE00 = "#657b83"
8-
BASE0 = "#839496"
9-
BASE1 = "#93a1a1"
10-
BASE2 = "#eee8d5"
11-
BASE3 = "#fdf6e3"
12-
YELLOW = "#b58900"
13-
ORANGE = "#cb4b16"
14-
RED = "#dc322f"
15-
MAGENTA = "#d33682"
16-
VIOLET = "#6c71c4"
17-
BLUE = "#268bd2"
18-
CYAN = "#2aa198"
19-
GREEN = "#859900"
3+
# Selenized Dark color scheme hex values
4+
BG_0 = "#103c48" # darkest background
5+
BG_1 = "#184956" # darker background
6+
BG_2 = "#2d5b69" # content highlights
7+
DIM_0 = "#72898f" # dimmed text
8+
FG_0 = "#adbcbc" # main text
9+
FG_1 = "#cad8d9" # emphasized text
10+
YELLOW = "#ebc13d" # bright yellow
11+
ORANGE = "#fd9456" # bright orange
12+
RED = "#ff665c" # bright red
13+
MAGENTA = "#ff84cd" # bright magenta
14+
VIOLET = "#bd96fa" # bright violet
15+
BLUE = "#58a3ff" # bright blue
16+
CYAN = "#53d6c7" # bright cyan
17+
GREEN = "#84c747" # bright green
18+
19+
# Backward compatibility with old Solarized variable names
20+
BASE03 = BG_0 # darkest background
21+
BASE02 = BG_1 # darker background
22+
BASE01 = BG_2 # content highlights
23+
BASE00 = DIM_0 # dimmed text
24+
BASE0 = FG_0 # main text
25+
BASE1 = FG_1 # emphasized text
26+
BASE2 = FG_1 # light content (mapped to emphasized text in selenized)
27+
BASE3 = FG_1 # lightest (mapped to emphasized text in selenized)
2028

2129
# CSS styles for Textual UI
2230
TEXTUAL_CSS = """
2331
/* Define all variables at the start */
24-
$base03: #002b36;
25-
$base02: #073642;
26-
$base01: #586e75;
27-
$base00: #657b83;
28-
$base0: #839496;
29-
$base1: #93a1a1;
30-
$base2: #eee8d5;
31-
$base3: #fdf6e3;
32-
$yellow: #b58900;
33-
$orange: #cb4b16;
34-
$red: #dc322f;
35-
$magenta: #d33682;
36-
$violet: #6c71c4;
37-
$blue: #268bd2;
38-
$cyan: #2aa198;
39-
$green: #859900;
32+
$bg_0: #103c48; /* darkest background */
33+
$bg_1: #184956; /* darker background */
34+
$bg_2: #2d5b69; /* content highlights */
35+
$dim_0: #72898f; /* dimmed text */
36+
$fg_0: #adbcbc; /* main text */
37+
$fg_1: #cad8d9; /* emphasized text */
38+
$yellow: #ebc13d; /* bright yellow */
39+
$orange: #fd9456; /* bright orange */
40+
$red: #ff665c; /* bright red */
41+
$magenta: #ff84cd; /* bright magenta */
42+
$violet: #bd96fa; /* bright violet */
43+
$blue: #58a3ff; /* bright blue */
44+
$cyan: #53d6c7; /* bright cyan */
45+
$green: #84c747; /* bright green */
4046
4147
4248
Screen {
43-
background: $base03;
44-
color: $base0;
49+
background: $bg_0;
50+
color: $fg_0;
4551
}
4652
4753
#header {
4854
dock: top;
4955
height: 1;
50-
background: $base02;
51-
color: $base1;
56+
background: $bg_2;
57+
color: $fg_1;
5258
text-align: center;
59+
border-bottom: solid $fg_0;
5360
}
5461
5562
#footer {
63+
height: 1;
64+
background: $bg_2;
65+
color: $fg_1;
66+
border-top: solid $fg_0;
67+
}
68+
69+
#footer-container {
5670
dock: bottom;
71+
height: 2;
72+
align-horizontal: left;
73+
}
74+
75+
#scan-progress {
76+
background: $bg_1;
77+
}
78+
79+
Footer {
5780
height: 1;
58-
background: $base02;
59-
color: $base1;
6081
}
6182
6283
#main-container {
6384
width: 100%;
6485
height: 100%;
86+
border-left: heavy $bg_2;
87+
border-right: heavy $bg_2;
6588
}
6689
6790
#title {
6891
dock: top;
69-
height: 1;
70-
background: $base02;
71-
color: $blue;
92+
height: 2;
93+
background: $bg_2;
94+
color: $fg_1;
7295
text-align: center;
96+
border-bottom: heavy $bg_1;
7397
}
7498
7599
#status-bar {
76100
dock: top;
77-
height: 1;
78-
background: $base02;
101+
height: 2;
102+
background: $bg_1;
79103
padding: 0 1;
104+
border-bottom: heavy $bg_2;
80105
}
81106
82107
#status-label {
83108
width: auto;
84-
color: $base01;
109+
color: $fg_0;
85110
}
86111
87112
#path-display {
88113
width: 1fr;
89-
color: $base1;
114+
color: $fg_0;
115+
padding: 0 1;
90116
}
91117
92118
#scan-timer {
@@ -100,13 +126,13 @@
100126
width: auto;
101127
color: $blue;
102128
text-align: right;
129+
padding-right: 1;
103130
}
104-
105131
#files-section-header, #dirs-section-header {
106132
height: 1;
107-
background: $base02;
108-
color: $blue;
109-
padding: 0 1;
133+
background: $bg_1;
134+
padding-left: 1;
135+
color: $fg_1;
110136
margin-top: 1;
111137
}
112138
@@ -117,36 +143,41 @@
117143
118144
#files-table, #dirs-table {
119145
width: 100%;
120-
background: $base03;
121-
color: $base0;
146+
color: $fg_0;
147+
background: $bg_0;
148+
border: heavy $fg_0;
122149
}
123150
124151
#dirs-table {
125-
height: 40%;
152+
height: 45%;
126153
margin-bottom: 1;
127154
}
128155
129156
#files-table {
130-
height: 40%;
157+
height: 50%;
131158
}
132159
133160
DataTable {
134161
border: none;
135162
}
136163
137164
DataTable > .datatable--header {
138-
background: $base02;
139-
color: $base1;
165+
background: $bg_1;
166+
color: $fg_1;
167+
border-bottom: heavy $bg_2;
140168
}
141169
142170
DataTable > .datatable--cursor {
143-
background: $base01;
171+
background: $bg_2;
172+
color: $fg_1;
173+
border: round $bg_1;
144174
}
145175
146176
#dialog-container {
147-
width: 60%;
177+
width: 100%;
178+
margin: 5;
148179
height: auto;
149-
background: $base02;
180+
background: $bg_1;
150181
border: tall $blue;
151182
padding: 1 2;
152183
}
@@ -155,12 +186,12 @@
155186
width: 100%;
156187
height: 1;
157188
content-align: center middle;
158-
color: $base1;
189+
color: $fg_1;
159190
}
160191
161192
#dialog-path {
162193
width: 100%;
163-
height: 3;
194+
height: 2;
164195
content-align: center middle;
165196
margin: 1 0;
166197
color: $red;
@@ -171,12 +202,13 @@
171202
height: 3;
172203
content-align: center middle;
173204
margin-top: 1;
205+
align-horizontal: center;
174206
}
175207
176208
#sort-container {
177209
width: 40%;
178210
height: auto;
179-
background: $base02;
211+
background: $bg_1;
180212
border: tall $blue;
181213
padding: 1 2;
182214
}
@@ -186,7 +218,7 @@
186218
height: 1;
187219
content-align: center middle;
188220
margin-bottom: 1;
189-
color: $base1;
221+
color: $fg_1;
190222
}
191223
192224
#sort-buttons {
@@ -198,12 +230,12 @@
198230
199231
Button {
200232
margin: 0 1;
201-
background: $base01;
202-
color: $base2;
233+
background: $bg_2;
234+
color: $fg_1;
203235
}
204236
205237
Button:hover {
206-
background: $base00;
238+
background: $dim_0;
207239
}
208240
209241
Button.primary {
@@ -219,31 +251,13 @@
219251
}
220252
221253
RadioButton {
222-
background: $base02;
223-
color: $base1;
254+
background: $bg_1;
255+
color: $fg_1;
224256
}
225257
226258
RadioButton.-selected {
227259
background: $blue;
228-
color: $base3;
260+
color: $fg_1;
229261
}
230262
231-
#footer-container {
232-
layout: horizontal;
233-
dock: bottom;
234-
height: 3;
235-
align-horizontal: left;
236-
align-vertical: middle;
237-
padding: 0 1;
238-
}
239-
240-
#scan-progress {
241-
margin-left: 2;
242-
height: 1;
243-
background: $base02;
244-
}
245-
246-
Footer {
247-
height: 1;
248-
}
249263
"""

reclaimed/ui/textual_app.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
LoadingIndicator,
2222
RadioButton,
2323
RadioSet,
24+
Rule,
2425
Static,
2526
)
2627
from textual.worker import Worker, WorkerState
@@ -150,8 +151,8 @@ def __init__(
150151

151152
def compose(self) -> ComposeResult:
152153
"""Compose the app layout."""
153-
yield Header(show_clock=True)
154-
yield Static("[bold]Reclaimed[/bold]", id="title")
154+
with Header(show_clock=True):
155+
yield Static("[bold]Reclaimed[/bold]", id="title")
155156

156157
with Container(id="main-container"):
157158
# Status bar with scan info
@@ -174,8 +175,8 @@ def compose(self) -> ComposeResult:
174175
yield files_table
175176

176177
with Horizontal(id="footer-container"):
177-
yield Footer()
178178
yield LoadingIndicator(id="scan-progress")
179+
yield Footer()
179180

180181
def on_mount(self) -> None:
181182
"""Event handler called when the app is mounted."""

0 commit comments

Comments
 (0)