Skip to content

Commit ccfe336

Browse files
committed
added FlatList Option to ini
1 parent c37b24d commit ccfe336

File tree

4 files changed

+42
-46
lines changed

4 files changed

+42
-46
lines changed

src/MultiReplacePanel.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9921,14 +9921,15 @@ void MultiReplace::saveSettingsToIni(const std::wstring& iniFilePath) {
99219921
outFile << Encoding::wstringToUtf8(L"ButtonsMode=" + std::to_wstring(ButtonsMode) + L"\n");
99229922
outFile << Encoding::wstringToUtf8(L"UseList=" + std::to_wstring(useList) + L"\n");
99239923
outFile << Encoding::wstringToUtf8(L"HighlightMatch=" + std::to_wstring(highlightMatchEnabled ? 1 : 0) + L"\n");
9924+
outFile << Encoding::wstringToUtf8(L"ExportToBash=" + std::to_wstring(exportToBashEnabled ? 1 : 0) + L"\n");
99249925
outFile << Encoding::wstringToUtf8(L"Tooltips=" + std::to_wstring(tooltipsEnabled ? 1 : 0) + L"\n");
99259926
outFile << Encoding::wstringToUtf8(L"AlertNotFound=" + std::to_wstring(alertNotFoundEnabled ? 1 : 0) + L"\n");
99269927
outFile << Encoding::wstringToUtf8(L"DoubleClickEdits=" + std::to_wstring(doubleClickEditsEnabled ? 1 : 0) + L"\n");
99279928
outFile << Encoding::wstringToUtf8(L"HoverText=" + std::to_wstring(isHoverTextEnabled ? 1 : 0) + L"\n");
99289929
outFile << Encoding::wstringToUtf8(L"EditFieldSize=" + std::to_wstring(editFieldSize) + L"\n");
99299930
outFile << Encoding::wstringToUtf8(L"ListStatistics=" + std::to_wstring(listStatisticsEnabled ? 1 : 0) + L"\n");
99309931
outFile << Encoding::wstringToUtf8(L"StayAfterReplace=" + std::to_wstring(stayAfterReplaceEnabled ? 1 : 0) + L"\n");
9931-
outFile << Encoding::wstringToUtf8(L"ExportToBash=" + std::to_wstring(exportToBashEnabled ? 1 : 0) + L"\n");
9932+
outFile << Encoding::wstringToUtf8(L"FlatList=" + std::to_wstring(flatListEnabled) + L"\n");
99329933

99339934
// Convert and Store the scope options
99349935
int selection = IsDlgButtonChecked(_hSelf, IDC_SELECTION_RADIO) == BST_CHECKED ? 1 : 0;
@@ -10114,6 +10115,7 @@ void MultiReplace::loadSettingsFromIni() {
1011410115
updateUseListState(false);
1011510116

1011610117
highlightMatchEnabled = readBoolFromIniCache(L"Options", L"HighlightMatch", true);
10118+
exportToBashEnabled = readBoolFromIniCache(L"Options", L"ExportToBash", false);
1011710119
alertNotFoundEnabled = readBoolFromIniCache(L"Options", L"AlertNotFound", true);
1011810120
doubleClickEditsEnabled = readBoolFromIniCache(L"Options", L"DoubleClickEdits", true);
1011910121
isHoverTextEnabled = readBoolFromIniCache(L"Options", L"HoverText", true);
@@ -10124,7 +10126,7 @@ void MultiReplace::loadSettingsFromIni() {
1012410126

1012510127
listStatisticsEnabled = readBoolFromIniCache(L"Options", L"ListStatistics", false);
1012610128
stayAfterReplaceEnabled = readBoolFromIniCache(L"Options", L"StayAfterReplace", false);
10127-
exportToBashEnabled = readBoolFromIniCache(L"Options", L"ExportToBash", false);
10129+
flatListEnabled = readBoolFromIniCache(L"Options", L"FlatList", false);
1012810130

1012910131
// Loading and setting the scope
1013010132
int selection = readIntFromIniCache(L"Scope", L"Selection", 0);

src/MultiReplacePanel.h

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,6 @@ class MultiReplace : public StaticDialog
427427
static bool isLoggingEnabled;
428428
static bool isCaretPositionEnabled;
429429
static bool isLuaErrorDialogEnabled;
430-
bool flatListEnabled = true;
431430

432431
static std::vector<size_t> originalLineOrder; // Stores the order of lines before sorting
433432
static SortDirection currentSortState; // Status of column sort
@@ -595,18 +594,27 @@ class MultiReplace : public StaticDialog
595594
int checkMarkWidth_scaled;
596595
int crossWidth_scaled;
597596
int boxWidth_scaled;
598-
bool highlightMatchEnabled; // HighlightMatch during Find in List
597+
599598
std::map<ColumnID, int> columnIndices; // Mapping of ColumnID to ColumnIndex due to dynamic Columns
600599
int lastTooltipRow;
601600
int lastTooltipSubItem;
602601
int lastMouseX;
603602
int lastMouseY;
604-
bool exportToBashEnabled = false; // shows/hides the "Export to Bash" button
605-
bool isHoverTextEnabled = false; // Important to set on false as TIMER will be triggered at startup.
606-
bool isHoverTextSuppressed = false; // Temporarily supress HoverText to avoid flickering wehn Edit in list is open
607-
int editFieldSize;
608-
bool listStatisticsEnabled;
609-
bool stayAfterReplaceEnabled;
603+
604+
inline static bool tooltipsEnabled = true; // Status for showing Tooltips on Panel
605+
inline static bool alertNotFoundEnabled = true; // Status for Bell if String hasn't been found
606+
inline static bool doubleClickEditsEnabled = true; // Double click to Edit List entries
607+
inline static bool highlightMatchEnabled = true; // HighlightMatch during Find in List
608+
inline static bool exportToBashEnabled = false; // shows/hides the "Export to Bash" button
609+
inline static bool isHoverTextEnabled = true; // Important to set on false as TIMER will be triggered at startup.
610+
inline static int editFieldSize = 5; // Size of the edit field for find/replace input
611+
inline static bool listStatisticsEnabled = false; // Status for showing list statistics
612+
inline static bool stayAfterReplaceEnabled = false; // Status for keeping panel open after replace
613+
inline static bool flatListEnabled = false; // Status for flat list view
614+
615+
bool isHoverTextSuppressed = false; // Temporarily suppress HoverText to avoid flickering when Edit in list is open
616+
617+
610618
bool _isCancelRequested = false; // Flag to signal cancellation in Replace Files
611619
static bool _isShuttingDown; // Flag to signal app shutdown
612620
HBRUSH _hDlgBrush = nullptr; // Handle for the dialog's background brush
@@ -631,9 +639,6 @@ class MultiReplace : public StaticDialog
631639
bool findColumnLockedEnabled; // Indicates if the "Find what" column is locked
632640
bool replaceColumnLockedEnabled; // Indicates if the "Replace" column is locked
633641
bool commentsColumnLockedEnabled;// Indicates if the "Comments" column is locked
634-
bool tooltipsEnabled; // Status for showing Tooltips on Panel
635-
bool alertNotFoundEnabled; // Status for Bell if String hasn't be found
636-
bool doubleClickEditsEnabled; // Double click to Edit List entries
637642

638643
// Window DPI scaled size
639644
int MIN_WIDTH_scaled;

src/ResultDock.cpp

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,8 @@ void ResultDock::formatHitsLines(const SciSendFn& sciSend,
393393
}
394394
else /* additional hit on same line */
395395
{
396-
firstHitOnLine->matchStarts.push_back(
397-
(int)(prefixU8Len + hitStartInSlice));
396+
assert(firstHitOnLine != nullptr);
397+
firstHitOnLine->matchStarts.push_back((int)(prefixU8Len + hitStartInSlice));
398398
firstHitOnLine->matchLens.push_back((int)hitLenU8);
399399
h.displayLineStart = -1; // dummy
400400
}
@@ -638,7 +638,7 @@ void ResultDock::applyTheme()
638638
/* ----------------------------------------------------------------
639639
* 2) Margin (0=line #, 1=symbol, 2=fold) – always pitch‑black
640640
* ---------------------------------------------------------------- */
641-
COLORREF marginBg = RGB(0, 0, 0);
641+
COLORREF marginBg = dark ? RGB(0, 0, 0) : editorBg;
642642
COLORREF marginFg = dark ? RGB(200, 200, 200) : RGB(80, 80, 80);
643643

644644
for (int m = 0; m <= 2; ++m)
@@ -674,24 +674,19 @@ void ResultDock::applyTheme()
674674
* ---------------------------------------------------------------- */
675675
const COLORREF markerGlyph = dark ? RDColors::FoldGlyphDark : RDColors::FoldGlyphLight;
676676

677-
for (int id : { SC_MARKNUM_FOLDER,
678-
SC_MARKNUM_FOLDEREND,
679-
SC_MARKNUM_FOLDEROPEN,
680-
SC_MARKNUM_FOLDEROPENMID })
677+
for (int id : {
678+
SC_MARKNUM_FOLDER,
679+
SC_MARKNUM_FOLDEREND,
680+
SC_MARKNUM_FOLDEROPEN,
681+
SC_MARKNUM_FOLDEROPENMID,
682+
SC_MARKNUM_FOLDERSUB,
683+
SC_MARKNUM_FOLDERMIDTAIL,
684+
SC_MARKNUM_FOLDERTAIL
685+
})
681686
{
682687
S(SCI_MARKERSETBACK, id, markerGlyph);
683688
S(SCI_MARKERSETFORE, id, marginBg);
684-
685-
S(SCI_MARKERSETBACKSELECTED, id, RDColors::FoldHiMint);
686-
}
687-
for (int id : { SC_MARKNUM_FOLDERSUB,
688-
SC_MARKNUM_FOLDERMIDTAIL,
689-
SC_MARKNUM_FOLDERTAIL })
690-
{
691-
S(SCI_MARKERSETBACK, id, markerGlyph);
692-
S(SCI_MARKERSETFORE, id, markerGlyph);
693-
694-
S(SCI_MARKERSETBACKSELECTED, id, RDColors::FoldHiMint);
689+
S( SCI_MARKERSETBACKSELECTED, id, dark ? RDColors::FoldHiDark : RDColors::FoldHiLight );
695690
}
696691

697692
/* ----------------------------------------------------------------
@@ -700,22 +695,14 @@ void ResultDock::applyTheme()
700695
S(SCI_INDICSETSTYLE, 0, INDIC_ROUNDBOX);
701696
S(SCI_INDICSETFORE, 0, selBg);
702697
// 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);
698+
S(SCI_INDICSETALPHA, 0, dark ? RDColors::CaretLineAlphaDark : RDColors::CaretLineAlphaLight);
709699
S(SCI_INDICSETUNDER, 0, TRUE);
710700

711701
// keep visible (was missing in earlier patch)
712702
S(SCI_SETCARETLINEVISIBLE, TRUE, 0);
713703
S(SCI_SETCARETLINEBACK, selBg, 0);
714704
S(SCI_SETCARETLINEVISIBLE, TRUE, 0);
715-
S(SCI_SETCARETLINEBACK,
716-
dark ? selBg
717-
: RDColors::CaretLineBackLight,
718-
0);
705+
S(SCI_SETCARETLINEBACK, dark ? selBg : RDColors::CaretLineBackLight, 0);
719706

720707
/* ----------------------------------------------------------------
721708
* 6) Custom indicators (colours from RDColors)
@@ -724,7 +711,7 @@ void ResultDock::applyTheme()
724711
COLORREF lineNrFg = dark ? RDColors::LineNrDark : RDColors::LineNrLight;
725712
COLORREF matchFg = dark ? RDColors::MatchDark : RDColors::MatchLight;
726713
COLORREF matchBg = RDColors::MatchBgLight;
727-
COLORREF headerBg = dark ? RDColors::HeaderBgLight : RDColors::HeaderBgLight;
714+
COLORREF headerBg = dark ? RDColors::HeaderBgDark : RDColors::HeaderBgLight;
728715
COLORREF filePathFg = dark ? RDColors::FilePathFgDark : RDColors::FilePathFgLight;
729716

730717
/* 6‑a) Grey background for entire hit line -------------------- */

src/ResultDock.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ class ResultDock final
103103

104104
static constexpr COLORREF MatchBgLight = RGB(0xFF, 0xFF, 0xBF);
105105

106-
/* NEW – first headline: Search "..." (…) */
106+
/*first headline: Search "..." (…) */
107107
static constexpr COLORREF HeaderBgLight = RGB(0xD5, 0xFF, 0xD5);
108-
static constexpr COLORREF HeaderBgDark = RGB(0x2E, 0x3D, 0x36);
108+
static constexpr COLORREF HeaderBgDark = RGB(0x8F, 0xAF, 0x9F);
109109

110-
/* NEW – file path line (4‑space indent) */
110+
/* file path line (4‑space indent) */
111111
static constexpr COLORREF FilePathFgLight = RGB(0xA0, 0x80, 0x50);
112112
static constexpr COLORREF FilePathFgDark = RGB(0xEB, 0xCB, 0x8B);
113113

@@ -120,7 +120,9 @@ class ResultDock final
120120
static constexpr COLORREF FoldBoxLight = FoldGlyphLight;
121121
static constexpr COLORREF FoldBoxDark = FoldGlyphDark;
122122

123-
static constexpr COLORREF FoldHiMint = RGB(121, 148, 134);
123+
/* Marker background when selected */
124+
static constexpr COLORREF FoldHiDark = RGB(0x79, 0x94, 0x86);
125+
static constexpr COLORREF FoldHiLight = RGB(0xFF, 0x00, 0x00);
124126

125127
// transparency for the caret‑line indicator (0)
126128
static constexpr int CaretLineAlphaLight = 64;

0 commit comments

Comments
 (0)