Skip to content

Commit c37b24d

Browse files
committed
adjusted light colors
1 parent d384816 commit c37b24d

File tree

2 files changed

+58
-12
lines changed

2 files changed

+58
-12
lines changed

src/ResultDock.cpp

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -699,19 +699,31 @@ void ResultDock::applyTheme()
699699
* ---------------------------------------------------------------- */
700700
S(SCI_INDICSETSTYLE, 0, INDIC_ROUNDBOX);
701701
S(SCI_INDICSETFORE, 0, selBg);
702-
S(SCI_INDICSETALPHA, 0, 128);
702+
// use per‑mode alpha from RDColors
703+
S(SCI_INDICSETALPHA, 0,
704+
dark ? RDColors::CaretLineAlphaDark
705+
: RDColors::CaretLineAlphaLight);
706+
S(SCI_INDICSETALPHA, 0,
707+
dark ? RDColors::CaretLineAlphaDark
708+
: RDColors::CaretLineAlphaLight);
703709
S(SCI_INDICSETUNDER, 0, TRUE);
704710

705711
// keep visible (was missing in earlier patch)
706712
S(SCI_SETCARETLINEVISIBLE, TRUE, 0);
707713
S(SCI_SETCARETLINEBACK, selBg, 0);
714+
S(SCI_SETCARETLINEVISIBLE, TRUE, 0);
715+
S(SCI_SETCARETLINEBACK,
716+
dark ? selBg
717+
: RDColors::CaretLineBackLight,
718+
0);
708719

709720
/* ----------------------------------------------------------------
710721
* 6) Custom indicators (colours from RDColors)
711722
* ---------------------------------------------------------------- */
712723
COLORREF hitLineBg = dark ? RDColors::LineBgDark : RDColors::LineBgLight;
713724
COLORREF lineNrFg = dark ? RDColors::LineNrDark : RDColors::LineNrLight;
714725
COLORREF matchFg = dark ? RDColors::MatchDark : RDColors::MatchLight;
726+
COLORREF matchBg = RDColors::MatchBgLight;
715727
COLORREF headerBg = dark ? RDColors::HeaderBgLight : RDColors::HeaderBgLight;
716728
COLORREF filePathFg = dark ? RDColors::FilePathFgDark : RDColors::FilePathFgLight;
717729

@@ -726,8 +738,24 @@ void ResultDock::applyTheme()
726738
S(SCI_INDICSETFORE, INDIC_LINENUMBER_FORE, lineNrFg);
727739

728740
/* 6‑c) Match substrings --------------------------------------- */
729-
S(SCI_INDICSETSTYLE, INDIC_MATCH_FORE, INDIC_TEXTFORE);
730-
S(SCI_INDICSETFORE, INDIC_MATCH_FORE, matchFg);
741+
if (!dark) {
742+
// configure yellow‑box indicator under the text
743+
S(SCI_INDICSETSTYLE, INDIC_MATCH_BG, INDIC_FULLBOX);
744+
S(SCI_INDICSETFORE, INDIC_MATCH_BG, matchBg);
745+
S(SCI_INDICSETALPHA, INDIC_MATCH_BG, 255);
746+
S(SCI_INDICSETUNDER, INDIC_MATCH_BG, TRUE);
747+
748+
// configure red‑text indicator
749+
S(SCI_INDICSETSTYLE, INDIC_MATCH_FORE, INDIC_TEXTFORE);
750+
S(SCI_INDICSETFORE, INDIC_MATCH_FORE, matchFg);
751+
}
752+
else {
753+
// in Dark‑mode: disable the BG indicator explicitly
754+
S(SCI_INDICSETALPHA, INDIC_MATCH_BG, 0);
755+
// still draw the text in the dark‑mode color
756+
S(SCI_INDICSETSTYLE, INDIC_MATCH_FORE, INDIC_TEXTFORE);
757+
S(SCI_INDICSETFORE, INDIC_MATCH_FORE, matchFg);
758+
}
731759

732760
/* 6‑d) Full‑width green header background --------------------- */
733761
S(SCI_INDICSETSTYLE, INDIC_HEADER_BACKGROUND, INDIC_FULLBOX);
@@ -843,6 +871,14 @@ void ResultDock::applyStyling() const
843871
h.numberLen);
844872

845873
/* 5) Match substrings ------------------------------------------ */
874+
// first draw the yellow box under each match
875+
S(SCI_SETINDICATORCURRENT, INDIC_MATCH_BG);
876+
for (const auto& h : _hits)
877+
for (size_t i = 0; i < h.matchStarts.size(); ++i)
878+
S(SCI_INDICATORFILLRANGE,
879+
h.displayLineStart + h.matchStarts[i],
880+
h.matchLens[i]);
881+
846882
S(SCI_SETINDICATORCURRENT, INDIC_MATCH_FORE);
847883
for (const auto& h : _hits)
848884
for (size_t i = 0; i < h.matchStarts.size(); ++i)

src/ResultDock.h

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,31 +94,40 @@ class ResultDock final
9494
static constexpr COLORREF LineBgDark = RGB(0x3A, 0x3D, 0x33);
9595

9696
/* Line‑number digits (already used) */
97-
static constexpr COLORREF LineNrLight = RGB(0x80, 0xC0, 0xFF);
97+
static constexpr COLORREF LineNrLight = RGB(0x40, 0x80, 0xBF);
9898
static constexpr COLORREF LineNrDark = RGB(0x80, 0xC0, 0xFF);
9999

100100
/* Match substring (already used) */
101-
static constexpr COLORREF MatchLight = RGB(0xA6, 0xE2, 0x2E);
101+
static constexpr COLORREF MatchLight = RGB(0xFA, 0x3F, 0x34);
102102
static constexpr COLORREF MatchDark = RGB(0xA6, 0xE2, 0x2E);
103103

104+
static constexpr COLORREF MatchBgLight = RGB(0xFF, 0xFF, 0xBF);
105+
104106
/* NEW – first headline: Search "..." (…) */
105-
static constexpr COLORREF HeaderBgLight = RGB(0x79, 0x94, 0x86); // pale teal
106-
static constexpr COLORREF HeaderBgDark = RGB(0x2E, 0x3D, 0x36); // deep teal
107+
static constexpr COLORREF HeaderBgLight = RGB(0xD5, 0xFF, 0xD5);
108+
static constexpr COLORREF HeaderBgDark = RGB(0x2E, 0x3D, 0x36);
107109

108110
/* NEW – file path line (4‑space indent) */
109-
static constexpr COLORREF FilePathFgLight = RGB(0xC8, 0xAE, 0x6F); // khaki
110-
static constexpr COLORREF FilePathFgDark = RGB(0xEB, 0xCB, 0x8B); // sand
111+
static constexpr COLORREF FilePathFgLight = RGB(0xA0, 0x80, 0x50);
112+
static constexpr COLORREF FilePathFgDark = RGB(0xEB, 0xCB, 0x8B);
111113

112-
static constexpr COLORREF HeaderFg = RGB(0, 0, 0); //black
114+
static constexpr COLORREF HeaderFg = RGB(0, 0, 0);
113115

114116
/* Fold markers: glyph (“+”/“-”/lines) */
115117
static constexpr COLORREF FoldGlyphLight = RGB(80, 80, 80);
116-
static constexpr COLORREF FoldGlyphDark = RGB(128, 128, 128); // dark‑mode glyph
118+
static constexpr COLORREF FoldGlyphDark = RGB(128, 128, 128);
117119

118-
static constexpr COLORREF FoldBoxLight = FoldGlyphLight; // light theme
120+
static constexpr COLORREF FoldBoxLight = FoldGlyphLight;
119121
static constexpr COLORREF FoldBoxDark = FoldGlyphDark;
120122

121123
static constexpr COLORREF FoldHiMint = RGB(121, 148, 134);
124+
125+
// transparency for the caret‑line indicator (0)
126+
static constexpr int CaretLineAlphaLight = 64;
127+
static constexpr int CaretLineAlphaDark = 128;
128+
129+
static constexpr COLORREF CaretLineBackLight = RGB(0xE0, 0xE0, 0xFF);
130+
static constexpr COLORREF CaretLineBackDark = RGB(0x20, 0x20, 0x20);
122131
};
123132

124133
/* === construction ================================================= */
@@ -154,6 +163,7 @@ class ResultDock final
154163
static constexpr int INDIC_LINE_BACKGROUND = 8;
155164
static constexpr int INDIC_LINENUMBER_FORE = 9;
156165
static constexpr int INDIC_MATCH_FORE = 10;
166+
static constexpr int INDIC_MATCH_BG = 14;
157167
static constexpr int INDIC_HEADER_BACKGROUND = 11; // headline back‑colour
158168
static constexpr int INDIC_FILEPATH_FORE = 12; // file‑path foreground
159169
static constexpr int INDIC_HEADER_FORE = 13; // NEW – text colour

0 commit comments

Comments
 (0)