From fd1f785b896ed094935ca29bb0c409eee0081afd Mon Sep 17 00:00:00 2001 From: mpheath Date: Sat, 2 Mar 2024 16:37:33 +1000 Subject: [PATCH] Add Change History colour configuration Fix #12321, fix #13915, close #14819 --- PowerEditor/installer/themes/Bespin.xml | 4 ++ PowerEditor/installer/themes/Black board.xml | 4 ++ PowerEditor/installer/themes/Choco.xml | 4 ++ .../installer/themes/DansLeRuSH-Dark.xml | 4 ++ .../installer/themes/DarkModeDefault.xml | 4 ++ PowerEditor/installer/themes/Deep Black.xml | 4 ++ PowerEditor/installer/themes/Hello Kitty.xml | 4 ++ .../installer/themes/HotFudgeSundae.xml | 4 ++ .../installer/themes/Mono Industrial.xml | 4 ++ PowerEditor/installer/themes/Monokai.xml | 4 ++ PowerEditor/installer/themes/MossyLawn.xml | 4 ++ PowerEditor/installer/themes/Navajo.xml | 4 ++ PowerEditor/installer/themes/Obsidian.xml | 4 ++ .../installer/themes/Plastic Code Wrap.xml | 4 ++ PowerEditor/installer/themes/Ruby Blue.xml | 4 ++ .../installer/themes/Solarized-light.xml | 4 ++ PowerEditor/installer/themes/Solarized.xml | 4 ++ PowerEditor/installer/themes/Twilight.xml | 4 ++ PowerEditor/installer/themes/Vibrant Ink.xml | 4 ++ PowerEditor/installer/themes/Zenburn.xml | 4 ++ PowerEditor/installer/themes/khaki.xml | 4 ++ .../installer/themes/vim Dark Blue.xml | 4 ++ .../ScintillaComponent/ScintillaEditView.cpp | 52 +++++++++++++++++++ PowerEditor/src/ScintillaComponent/colors.h | 6 +++ PowerEditor/src/stylers.model.xml | 4 ++ 25 files changed, 150 insertions(+) diff --git a/PowerEditor/installer/themes/Bespin.xml b/PowerEditor/installer/themes/Bespin.xml index 7adbf22653a..ef7a97500ac 100644 --- a/PowerEditor/installer/themes/Bespin.xml +++ b/PowerEditor/installer/themes/Bespin.xml @@ -810,6 +810,10 @@ Credits: + + + + diff --git a/PowerEditor/installer/themes/Black board.xml b/PowerEditor/installer/themes/Black board.xml index 094ab1b5fa5..899809fc848 100644 --- a/PowerEditor/installer/themes/Black board.xml +++ b/PowerEditor/installer/themes/Black board.xml @@ -808,6 +808,10 @@ Credits: + + + + diff --git a/PowerEditor/installer/themes/Choco.xml b/PowerEditor/installer/themes/Choco.xml index 30aa65bc0ac..664535a358d 100644 --- a/PowerEditor/installer/themes/Choco.xml +++ b/PowerEditor/installer/themes/Choco.xml @@ -808,6 +808,10 @@ Credits: + + + + diff --git a/PowerEditor/installer/themes/DansLeRuSH-Dark.xml b/PowerEditor/installer/themes/DansLeRuSH-Dark.xml index 209ca49beff..2fd91e766d0 100644 --- a/PowerEditor/installer/themes/DansLeRuSH-Dark.xml +++ b/PowerEditor/installer/themes/DansLeRuSH-Dark.xml @@ -925,6 +925,10 @@ Installation : Copy this file to "%APPDATA%\Notepad++\themes" and in a portable + + + + diff --git a/PowerEditor/installer/themes/DarkModeDefault.xml b/PowerEditor/installer/themes/DarkModeDefault.xml index 182e1bbf683..1bd7edb7ca3 100644 --- a/PowerEditor/installer/themes/DarkModeDefault.xml +++ b/PowerEditor/installer/themes/DarkModeDefault.xml @@ -1506,6 +1506,10 @@ License: GPL2 + + + + diff --git a/PowerEditor/installer/themes/Deep Black.xml b/PowerEditor/installer/themes/Deep Black.xml index 57aeb78324b..541441febf1 100644 --- a/PowerEditor/installer/themes/Deep Black.xml +++ b/PowerEditor/installer/themes/Deep Black.xml @@ -813,6 +813,10 @@ https://notepad-plus-plus.org/donate/ + + + + diff --git a/PowerEditor/installer/themes/Hello Kitty.xml b/PowerEditor/installer/themes/Hello Kitty.xml index 0c643a2d9bb..e4e57c3e7e1 100644 --- a/PowerEditor/installer/themes/Hello Kitty.xml +++ b/PowerEditor/installer/themes/Hello Kitty.xml @@ -785,6 +785,10 @@ so your enhanced file can be included in Notepad++ future release. + + + + diff --git a/PowerEditor/installer/themes/HotFudgeSundae.xml b/PowerEditor/installer/themes/HotFudgeSundae.xml index 1ef584d65d0..c31c30da854 100644 --- a/PowerEditor/installer/themes/HotFudgeSundae.xml +++ b/PowerEditor/installer/themes/HotFudgeSundae.xml @@ -942,6 +942,10 @@ Installation: + + + + diff --git a/PowerEditor/installer/themes/Mono Industrial.xml b/PowerEditor/installer/themes/Mono Industrial.xml index 78d98d93135..04c43e53f45 100644 --- a/PowerEditor/installer/themes/Mono Industrial.xml +++ b/PowerEditor/installer/themes/Mono Industrial.xml @@ -812,6 +812,10 @@ Credits: + + + + diff --git a/PowerEditor/installer/themes/Monokai.xml b/PowerEditor/installer/themes/Monokai.xml index 2e9acd7a3fe..ddba31387a9 100644 --- a/PowerEditor/installer/themes/Monokai.xml +++ b/PowerEditor/installer/themes/Monokai.xml @@ -828,6 +828,10 @@ Credits: + + + + diff --git a/PowerEditor/installer/themes/MossyLawn.xml b/PowerEditor/installer/themes/MossyLawn.xml index 92b87b494af..1c46938a868 100644 --- a/PowerEditor/installer/themes/MossyLawn.xml +++ b/PowerEditor/installer/themes/MossyLawn.xml @@ -942,6 +942,10 @@ Installation: + + + + diff --git a/PowerEditor/installer/themes/Navajo.xml b/PowerEditor/installer/themes/Navajo.xml index 13805e313ac..4a427f1c8b6 100644 --- a/PowerEditor/installer/themes/Navajo.xml +++ b/PowerEditor/installer/themes/Navajo.xml @@ -939,6 +939,10 @@ Installation: + + + + diff --git a/PowerEditor/installer/themes/Obsidian.xml b/PowerEditor/installer/themes/Obsidian.xml index fc5eccc8595..84e75d3f124 100644 --- a/PowerEditor/installer/themes/Obsidian.xml +++ b/PowerEditor/installer/themes/Obsidian.xml @@ -816,6 +816,10 @@ Notepad++ Custom Style + + + + diff --git a/PowerEditor/installer/themes/Plastic Code Wrap.xml b/PowerEditor/installer/themes/Plastic Code Wrap.xml index 1b293ced4fa..6940b2afc05 100644 --- a/PowerEditor/installer/themes/Plastic Code Wrap.xml +++ b/PowerEditor/installer/themes/Plastic Code Wrap.xml @@ -824,6 +824,10 @@ Credits: + + + + diff --git a/PowerEditor/installer/themes/Ruby Blue.xml b/PowerEditor/installer/themes/Ruby Blue.xml index 394dd14ef7a..5b580b5547b 100644 --- a/PowerEditor/installer/themes/Ruby Blue.xml +++ b/PowerEditor/installer/themes/Ruby Blue.xml @@ -662,6 +662,10 @@ http://sourceforge.net/donate/index.php?group_id=95717 + + + + diff --git a/PowerEditor/installer/themes/Solarized-light.xml b/PowerEditor/installer/themes/Solarized-light.xml index 3033987c3bc..8a83aa71f32 100644 --- a/PowerEditor/installer/themes/Solarized-light.xml +++ b/PowerEditor/installer/themes/Solarized-light.xml @@ -950,6 +950,10 @@ Installation: + + + + diff --git a/PowerEditor/installer/themes/Solarized.xml b/PowerEditor/installer/themes/Solarized.xml index 5613e31966b..3231995abc5 100644 --- a/PowerEditor/installer/themes/Solarized.xml +++ b/PowerEditor/installer/themes/Solarized.xml @@ -1332,6 +1332,10 @@ Installation: + + + + diff --git a/PowerEditor/installer/themes/Twilight.xml b/PowerEditor/installer/themes/Twilight.xml index dc9dec41088..40f9e079569 100644 --- a/PowerEditor/installer/themes/Twilight.xml +++ b/PowerEditor/installer/themes/Twilight.xml @@ -813,6 +813,10 @@ Credits: + + + + diff --git a/PowerEditor/installer/themes/Vibrant Ink.xml b/PowerEditor/installer/themes/Vibrant Ink.xml index 5bc87745c86..b4e242645e6 100644 --- a/PowerEditor/installer/themes/Vibrant Ink.xml +++ b/PowerEditor/installer/themes/Vibrant Ink.xml @@ -784,6 +784,10 @@ http://sourceforge.net/donate/index.php?group_id=95717 + + + + diff --git a/PowerEditor/installer/themes/Zenburn.xml b/PowerEditor/installer/themes/Zenburn.xml index bd9cac80126..9272fcd63e1 100644 --- a/PowerEditor/installer/themes/Zenburn.xml +++ b/PowerEditor/installer/themes/Zenburn.xml @@ -1474,6 +1474,10 @@ License: GPL2 + + + + diff --git a/PowerEditor/installer/themes/khaki.xml b/PowerEditor/installer/themes/khaki.xml index e8bd71cda1e..7e173bb827b 100644 --- a/PowerEditor/installer/themes/khaki.xml +++ b/PowerEditor/installer/themes/khaki.xml @@ -939,6 +939,10 @@ Installation: + + + + diff --git a/PowerEditor/installer/themes/vim Dark Blue.xml b/PowerEditor/installer/themes/vim Dark Blue.xml index ae502120328..2363fcca0ee 100644 --- a/PowerEditor/installer/themes/vim Dark Blue.xml +++ b/PowerEditor/installer/themes/vim Dark Blue.xml @@ -776,6 +776,10 @@ + + + + diff --git a/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp index 7366282d4c8..f89dede3952 100644 --- a/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp @@ -3003,6 +3003,58 @@ void ScintillaEditView::performGlobalStyles() execute(SCI_SETMARGINTYPEN, _SC_MARGE_CHANGEHISTORY, SC_MARGIN_COLOUR); execute(SCI_SETMARGINBACKN, _SC_MARGE_CHANGEHISTORY, changeHistoryMarginColor); + COLORREF changeModifiedfgColor = orange; + COLORREF changeModifiedbgColor = orange; + pStyle = stylers.findByName(TEXT("Change History modified")); + if (pStyle) + { + changeModifiedfgColor = pStyle->_fgColor; + changeModifiedbgColor = pStyle->_bgColor; + } + execute(SCI_MARKERSETFORE, SC_MARKNUM_HISTORY_MODIFIED, changeModifiedfgColor); + execute(SCI_MARKERSETBACK, SC_MARKNUM_HISTORY_MODIFIED, changeModifiedbgColor); + execute(SCI_INDICSETFORE, INDICATOR_HISTORY_MODIFIED_INSERTION, changeModifiedfgColor); + execute(SCI_INDICSETFORE, INDICATOR_HISTORY_MODIFIED_DELETION, changeModifiedfgColor); + + COLORREF changeRevertModifiedfgColor = yellowGreen; + COLORREF changeRevertModifiedbgColor = yellowGreen; + pStyle = stylers.findByName(TEXT("Change History revert modified")); + if (pStyle) + { + changeRevertModifiedfgColor = pStyle->_fgColor; + changeRevertModifiedbgColor = pStyle->_bgColor; + } + execute(SCI_MARKERSETFORE, SC_MARKNUM_HISTORY_REVERTED_TO_MODIFIED, changeRevertModifiedfgColor); + execute(SCI_MARKERSETBACK, SC_MARKNUM_HISTORY_REVERTED_TO_MODIFIED, changeRevertModifiedbgColor); + execute(SCI_INDICSETFORE, INDICATOR_HISTORY_REVERTED_TO_MODIFIED_INSERTION, changeRevertModifiedfgColor); + execute(SCI_INDICSETFORE, INDICATOR_HISTORY_REVERTED_TO_MODIFIED_DELETION, changeRevertModifiedfgColor); + + COLORREF changeRevertOriginfgColor = darkCyan; + COLORREF changeRevertOriginbgColor = darkCyan; + pStyle = stylers.findByName(TEXT("Change History revert origin")); + if (pStyle) + { + changeRevertOriginfgColor = pStyle->_fgColor; + changeRevertOriginbgColor = pStyle->_bgColor; + } + execute(SCI_MARKERSETFORE, SC_MARKNUM_HISTORY_REVERTED_TO_ORIGIN, changeRevertOriginfgColor); + execute(SCI_MARKERSETBACK, SC_MARKNUM_HISTORY_REVERTED_TO_ORIGIN, changeRevertOriginbgColor); + execute(SCI_INDICSETFORE, INDICATOR_HISTORY_REVERTED_TO_ORIGIN_INSERTION, changeRevertOriginfgColor); + execute(SCI_INDICSETFORE, INDICATOR_HISTORY_REVERTED_TO_ORIGIN_DELETION, changeRevertOriginfgColor); + + COLORREF changeSavedfgColor = midGreen; + COLORREF changeSavedbgColor = midGreen; + pStyle = stylers.findByName(TEXT("Change History saved")); + if (pStyle) + { + changeSavedfgColor = pStyle->_fgColor; + changeSavedbgColor = pStyle->_bgColor; + } + execute(SCI_MARKERSETFORE, SC_MARKNUM_HISTORY_SAVED, changeSavedfgColor); + execute(SCI_MARKERSETBACK, SC_MARKNUM_HISTORY_SAVED, changeSavedbgColor); + execute(SCI_INDICSETFORE, INDICATOR_HISTORY_SAVED_INSERTION, changeSavedfgColor); + execute(SCI_INDICSETFORE, INDICATOR_HISTORY_SAVED_DELETION, changeSavedfgColor); + COLORREF urlHoveredFG = grey; pStyle = stylers.findByName(TEXT("URL hovered")); if (pStyle) diff --git a/PowerEditor/src/ScintillaComponent/colors.h b/PowerEditor/src/ScintillaComponent/colors.h index 7e99f3327ad..e8540739490 100644 --- a/PowerEditor/src/ScintillaComponent/colors.h +++ b/PowerEditor/src/ScintillaComponent/colors.h @@ -52,3 +52,9 @@ const COLORREF extremeLitePurple = RGB(0xF8, 0xE8, 0xFF); const COLORREF veryLitePurple = RGB(0xE7, 0xD8, 0xE9); const COLORREF liteBerge = RGB(0xFE, 0xFC, 0xF5); const COLORREF berge = RGB(0xFD, 0xF8, 0xE3); + + +// Change History default colours. Modified uses existing orange colour +const COLORREF midGreen = RGB(0, 0xA0, 0); // saved +const COLORREF darkCyan = RGB(0x40, 0xA0, 0xBF); // revert origin +const COLORREF yellowGreen = RGB(0xA0, 0xC0, 0); // revert modified diff --git a/PowerEditor/src/stylers.model.xml b/PowerEditor/src/stylers.model.xml index 8296223721d..5fd52f3226d 100644 --- a/PowerEditor/src/stylers.model.xml +++ b/PowerEditor/src/stylers.model.xml @@ -1501,6 +1501,10 @@ + + + +