From f27ff144a2ceec3cd2fc8d9b0bb32f2d0bb99853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= Date: Wed, 18 May 2022 15:13:54 +0300 Subject: [PATCH 1/1] Terminal: Quote border line, icon placement --- src/gmdocument.c | 7 ++++++- src/ui/documentwidget.c | 3 ++- src/ui/text_simple.c | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/gmdocument.c b/src/gmdocument.c index dc85a15c..5cf52838 100644 --- a/src/gmdocument.c +++ b/src/gmdocument.c @@ -956,9 +956,14 @@ static void doLayout_GmDocument_(iGmDocument *d) { quoteRun.visBounds.pos = add_I2(pos, init_I2((indents[quote_GmLineType] - 5 * aspect_UI) * gap_Text, - (lineHeight_Text(quote_FontId) / 2 - bottom_Rect(vis)) * aspect_UI)); + !isTerminal_Platform() + ? (lineHeight_Text(quote_FontId) / 2 - bottom_Rect(vis)) + : 0)); quoteRun.bounds = zero_Rect(); /* just visual */ quoteRun.flags |= decoration_GmRunFlag; + if (isTerminal_Platform()) { + quoteRun.font = paragraph_FontId; + } pushBack_Array(&d->layout, "eRun); } else if (type != quote_GmLineType) { diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 548eca40..e862b86f 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c @@ -1386,7 +1386,8 @@ static void drawRun_DrawContext_(void *context, const iGmRun *run) { } } if (run->flags & ruler_GmRunFlag) { - if (height_Rect(run->visBounds) > 1) { + if (height_Rect(run->visBounds) > 0 && + height_Rect(run->visBounds) <= width_Rect(run->visBounds)) { /* This is used for block quotes. */ drawVLine_Paint(&d->paint, addX_I2(visPos, diff --git a/src/ui/text_simple.c b/src/ui/text_simple.c index 36ec7d96..49f1dce2 100644 --- a/src/ui/text_simple.c +++ b/src/ui/text_simple.c @@ -362,7 +362,8 @@ static iRect runSimple_Font_(iFont *d, const iRunArgs *args) { if (src.h == 2) { /* "Big" font, used for titles: underline it. */ for (int ux = 0; ux < dst.w; ux++) { - SDL_RenderDrawUnicode(render, dst.x + ux, dst.y + 1, '-'); + SDL_RenderDrawUnicode(render, dst.x + ux, dst.y + 1, + 0x2500 /* box drawings light horizontal */); } } #endif -- 2.34.1