summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gmdocument.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c
index b64e9ea7..2cce9b24 100644
--- a/src/gmdocument.c
+++ b/src/gmdocument.c
@@ -669,22 +669,6 @@ static void doLayout_GmDocument_(iGmDocument *d) {
669 icon.font = equal_Rangecc(link->labelIcon, "\u2219") ? regularMonospace_FontId 669 icon.font = equal_Rangecc(link->labelIcon, "\u2219") ? regularMonospace_FontId
670 : regular_FontId; 670 : regular_FontId;
671 alignDecoration_GmRun_(&icon, iFalse); 671 alignDecoration_GmRun_(&icon, iFalse);
672#if 0
673 {
674 const iRect visBounds = visualBounds_Text(icon.font, icon.text);
675 const int visWidth = width_Rect(visBounds);
676 /* Keep the icon aligned to the left edge. */
677 icon.visBounds.pos.x -= left_Rect(visBounds);
678 if (visWidth > width_Rect(icon.visBounds)) {
679 /* ...unless it's a wide icon, in which case move it to the left. */
680 icon.visBounds.pos.x -= visWidth - width_Rect(icon.visBounds);
681 }
682 else if (visWidth < width_Rect(icon.visBounds) * 3 / 4) {
683 /* ...or a narrow icon, which needs to be centered but leave a gap. */
684 icon.visBounds.pos.x += (width_Rect(icon.visBounds) * 3 / 4 - visWidth) / 2;
685 }
686 }
687#endif
688 icon.color = linkColor_GmDocument(d, run.linkId, icon_GmLinkPart); 672 icon.color = linkColor_GmDocument(d, run.linkId, icon_GmLinkPart);
689 icon.flags |= decoration_GmRunFlag; 673 icon.flags |= decoration_GmRunFlag;
690 pushBack_Array(&d->layout, &icon); 674 pushBack_Array(&d->layout, &icon);
@@ -728,6 +712,10 @@ static void doLayout_GmDocument_(iGmDocument *d) {
728 meta->flags |= topLeft_GmPreMetaFlag; 712 meta->flags |= topLeft_GmPreMetaFlag;
729 } 713 }
730 } 714 }
715 /* Visited links are never bold. */
716 if (run.linkId && linkFlags_GmDocument(d, run.linkId) & visited_GmLinkFlag) {
717 run.font = paragraph_FontId;
718 }
731 iAssert(!isEmpty_Range(&runLine)); /* must have something at this point */ 719 iAssert(!isEmpty_Range(&runLine)); /* must have something at this point */
732 while (!isEmpty_Range(&runLine)) { 720 while (!isEmpty_Range(&runLine)) {
733 run.bounds.pos = addX_I2(pos, indent * gap_Text); 721 run.bounds.pos = addX_I2(pos, indent * gap_Text);
@@ -921,9 +909,9 @@ static void setDerivedThemeColors_(enum iGmDocumentTheme theme) {
921 set_Color(tmBackgroundAltText_ColorId, 909 set_Color(tmBackgroundAltText_ColorId,
922 mix_Color(get_Color(tmQuoteIcon_ColorId), get_Color(tmBackground_ColorId), 0.85f)); 910 mix_Color(get_Color(tmQuoteIcon_ColorId), get_Color(tmBackground_ColorId), 0.85f));
923 set_Color(tmBackgroundOpenLink_ColorId, 911 set_Color(tmBackgroundOpenLink_ColorId,
924 mix_Color(get_Color(tmLinkText_ColorId), get_Color(tmBackground_ColorId), 0.92f)); 912 mix_Color(get_Color(tmLinkText_ColorId), get_Color(tmBackground_ColorId), 0.90f));
925 set_Color(tmFrameOpenLink_ColorId, 913 set_Color(tmFrameOpenLink_ColorId,
926 mix_Color(get_Color(tmLinkText_ColorId), get_Color(tmBackground_ColorId), 0.78f)); 914 mix_Color(get_Color(tmLinkText_ColorId), get_Color(tmBackground_ColorId), 0.75f));
927 if (theme == colorfulDark_GmDocumentTheme) { 915 if (theme == colorfulDark_GmDocumentTheme) {
928 /* Ensure paragraph text and link text aren't too similarly colored. */ 916 /* Ensure paragraph text and link text aren't too similarly colored. */
929 if (delta_Color(get_Color(tmLinkText_ColorId), get_Color(tmParagraph_ColorId)) < 100) { 917 if (delta_Color(get_Color(tmLinkText_ColorId), get_Color(tmParagraph_ColorId)) < 100) {
@@ -932,7 +920,7 @@ static void setDerivedThemeColors_(enum iGmDocumentTheme theme) {
932 } 920 }
933 } 921 }
934 set_Color(tmLinkCustomIconVisited_ColorId, 922 set_Color(tmLinkCustomIconVisited_ColorId,
935 mix_Color(get_Color(tmLinkIconVisited_ColorId), get_Color(tmLinkIcon_ColorId), 0.5f)); 923 mix_Color(get_Color(tmLinkIconVisited_ColorId), get_Color(tmLinkIcon_ColorId), 0.20f));
936} 924}
937 925
938static void updateIconBasedOnUrl_GmDocument_(iGmDocument *d) { 926static void updateIconBasedOnUrl_GmDocument_(iGmDocument *d) {