-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathjpilot-common.css
More file actions
482 lines (415 loc) · 14.3 KB
/
Copy pathjpilot-common.css
File metadata and controls
482 lines (415 loc) · 14.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
/***********************************************************************
* jpilot-common.css - shared widget rules for all J-Pilot themes
*
* This file is not a theme by itself, and is deliberately named with
* the jpilot- prefix so it does not appear in the theme picker: the
* preferences list offers every *.css file except that prefix, which is
* reserved for shared support files.
*
* Each <theme>.css file defines its palette and then imports this file:
*
* @define-color jp_accent #3584e4;
* @define-color jp_accent_fg #ffffff;
* @import url("jpilot-common.css");
*
* Everything here is layered on top of the user's system GTK theme
* rather than replacing it, so J-Pilot picks up the current platform
* look (including the dark variant) automatically. All surfaces are
* derived from the system colors -- @theme_bg_color, @theme_base_color,
* @theme_fg_color, @borders -- so switching the desktop between light
* and dark needs no changes here. Only the accent hue is a literal,
* and it is supplied by the theme file.
*
* Required from the theme file:
* @jp_accent the theme hue, used for selection, focus, the
* active tab underline and the today marker
* @jp_accent_fg text drawn on top of @jp_accent
* @jp_check_fg the checkmark/dot glyph in a checked check or radio;
* usually black, separate from @jp_accent_fg so the
* checkmark can be dark while accent text stays light
* @jp_chrome background for the window and its chrome -- menus,
* buttons, tabs, list headers. Set it to a mix of
* @theme_bg_color and the hue to tint the interface,
* or to plain @theme_bg_color for no tint.
* @jp_content background for the surfaces the user reads -- text
* entries, note fields, the record list, the calendar
* grid. A mix of @theme_base_color and the hue, or
* plain @theme_base_color for no tint.
*
* Each theme chooses its own strengths; deriving them here would fix
* one strength for every theme, because mix() takes a literal factor
* and GTK has no way to parameterise it.
*
* Chrome vs content
* -----------------
* The two are tinted separately and to very different degrees. Chrome
* is what the user looks past, so it carries the hue strongly. Content
* is what the user reads, so it takes only a light wash -- enough to
* belong to the theme, not enough to hurt text contrast. The classic
* themes tinted content this way too (a pale #d9e6ff rather than
* white); what made them hard to read was tinting it as heavily as the
* chrome, which this split avoids.
***********************************************************************/
/*-------------------------------------------------------------------
* Derived colors. Defined in terms of the system theme so that the
* light and dark variants both work without a separate palette.
*-----------------------------------------------------------------*/
/* A surface slightly raised from the chrome background, used for
controls that need to read as distinct from the window behind them.
mix() toward the foreground darkens on light themes and lightens on
dark ones, so one definition serves both. */
@define-color jp_surface mix(@jp_chrome, @theme_fg_color, 0.06);
@define-color jp_surface_sunken mix(@jp_chrome, @theme_fg_color, 0.12);
/* Hairline separators, quieter than the system @borders. */
@define-color jp_border alpha(@borders, 0.7);
@define-color jp_border_soft alpha(@borders, 0.4);
/* Accent washes. alpha() keeps these legible on light and dark. */
@define-color jp_accent_wash alpha(@jp_accent, 0.12);
@define-color jp_accent_wash_2 alpha(@jp_accent, 0.20);
/* Secondary text: dimmed foreground rather than a fixed gray, so it
stays readable when the desktop switches to dark. Mixed toward
@jp_chrome rather than @theme_bg_color so that it dims against the
surface it is actually drawn on -- with a strong tint the two differ,
and mixing toward the untinted background loses contrast. */
@define-color jp_dim_fg mix(@theme_fg_color, @jp_chrome, 0.35);
/*-------------------------------------------------------------------
* Chrome
*
* The window background, and the containers that inherit from it.
* Content widgets override this with @jp_content further down, so the
* strong tint here does not reach anything the user reads.
*-----------------------------------------------------------------*/
window,
dialog,
messagedialog {
background-color: @jp_chrome;
color: @theme_fg_color;
}
/* Layout containers are left transparent so they show the window
colour rather than each needing its own rule. */
box,
grid,
paned,
viewport {
background-color: transparent;
}
/* The panel divider, visible against a tinted window. */
paned > separator {
background-color: @jp_border_soft;
}
/*-------------------------------------------------------------------
* Base spacing
*
* The single biggest visual problem with the old themes was that
* nothing had padding -- every widget butted directly against its
* neighbour. These give the layout room to breathe.
*-----------------------------------------------------------------*/
entry {
/* The vertical margin is what separates stacked fields in the
record forms. Without it the entries share edges, the rounded
corners never show, and the form reads as one solid block. */
margin: 2px 0;
/* Height comes from min-height rather than vertical padding. The
system theme already sets a min-height on entries; adding vertical
padding on top of it stacks, which made these 46px tall and
squeezed the gaps out of the multi-row record forms. */
min-height: 24px;
padding: 2px 8px;
border-radius: 6px;
border: 1px solid @jp_border;
background-color: @jp_content;
caret-color: @jp_accent;
}
entry:focus {
border-color: @jp_accent;
box-shadow: inset 0 0 0 1px @jp_accent;
}
entry:disabled {
color: @jp_dim_fg;
background-color: @jp_surface;
}
/* The multi-line description and note fields. Styled to match entry
so a record form reads as one set of controls. */
textview {
background-color: @jp_content;
}
textview.view {
padding: 4px;
border-radius: 6px;
background-color: @jp_content;
}
textview text {
background-color: @jp_content;
}
textview text selection {
background-color: @jp_accent;
color: @jp_accent_fg;
}
/* GtkTextView is wrapped in a scrolledwindow frame; round the frame
rather than the text node so the border follows the corner. Only
the radius is set here -- the system theme already draws the border,
and adding one would put boxes around frames elsewhere in J-Pilot
that are meant to be invisible. */
scrolledwindow.frame,
frame > border {
border-radius: 6px;
}
button {
min-height: 28px;
padding: 2px 12px;
border-radius: 6px;
border: 1px solid @jp_border;
background-image: none;
background-color: @jp_surface;
}
button:hover {
background-color: @jp_accent_wash;
border-color: @jp_accent;
}
button:active,
button:checked {
background-color: @jp_accent;
border-color: @jp_accent;
color: @jp_accent_fg;
}
button:disabled {
color: @jp_dim_fg;
background-color: @jp_chrome;
}
/* Combo boxes read as one control rather than a button glued to a box. */
combobox button.combo {
min-height: 28px;
padding: 2px 8px;
border-radius: 6px;
}
/*-------------------------------------------------------------------
* Record list (GtkTreeView)
*
* The list of records is the widget the user spends the most time
* reading, so it gets a quiet header, roomy rows and an accent
* selection instead of a saturated slab of color.
*-----------------------------------------------------------------*/
/* No border-radius here. A treeview renders this node once per cell,
not once for the whole list, so a radius rounds every cell corner and
lets the window background show through where four cells meet -- the
gaps read as small plus signs down each column boundary. The list's
outer corners are rounded by the scrolledwindow frame instead. */
treeview.view {
background-color: @jp_content;
}
treeview.view:hover {
background-color: @jp_accent_wash;
}
treeview.view:selected,
treeview.view:selected:focus {
background-color: @jp_accent;
color: @jp_accent_fg;
}
/* Keep the selection visible, just muted, when focus moves away. */
treeview.view:selected:backdrop {
background-color: @jp_accent_wash_2;
color: @theme_fg_color;
}
treeview.view header button {
min-height: 28px;
padding: 2px 8px;
border-radius: 0;
border: none;
border-bottom: 1px solid @jp_border;
background-color: @jp_chrome;
background-image: none;
color: @jp_dim_fg;
font-weight: bold;
}
treeview.view header button:hover {
background-color: @jp_surface;
color: @theme_fg_color;
}
/*-------------------------------------------------------------------
* Notebook (the Name / Addr(W) / Addr(H) ... tab strip)
*
* The active tab is marked with an accent underline -- the current
* GNOME idiom -- rather than by filling it with color. Unselected
* tabs stay at readable contrast; the old themes dimmed them so far
* that they looked disabled.
*-----------------------------------------------------------------*/
notebook {
background-color: @jp_chrome;
}
notebook > header {
background-color: @jp_chrome;
border-color: @jp_border;
}
notebook > header.top {
border-bottom: 1px solid @jp_border;
}
/* No negative margins: the old themes pulled the tab row into the
page below it, which let tab text bleed over the first form row. */
notebook > header > tabs {
margin: 0;
}
notebook > header > tabs > tab {
min-height: 32px;
padding: 4px 14px;
margin: 0;
border: none;
background-color: transparent;
/* Reserve the underline up front so the label does not shift by
2px when the tab becomes active. */
box-shadow: inset 0 -2px transparent;
color: @jp_dim_fg;
font-weight: normal;
}
notebook > header > tabs > tab:hover {
box-shadow: inset 0 -2px @jp_border;
color: @theme_fg_color;
}
notebook > header > tabs > tab:checked {
box-shadow: inset 0 -2px @jp_accent;
background-color: transparent;
color: @jp_accent;
font-weight: bold;
}
/* The old rules used tab:not(checked) -- a missing colon, so "checked"
parsed as a type selector and the rule never matched. These two
replace it and are what actually control the tab label colors. */
notebook > header > tabs > tab:not(:checked) label {
color: @jp_dim_fg;
background-color: transparent;
}
notebook > header > tabs > tab:checked label {
color: @jp_accent;
background-color: transparent;
}
/* The page body. An opaque background here is what stops the
inactive tab labels from showing through the form. */
notebook > stack {
background-color: @jp_chrome;
}
/*-------------------------------------------------------------------
* Calendar
*-----------------------------------------------------------------*/
calendar {
padding: 4px;
border: 1px solid @jp_border;
border-radius: 6px;
background-color: @jp_content;
color: @theme_fg_color;
}
calendar.header {
background-color: @jp_chrome;
color: @theme_fg_color;
border-bottom: 1px solid @jp_border_soft;
font-weight: bold;
}
calendar.button {
padding: 2px;
border: none;
background-color: transparent;
}
calendar.button:hover {
background-color: @jp_accent_wash;
border-radius: 4px;
}
calendar.button:disabled {
color: @jp_dim_fg;
background-color: transparent;
}
/* Day names row and days spilling in from the adjacent month. */
calendar:indeterminate {
color: alpha(@theme_fg_color, 0.35);
}
calendar:selected {
background-color: @jp_accent;
color: @jp_accent_fg;
border-radius: 4px;
}
/* Days carrying an appointment. */
calendar.highlight {
color: @jp_accent;
background-color: transparent;
font-weight: bold;
}
/*-------------------------------------------------------------------
* J-Pilot specific widgets
*
* These four names are set from the C source:
* button_app jpilot.c the application launcher buttons
* button_label address_gui.c
* label_high address_gui.c a highlighted field label
* today datebook the "Today is ..." banner
*-----------------------------------------------------------------*/
/* Launcher buttons down the left edge. Flat until pointed at, so the
icons read as a toolbar rather than a column of raised boxes. */
#button_app {
padding: 4px;
border: none;
border-radius: 8px;
background-color: transparent;
background-image: none;
}
#button_app:hover {
background-color: @jp_accent_wash;
}
#button_app:active,
#button_app:checked {
background-color: @jp_accent_wash_2;
}
#button_label {
font-size: 100%;
}
/* Highlighted field label -- accent text instead of a blue block. */
#label_high {
color: @jp_accent;
font-weight: bold;
background-color: transparent;
}
/* The "Today is <date>" banner. A tinted bar reads as information;
the old solid navy slab read as a selected control. */
#today {
background-color: @jp_accent_wash;
border-radius: 6px;
}
#today text {
color: @jp_accent;
background-color: transparent;
font-weight: bold;
}
/*-------------------------------------------------------------------
* Misc chrome
*-----------------------------------------------------------------*/
menubar {
background-color: @jp_chrome;
border-bottom: 1px solid @jp_border_soft;
}
menubar > menuitem {
padding: 4px 10px;
}
menubar > menuitem:hover {
background-color: @jp_accent_wash;
color: @theme_fg_color;
}
scrolledwindow viewport,
scrolledwindow {
border-radius: 6px;
}
checkbutton,
radiobutton {
padding: 2px 4px;
}
check:checked,
radio:checked {
background-color: @jp_accent;
border-color: @jp_accent;
/* The checkmark/dot glyph. Kept separate from @jp_accent_fg (used for
selected-row and button text) so a theme can use a black checkmark on a
light accent without darkening its other accent text. */
color: @jp_check_fg;
}
separator {
background-color: @jp_border_soft;
}
progressbar progress {
background-color: @jp_accent;
border-radius: 3px;
}