Fossil SCM

Provide a much larger palette of predefind background colors on the Checkin-Edit screen.

drh 2011-01-05 13:36 trunk
Commit ddf5f367652bf7e9e5416dab3c67ef83a3f2ef6e
1 file changed +44 -18
+44 -18
--- src/info.c
+++ src/info.c
@@ -1304,22 +1304,46 @@
13041304
static const struct SampleColors {
13051305
const char *zCName;
13061306
const char *zColor;
13071307
} aColor[] = {
13081308
{ "(none)", "" },
1309
- { "#f2dcdc", "#f2dcdc" },
1310
- { "#f0ffc0", "#f0ffc0" },
1311
- { "#bde5d6", "#bde5d6" },
1312
- { "#c0ffc0", "#c0ffc0" },
1313
- { "#c0fff0", "#c0fff0" },
1314
- { "#c0f0ff", "#c0f0ff" },
1315
- { "#d0c0ff", "#d0c0ff" },
1316
- { "#ffc0ff", "#ffc0ff" },
1317
- { "#ffc0d0", "#ffc0d0" },
1318
- { "#fff0c0", "#fff0c0" },
1319
- { "#c0c0c0", "#c0c0c0" },
1320
- { "custom", "##" },
1309
+ { "#f2dcdc", 0 },
1310
+ { "#bde5d6", 0 },
1311
+ { "#a0a0a0", 0 },
1312
+ { "#b0b0b0", 0 },
1313
+ { "#c0c0c0", 0 },
1314
+ { "#d0d0d0", 0 },
1315
+ { "#e0e0e0", 0 },
1316
+
1317
+ { "#c0ffc0", 0 },
1318
+ { "#c0fff0", 0 },
1319
+ { "#c0f0ff", 0 },
1320
+ { "#d0c0ff", 0 },
1321
+ { "#ffc0ff", 0 },
1322
+ { "#ffc0d0", 0 },
1323
+ { "#fff0c0", 0 },
1324
+ { "#f0ffc0", 0 },
1325
+
1326
+ { "#a8d3c0", 0 },
1327
+ { "#a8c7d3", 0 },
1328
+ { "#aaa8d3", 0 },
1329
+ { "#cba8d3", 0 },
1330
+ { "#d3a8bc", 0 },
1331
+ { "#d3b5a8", 0 },
1332
+ { "#d1d3a8", 0 },
1333
+ { "#b1d3a8", 0 },
1334
+
1335
+ { "#8eb2a1", 0 },
1336
+ { "#8ea7b2", 0 },
1337
+ { "#8f8eb2", 0 },
1338
+ { "#ab8eb2", 0 },
1339
+ { "#b28e9e", 0 },
1340
+ { "#b2988e", 0 },
1341
+ { "#b0b28e", 0 },
1342
+ { "#95b28e", 0 },
1343
+
1344
+ { "custom", "##" },
13211345
};
13221346
int nColor = sizeof(aColor)/sizeof(aColor[0])-1;
13231347
int stdClrFound = 0;
13241348
int i;
13251349
@@ -1333,24 +1357,26 @@
13331357
}
13341358
@ Propagate color to descendants</td></tr>
13351359
}
13361360
@ <tr>
13371361
for(i=0; i<nColor; i++){
1338
- if( aColor[i].zColor[0] ){
1339
- @ <td style="background-color: %h(aColor[i].zColor);">
1362
+ const char *zClr = aColor[i].zColor;
1363
+ if( zClr==0 ) zClr = aColor[i].zCName;
1364
+ if( zClr[0] ){
1365
+ @ <td style="background-color: %h(zClr);">
13401366
}else{
13411367
@ <td>
13421368
}
1343
- if( fossil_strcmp(zDefaultColor, aColor[i].zColor)==0 ){
1344
- @ <input type="radio" name="%s(zId)" value="%h(aColor[i].zColor)"
1369
+ if( fossil_strcmp(zDefaultColor, zClr)==0 ){
1370
+ @ <input type="radio" name="%s(zId)" value="%h(zClr)"
13451371
@ checked="checked" />
13461372
stdClrFound=1;
13471373
}else{
1348
- @ <input type="radio" name="%s(zId)" value="%h(aColor[i].zColor)" />
1374
+ @ <input type="radio" name="%s(zId)" value="%h(zClr)" />
13491375
}
13501376
@ %h(aColor[i].zCName)</td>
1351
- if( (i%6)==5 && i+1<nColor ){
1377
+ if( (i%8)==7 && i+1<nColor ){
13521378
@ </tr><tr>
13531379
}
13541380
}
13551381
@ </tr><tr>
13561382
if (stdClrFound){
13571383
--- src/info.c
+++ src/info.c
@@ -1304,22 +1304,46 @@
1304 static const struct SampleColors {
1305 const char *zCName;
1306 const char *zColor;
1307 } aColor[] = {
1308 { "(none)", "" },
1309 { "#f2dcdc", "#f2dcdc" },
1310 { "#f0ffc0", "#f0ffc0" },
1311 { "#bde5d6", "#bde5d6" },
1312 { "#c0ffc0", "#c0ffc0" },
1313 { "#c0fff0", "#c0fff0" },
1314 { "#c0f0ff", "#c0f0ff" },
1315 { "#d0c0ff", "#d0c0ff" },
1316 { "#ffc0ff", "#ffc0ff" },
1317 { "#ffc0d0", "#ffc0d0" },
1318 { "#fff0c0", "#fff0c0" },
1319 { "#c0c0c0", "#c0c0c0" },
1320 { "custom", "##" },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1321 };
1322 int nColor = sizeof(aColor)/sizeof(aColor[0])-1;
1323 int stdClrFound = 0;
1324 int i;
1325
@@ -1333,24 +1357,26 @@
1333 }
1334 @ Propagate color to descendants</td></tr>
1335 }
1336 @ <tr>
1337 for(i=0; i<nColor; i++){
1338 if( aColor[i].zColor[0] ){
1339 @ <td style="background-color: %h(aColor[i].zColor);">
 
 
1340 }else{
1341 @ <td>
1342 }
1343 if( fossil_strcmp(zDefaultColor, aColor[i].zColor)==0 ){
1344 @ <input type="radio" name="%s(zId)" value="%h(aColor[i].zColor)"
1345 @ checked="checked" />
1346 stdClrFound=1;
1347 }else{
1348 @ <input type="radio" name="%s(zId)" value="%h(aColor[i].zColor)" />
1349 }
1350 @ %h(aColor[i].zCName)</td>
1351 if( (i%6)==5 && i+1<nColor ){
1352 @ </tr><tr>
1353 }
1354 }
1355 @ </tr><tr>
1356 if (stdClrFound){
1357
--- src/info.c
+++ src/info.c
@@ -1304,22 +1304,46 @@
1304 static const struct SampleColors {
1305 const char *zCName;
1306 const char *zColor;
1307 } aColor[] = {
1308 { "(none)", "" },
1309 { "#f2dcdc", 0 },
1310 { "#bde5d6", 0 },
1311 { "#a0a0a0", 0 },
1312 { "#b0b0b0", 0 },
1313 { "#c0c0c0", 0 },
1314 { "#d0d0d0", 0 },
1315 { "#e0e0e0", 0 },
1316
1317 { "#c0ffc0", 0 },
1318 { "#c0fff0", 0 },
1319 { "#c0f0ff", 0 },
1320 { "#d0c0ff", 0 },
1321 { "#ffc0ff", 0 },
1322 { "#ffc0d0", 0 },
1323 { "#fff0c0", 0 },
1324 { "#f0ffc0", 0 },
1325
1326 { "#a8d3c0", 0 },
1327 { "#a8c7d3", 0 },
1328 { "#aaa8d3", 0 },
1329 { "#cba8d3", 0 },
1330 { "#d3a8bc", 0 },
1331 { "#d3b5a8", 0 },
1332 { "#d1d3a8", 0 },
1333 { "#b1d3a8", 0 },
1334
1335 { "#8eb2a1", 0 },
1336 { "#8ea7b2", 0 },
1337 { "#8f8eb2", 0 },
1338 { "#ab8eb2", 0 },
1339 { "#b28e9e", 0 },
1340 { "#b2988e", 0 },
1341 { "#b0b28e", 0 },
1342 { "#95b28e", 0 },
1343
1344 { "custom", "##" },
1345 };
1346 int nColor = sizeof(aColor)/sizeof(aColor[0])-1;
1347 int stdClrFound = 0;
1348 int i;
1349
@@ -1333,24 +1357,26 @@
1357 }
1358 @ Propagate color to descendants</td></tr>
1359 }
1360 @ <tr>
1361 for(i=0; i<nColor; i++){
1362 const char *zClr = aColor[i].zColor;
1363 if( zClr==0 ) zClr = aColor[i].zCName;
1364 if( zClr[0] ){
1365 @ <td style="background-color: %h(zClr);">
1366 }else{
1367 @ <td>
1368 }
1369 if( fossil_strcmp(zDefaultColor, zClr)==0 ){
1370 @ <input type="radio" name="%s(zId)" value="%h(zClr)"
1371 @ checked="checked" />
1372 stdClrFound=1;
1373 }else{
1374 @ <input type="radio" name="%s(zId)" value="%h(zClr)" />
1375 }
1376 @ %h(aColor[i].zCName)</td>
1377 if( (i%8)==7 && i+1<nColor ){
1378 @ </tr><tr>
1379 }
1380 }
1381 @ </tr><tr>
1382 if (stdClrFound){
1383

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button