Commit e7de516
committed
Simplify color management
We get rid of the colors.FIELD_BY_MODE dict and:
- define PINNED_COLOR and FOCUSED_COLOR when rows are pinned or focused;
- let the functions in colors module return the color name directly,
instead of previously indirecting to FIELD_BY_MODE dict;
- move default color values UI.make() body.
Also, the methods and attributes of types.Column are changed a bit: now
'default_color' holds the default color (or None when "normal" should be
used, but we don't repeat it there) and value_color() is the callable
(typically a function from 'colors' module), previously name
color_key().1 parent 7d73795 commit e7de516
4 files changed
+61
-165
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
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 | | - | |
| 5 | + | |
| 6 | + | |
120 | 7 | | |
121 | 8 | | |
122 | | - | |
| 9 | + | |
123 | 10 | | |
124 | 11 | | |
125 | | - | |
| 12 | + | |
126 | 13 | | |
127 | | - | |
| 14 | + | |
128 | 15 | | |
129 | | - | |
130 | | - | |
131 | | - | |
| 16 | + | |
| 17 | + | |
132 | 18 | | |
133 | 19 | | |
134 | 20 | | |
| |||
137 | 23 | | |
138 | 24 | | |
139 | 25 | | |
140 | | - | |
| 26 | + | |
141 | 27 | | |
142 | | - | |
| 28 | + | |
143 | 29 | | |
144 | 30 | | |
145 | 31 | | |
146 | | - | |
| 32 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | 101 | | |
105 | 102 | | |
106 | 103 | | |
| |||
127 | 124 | | |
128 | 125 | | |
129 | 126 | | |
130 | | - | |
131 | | - | |
132 | 127 | | |
133 | 128 | | |
134 | 129 | | |
| |||
149 | 144 | | |
150 | 145 | | |
151 | 146 | | |
152 | | - | |
153 | | - | |
154 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
155 | 151 | | |
156 | 152 | | |
157 | 153 | | |
158 | 154 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | 155 | | |
163 | 156 | | |
164 | 157 | | |
| |||
187 | 180 | | |
188 | 181 | | |
189 | 182 | | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
194 | 189 | | |
195 | 190 | | |
196 | 191 | | |
| |||
316 | 311 | | |
317 | 312 | | |
318 | 313 | | |
| 314 | + | |
319 | 315 | | |
320 | 316 | | |
321 | 317 | | |
| |||
325 | 321 | | |
326 | 322 | | |
327 | 323 | | |
| 324 | + | |
328 | 325 | | |
329 | 326 | | |
330 | 327 | | |
| |||
342 | 339 | | |
343 | 340 | | |
344 | 341 | | |
| 342 | + | |
345 | 343 | | |
346 | 344 | | |
347 | 345 | | |
348 | 346 | | |
349 | 347 | | |
350 | 348 | | |
351 | 349 | | |
352 | | - | |
| 350 | + | |
353 | 351 | | |
354 | 352 | | |
355 | 353 | | |
| |||
366 | 364 | | |
367 | 365 | | |
368 | 366 | | |
369 | | - | |
| 367 | + | |
370 | 368 | | |
371 | 369 | | |
372 | 370 | | |
373 | 371 | | |
374 | 372 | | |
375 | 373 | | |
| 374 | + | |
376 | 375 | | |
377 | 376 | | |
378 | 377 | | |
| |||
394 | 393 | | |
395 | 394 | | |
396 | 395 | | |
| 396 | + | |
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
404 | | - | |
| 404 | + | |
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
414 | | - | |
| 414 | + | |
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
| |||
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
| 431 | + | |
431 | 432 | | |
432 | 433 | | |
433 | 434 | | |
| |||
437 | 438 | | |
438 | 439 | | |
439 | 440 | | |
440 | | - | |
| 441 | + | |
441 | 442 | | |
442 | 443 | | |
443 | 444 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
| 165 | + | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| |||
0 commit comments