summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-11-25 16:42:47 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-11-25 16:42:47 +0200
commitf137ae8fb8085ec41d219656bce236158e57f3a0 (patch)
tree57617e20f53ddd0f2848a7b6afd07beab30ce716 /src/ui
parenta8262d7e3636b9f50ef96f67d6a71d829611e560 (diff)
GmDocument: Heading font styles
Swapped bold styling of heading levels 2 and 3 for better visual distinction of the hierarchy.
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/documentwidget.c5
-rw-r--r--src/ui/text.h4
2 files changed, 5 insertions, 4 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index b70f48e4..c41c77d6 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -4718,8 +4718,9 @@ static void updateSideIconBuf_DocumentWidget_(const iDocumentWidget *d) {
4718 iBool isHeadingVisible = isSideHeadingVisible_DocumentWidget_(d); 4718 iBool isHeadingVisible = isSideHeadingVisible_DocumentWidget_(d);
4719 /* Determine the required size. */ 4719 /* Determine the required size. */
4720 iInt2 bufSize = init1_I2(minBannerSize); 4720 iInt2 bufSize = init1_I2(minBannerSize);
4721 const int sideHeadingFont = FONT_ID(documentHeading_FontId, regular_FontStyle, contentBig_FontSize);
4721 if (isHeadingVisible) { 4722 if (isHeadingVisible) {
4722 const iInt2 headingSize = measureWrapRange_Text(heading3_FontId, avail, 4723 const iInt2 headingSize = measureWrapRange_Text(sideHeadingFont, avail,
4723 currentHeading_DocumentWidget_(d)).bounds.size; 4724 currentHeading_DocumentWidget_(d)).bounds.size;
4724 if (headingSize.x > 0) { 4725 if (headingSize.x > 0) {
4725 bufSize.y += gap_Text + headingSize.y; 4726 bufSize.y += gap_Text + headingSize.y;
@@ -4749,7 +4750,7 @@ static void updateSideIconBuf_DocumentWidget_(const iDocumentWidget *d) {
4749 if (isHeadingVisible) { 4750 if (isHeadingVisible) {
4750 iRangecc text = currentHeading_DocumentWidget_(d); 4751 iRangecc text = currentHeading_DocumentWidget_(d);
4751 iInt2 pos = addY_I2(bottomLeft_Rect(iconRect), gap_Text); 4752 iInt2 pos = addY_I2(bottomLeft_Rect(iconRect), gap_Text);
4752 const int font = heading3_FontId; 4753 const int font = sideHeadingFont;
4753 drawWrapRange_Text(font, pos, avail, tmBannerSideTitle_ColorId, text); 4754 drawWrapRange_Text(font, pos, avail, tmBannerSideTitle_ColorId, text);
4754 } 4755 }
4755 endTarget_Paint(&p); 4756 endTarget_Paint(&p);
diff --git a/src/ui/text.h b/src/ui/text.h
index de76ed09..63499484 100644
--- a/src/ui/text.h
+++ b/src/ui/text.h
@@ -71,8 +71,8 @@ enum iFontId {
71 preformattedSmall_FontId = FONT_ID(monospace_FontId, regular_FontStyle, contentTiny_FontSize), 71 preformattedSmall_FontId = FONT_ID(monospace_FontId, regular_FontStyle, contentTiny_FontSize),
72 quote_FontId = FONT_ID(documentBody_FontId, italic_FontStyle, contentRegular_FontSize), 72 quote_FontId = FONT_ID(documentBody_FontId, italic_FontStyle, contentRegular_FontSize),
73 heading1_FontId = FONT_ID(documentHeading_FontId, bold_FontStyle, contentHuge_FontSize), 73 heading1_FontId = FONT_ID(documentHeading_FontId, bold_FontStyle, contentHuge_FontSize),
74 heading2_FontId = FONT_ID(documentHeading_FontId, bold_FontStyle, contentLarge_FontSize), 74 heading2_FontId = FONT_ID(documentHeading_FontId, regular_FontStyle, contentLarge_FontSize),
75 heading3_FontId = FONT_ID(documentHeading_FontId, regular_FontStyle, contentBig_FontSize), 75 heading3_FontId = FONT_ID(documentHeading_FontId, bold_FontStyle, contentBig_FontSize),
76 banner_FontId = FONT_ID(documentHeading_FontId, light_FontStyle, contentLarge_FontSize), 76 banner_FontId = FONT_ID(documentHeading_FontId, light_FontStyle, contentLarge_FontSize),
77 monospaceParagraph_FontId = FONT_ID(documentMonospace_FontId, regular_FontStyle, contentRegular_FontSize), 77 monospaceParagraph_FontId = FONT_ID(documentMonospace_FontId, regular_FontStyle, contentRegular_FontSize),
78 monospaceBold_FontId = FONT_ID(documentMonospace_FontId, semiBold_FontStyle, contentRegular_FontSize), 78 monospaceBold_FontId = FONT_ID(documentMonospace_FontId, semiBold_FontStyle, contentRegular_FontSize),