Fossil SCM

If the "pikchr-foreground" property is set in the "details.txt" file of a skin, then the value of that property becomes the default foreground color for Pikchr diagrams.

drh 2020-11-10 13:40 trunk
Commit 0853ab7447a4a6375f546d1a7ad4b62e8ca1c943c848e0cb03b22a75ad492b48
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -347,10 +347,11 @@
347347
int pikFlags = PIKCHR_PROCESS_NONCE
348348
| PIKCHR_PROCESS_DIV
349349
| PIKCHR_PROCESS_SRC
350350
| PIKCHR_PROCESS_ERR_PRE;
351351
Blob bSrc = empty_blob;
352
+ const char *zFgColor;
352353
353354
while( nArg>0 ){
354355
int i;
355356
for(i=0; i<nArg && !fossil_isspace(zArg[i]); i++){}
356357
if( i==6 && strncmp(zArg, "center", 6)==0 ){
@@ -373,10 +374,14 @@
373374
nArg -= i;
374375
}
375376
if( skin_detail_boolean("white-foreground") ){
376377
pikFlags |= 0x02; /* PIKCHR_DARK_MODE */
377378
}
379
+ zFgColor = skin_detail("pikchr-foreground");
380
+ if( zFgColor && zFgColor[0] ){
381
+ blob_appendf(&bSrc, "color = %s\n", zFgColor);
382
+ }
378383
blob_append(&bSrc, zSrc, nSrc)
379384
/*have to dup input to ensure a NUL-terminated source string */;
380385
pikchr_process(blob_str(&bSrc), pikFlags, 0, ob);
381386
blob_reset(&bSrc);
382387
}
383388
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -347,10 +347,11 @@
347 int pikFlags = PIKCHR_PROCESS_NONCE
348 | PIKCHR_PROCESS_DIV
349 | PIKCHR_PROCESS_SRC
350 | PIKCHR_PROCESS_ERR_PRE;
351 Blob bSrc = empty_blob;
 
352
353 while( nArg>0 ){
354 int i;
355 for(i=0; i<nArg && !fossil_isspace(zArg[i]); i++){}
356 if( i==6 && strncmp(zArg, "center", 6)==0 ){
@@ -373,10 +374,14 @@
373 nArg -= i;
374 }
375 if( skin_detail_boolean("white-foreground") ){
376 pikFlags |= 0x02; /* PIKCHR_DARK_MODE */
377 }
 
 
 
 
378 blob_append(&bSrc, zSrc, nSrc)
379 /*have to dup input to ensure a NUL-terminated source string */;
380 pikchr_process(blob_str(&bSrc), pikFlags, 0, ob);
381 blob_reset(&bSrc);
382 }
383
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -347,10 +347,11 @@
347 int pikFlags = PIKCHR_PROCESS_NONCE
348 | PIKCHR_PROCESS_DIV
349 | PIKCHR_PROCESS_SRC
350 | PIKCHR_PROCESS_ERR_PRE;
351 Blob bSrc = empty_blob;
352 const char *zFgColor;
353
354 while( nArg>0 ){
355 int i;
356 for(i=0; i<nArg && !fossil_isspace(zArg[i]); i++){}
357 if( i==6 && strncmp(zArg, "center", 6)==0 ){
@@ -373,10 +374,14 @@
374 nArg -= i;
375 }
376 if( skin_detail_boolean("white-foreground") ){
377 pikFlags |= 0x02; /* PIKCHR_DARK_MODE */
378 }
379 zFgColor = skin_detail("pikchr-foreground");
380 if( zFgColor && zFgColor[0] ){
381 blob_appendf(&bSrc, "color = %s\n", zFgColor);
382 }
383 blob_append(&bSrc, zSrc, nSrc)
384 /*have to dup input to ensure a NUL-terminated source string */;
385 pikchr_process(blob_str(&bSrc), pikFlags, 0, ob);
386 blob_reset(&bSrc);
387 }
388
+5 -4
--- src/skins.c
+++ src/skins.c
@@ -85,14 +85,15 @@
8585
*/
8686
static struct SkinDetail {
8787
const char *zName; /* Name of the detail */
8888
const char *zValue; /* Value of the detail */
8989
} aSkinDetail[] = {
90
- { "timeline-arrowheads", "1" },
91
- { "timeline-circle-nodes", "0" },
92
- { "timeline-color-graph-lines", "0" },
93
- { "white-foreground", "0" },
90
+ { "pikchr-foreground", "" },
91
+ { "timeline-arrowheads", "1" },
92
+ { "timeline-circle-nodes", "0" },
93
+ { "timeline-color-graph-lines", "0" },
94
+ { "white-foreground", "0" },
9495
};
9596
9697
/*
9798
** Invoke this routine to set the alternative skin. Return NULL if the
9899
** alternative was successfully installed. Return a string listing all
99100
--- src/skins.c
+++ src/skins.c
@@ -85,14 +85,15 @@
85 */
86 static struct SkinDetail {
87 const char *zName; /* Name of the detail */
88 const char *zValue; /* Value of the detail */
89 } aSkinDetail[] = {
90 { "timeline-arrowheads", "1" },
91 { "timeline-circle-nodes", "0" },
92 { "timeline-color-graph-lines", "0" },
93 { "white-foreground", "0" },
 
94 };
95
96 /*
97 ** Invoke this routine to set the alternative skin. Return NULL if the
98 ** alternative was successfully installed. Return a string listing all
99
--- src/skins.c
+++ src/skins.c
@@ -85,14 +85,15 @@
85 */
86 static struct SkinDetail {
87 const char *zName; /* Name of the detail */
88 const char *zValue; /* Value of the detail */
89 } aSkinDetail[] = {
90 { "pikchr-foreground", "" },
91 { "timeline-arrowheads", "1" },
92 { "timeline-circle-nodes", "0" },
93 { "timeline-color-graph-lines", "0" },
94 { "white-foreground", "0" },
95 };
96
97 /*
98 ** Invoke this routine to set the alternative skin. Return NULL if the
99 ** alternative was successfully installed. Return a string listing all
100

Keyboard Shortcuts

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