mirror of
https://github.com/sqlite/sqlite.git
synced 2026-10-23 21:49:02 +03:00
When drawing boxes using QRF, use rounded corners and use a double-line to
separate column headers from the content. FossilOrigin-Name: 8c1ca30707c36f074dad29556df4176a74aa573491bb4aad973789aee5ad80da
This commit is contained in:
@@ -1432,20 +1432,33 @@ static void qrfRowSeparator(sqlite3_str *pOut, qrfColData *p, char cSep){
|
||||
#define BOX_124 "\342\224\264" /* U+2534 -'- */
|
||||
#define BOX_1234 "\342\224\274" /* U+253c -|- */
|
||||
|
||||
/* Rounded corners: */
|
||||
#define BOX_R12 "\342\225\260" /* U+2570 '- */
|
||||
#define BOX_R23 "\342\225\255" /* U+256d ,- */
|
||||
#define BOX_R34 "\342\225\256" /* U+256e -, */
|
||||
#define BOX_R14 "\342\225\257" /* U+256f -' */
|
||||
|
||||
/* Doubled horizontal lines: */
|
||||
#define DBL_24 "\342\225\220" /* U+2550 === */
|
||||
#define DBL_123 "\342\225\236" /* U+255e |= */
|
||||
#define DBL_134 "\342\225\241" /* U+2561 =| */
|
||||
#define DBL_1234 "\342\225\252" /* U+256a =|= */
|
||||
|
||||
/* Draw horizontal line N characters long using unicode box
|
||||
** characters
|
||||
*/
|
||||
static void qrfBoxLine(sqlite3_str *pOut, int N){
|
||||
const char zDash[] =
|
||||
BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24
|
||||
BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24;
|
||||
const int nDash = sizeof(zDash) - 1;
|
||||
static void qrfBoxLine(sqlite3_str *pOut, int N, int bDbl){
|
||||
const char *azDash[2] = {
|
||||
BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24,
|
||||
DBL_24 DBL_24 DBL_24 DBL_24 DBL_24 DBL_24 DBL_24 DBL_24 DBL_24 DBL_24
|
||||
};/* 0 1 2 3 4 5 6 7 8 9 */
|
||||
const int nDash = 30;
|
||||
N *= 3;
|
||||
while( N>nDash ){
|
||||
sqlite3_str_append(pOut, zDash, nDash);
|
||||
sqlite3_str_append(pOut, azDash[bDbl], nDash);
|
||||
N -= nDash;
|
||||
}
|
||||
sqlite3_str_append(pOut, zDash, N);
|
||||
sqlite3_str_append(pOut, azDash[bDbl], N);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1456,7 +1469,8 @@ static void qrfBoxSeparator(
|
||||
qrfColData *p,
|
||||
const char *zSep1,
|
||||
const char *zSep2,
|
||||
const char *zSep3
|
||||
const char *zSep3,
|
||||
int bDbl
|
||||
){
|
||||
int i;
|
||||
if( p->nCol>0 ){
|
||||
@@ -1464,10 +1478,10 @@ static void qrfBoxSeparator(
|
||||
if( useBorder ){
|
||||
sqlite3_str_appendall(pOut, zSep1);
|
||||
}
|
||||
qrfBoxLine(pOut, p->a[0].w+p->nMargin);
|
||||
qrfBoxLine(pOut, p->a[0].w+p->nMargin, bDbl);
|
||||
for(i=1; i<p->nCol; i++){
|
||||
sqlite3_str_appendall(pOut, zSep2);
|
||||
qrfBoxLine(pOut, p->a[i].w+p->nMargin);
|
||||
qrfBoxLine(pOut, p->a[i].w+p->nMargin, bDbl);
|
||||
}
|
||||
if( useBorder ){
|
||||
sqlite3_str_appendall(pOut, zSep3);
|
||||
@@ -1875,7 +1889,7 @@ static void qrfColumnar(Qrf *p){
|
||||
rowStart += 3;
|
||||
rowSep = "\n";
|
||||
}else{
|
||||
qrfBoxSeparator(p->pOut, &data, BOX_23, BOX_234, BOX_34);
|
||||
qrfBoxSeparator(p->pOut, &data, BOX_R23, BOX_234, BOX_R34, 0);
|
||||
}
|
||||
break;
|
||||
case QRF_STYLE_Table:
|
||||
@@ -2008,8 +2022,10 @@ static void qrfColumnar(Qrf *p){
|
||||
break;
|
||||
}
|
||||
case QRF_STYLE_Box: {
|
||||
if( isTitleDataSeparator || data.bMultiRow ){
|
||||
qrfBoxSeparator(p->pOut, &data, BOX_123, BOX_1234, BOX_134);
|
||||
if( isTitleDataSeparator ){
|
||||
qrfBoxSeparator(p->pOut, &data, DBL_123, DBL_1234, DBL_134, 1);
|
||||
}else if( data.bMultiRow ){
|
||||
qrfBoxSeparator(p->pOut, &data, BOX_123, BOX_1234, BOX_134, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2044,7 +2060,7 @@ static void qrfColumnar(Qrf *p){
|
||||
if( p->spec.bBorder!=QRF_No ){
|
||||
switch( p->spec.eStyle ){
|
||||
case QRF_STYLE_Box:
|
||||
qrfBoxSeparator(p->pOut, &data, BOX_12, BOX_124, BOX_14);
|
||||
qrfBoxSeparator(p->pOut, &data, BOX_R12, BOX_124, BOX_R14, 0);
|
||||
break;
|
||||
case QRF_STYLE_Table:
|
||||
qrfRowSeparator(p->pOut, &data, '+');
|
||||
|
||||
15
manifest
15
manifest
@@ -1,5 +1,5 @@
|
||||
C In\sthe\sWindows\sMakefile.msc,\snever\sset\s-DNDEBUG.\s\sAnd\sadd\sthe\s"env"\starget\nwhich\sprints\sout\sthe\svalue\sof\sall\s127\sconfiguration\svariables\sthat\s\nMakefile.msc\suses.
|
||||
D 2025-12-05T19:45:43.225
|
||||
C When\sdrawing\sboxes\susing\sQRF,\suse\srounded\scorners\sand\suse\sa\sdouble-line\sto\nseparate\scolumn\sheaders\sfrom\sthe\scontent.
|
||||
D 2025-12-05T22:04:49.269
|
||||
F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
@@ -418,7 +418,7 @@ F ext/misc/zipfile.c 9981cda2f5d08ff01f33c2e4cea82df75f83a4c0fdcbc5dce67e0f775b7
|
||||
F ext/misc/zorder.c bddff2e1b9661a90c95c2a9a9c7ecd8908afab5763256294dd12d609d4664eee
|
||||
F ext/qrf/README.md 86fc5c3c5e3eddbe54fc1235cbdc52b8c2c0732791d224345c3014cd45c4c0e7
|
||||
F ext/qrf/dev-notes.md e68a6d91ce4c7eb296ef2daadc2bb79c95c317ad15b9fafe40850c67b29c2430
|
||||
F ext/qrf/qrf.c c50368ea2be3ab67bd6698d8b34bf70210d3fbf6b3659ed328543e5ec8d69eff
|
||||
F ext/qrf/qrf.c 639179fcbf6768fa61e5d931121c3f8bdc7cb62e92b9b239b3c6583c4d6ff49e
|
||||
F ext/qrf/qrf.h 2cd7bd43579c522d3ae5c16034c7fdf41085684189811ae8e18ebc932a1cc79f
|
||||
F ext/rbu/rbu.c 801450b24eaf14440d8fd20385aacc751d5c9d6123398df41b1b5aa804bf4ce8
|
||||
F ext/rbu/rbu1.test 25870dd7db7eb5597e2b4d6e29e7a7e095abf332660f67d89959552ce8f8f255
|
||||
@@ -2184,8 +2184,11 @@ F tool/version-info.c 33d0390ef484b3b1cb685d59362be891ea162123cea181cb8e6d2cf6dd
|
||||
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
|
||||
F tool/warnings.sh d924598cf2f55a4ecbc2aeb055c10bd5f48114793e7ba25f9585435da29e7e98
|
||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||
P 19e5ae6e20a1e2f41c5bc77b7bb99211b22d6fabf21e5f2f7f82028615eb791e
|
||||
R bb5e74c6d6d5cea877cbf9c5fa311298
|
||||
P f82376f080ca5cb316b8eb2e48a128b1838eb376b9e903c7af611b398cfe9b1f
|
||||
R 875f89180e49565d507ad67ac515a40e
|
||||
T *branch * qrf-box-enhancements
|
||||
T *sym-qrf-box-enhancements *
|
||||
T -sym-trunk *
|
||||
U drh
|
||||
Z 1327b3a4ad83622efbe2804317ed0b12
|
||||
Z ede9962b23f4bc5bbbb7a1e52559a3c0
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
branch trunk
|
||||
tag trunk
|
||||
branch qrf-box-enhancements
|
||||
tag qrf-box-enhancements
|
||||
|
||||
@@ -1 +1 @@
|
||||
f82376f080ca5cb316b8eb2e48a128b1838eb376b9e903c7af611b398cfe9b1f
|
||||
8c1ca30707c36f074dad29556df4176a74aa573491bb4aad973789aee5ad80da
|
||||
|
||||
Reference in New Issue
Block a user