|
|
|
@ -15,7 +15,7 @@
|
|
|
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
#include <time.h> |
|
|
|
|
#include <shlwapi.h> |
|
|
|
|
|
|
|
|
|
#include <shlobj.h> |
|
|
|
|
#include "Parameters.h" |
|
|
|
|
#include "ScintillaEditView.h" |
|
|
|
@ -8820,29 +8820,91 @@ EolType convertIntToFormatType(int value, EolType defvalue)
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#include <array> |
|
|
|
|
|
|
|
|
|
struct HLSColour |
|
|
|
|
void NppParameters::initTabCustomColors() |
|
|
|
|
{ |
|
|
|
|
WORD _hue; |
|
|
|
|
WORD _lightness; |
|
|
|
|
WORD _saturation; |
|
|
|
|
StyleArray& stylers = getMiscStylerArray(); |
|
|
|
|
|
|
|
|
|
COLORREF toRGB() const { return ColorHLSToRGB(_hue, _lightness, _saturation); } |
|
|
|
|
}; |
|
|
|
|
const Style* pStyle = stylers.findByName(L"Tab color 1"); |
|
|
|
|
if (pStyle) |
|
|
|
|
{ |
|
|
|
|
individualTabHues[0].changeHLSFrom(pStyle->_bgColor); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
pStyle = stylers.findByName(L"Tab color 2"); |
|
|
|
|
if (pStyle) |
|
|
|
|
{ |
|
|
|
|
individualTabHues[1].changeHLSFrom(pStyle->_bgColor); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
pStyle = stylers.findByName(L"Tab color 3"); |
|
|
|
|
if (pStyle) |
|
|
|
|
{ |
|
|
|
|
individualTabHues[2].changeHLSFrom(pStyle->_bgColor); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
pStyle = stylers.findByName(L"Tab color 4"); |
|
|
|
|
if (pStyle) |
|
|
|
|
{ |
|
|
|
|
individualTabHues[3].changeHLSFrom(pStyle->_bgColor); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
pStyle = stylers.findByName(L"Tab color 5"); |
|
|
|
|
if (pStyle) |
|
|
|
|
{ |
|
|
|
|
individualTabHues[4].changeHLSFrom(pStyle->_bgColor); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pStyle = stylers.findByName(L"Tab color dark mode 1"); |
|
|
|
|
if (pStyle) |
|
|
|
|
{ |
|
|
|
|
individualTabHuesFor_Dark[0].changeHLSFrom(pStyle->_bgColor); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
pStyle = stylers.findByName(L"Tab color dark mode 2"); |
|
|
|
|
if (pStyle) |
|
|
|
|
{ |
|
|
|
|
individualTabHuesFor_Dark[1].changeHLSFrom(pStyle->_bgColor); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
using IndividualTabColours = std::array<HLSColour, 5>; |
|
|
|
|
pStyle = stylers.findByName(L"Tab color dark mode 3"); |
|
|
|
|
if (pStyle) |
|
|
|
|
{ |
|
|
|
|
individualTabHuesFor_Dark[2].changeHLSFrom(pStyle->_bgColor); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static constexpr IndividualTabColours individualTabHuesFor_Dark{ { HLSColour{37, 60, 60}, HLSColour{70, 60, 60}, HLSColour{144, 70, 60}, HLSColour{255, 60, 60}, HLSColour{195, 60, 60} } }; |
|
|
|
|
static constexpr IndividualTabColours individualTabHues{ { HLSColour{37, 210, 150}, HLSColour{70, 210, 150}, HLSColour{144, 210, 150}, HLSColour{255, 210, 150}, HLSColour{195, 210, 150}} }; |
|
|
|
|
pStyle = stylers.findByName(L"Tab color dark mode 4"); |
|
|
|
|
if (pStyle) |
|
|
|
|
{ |
|
|
|
|
individualTabHuesFor_Dark[3].changeHLSFrom(pStyle->_bgColor); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
pStyle = stylers.findByName(L"Tab color dark mode 5"); |
|
|
|
|
if (pStyle) |
|
|
|
|
{ |
|
|
|
|
individualTabHuesFor_Dark[4].changeHLSFrom(pStyle->_bgColor); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void NppParameters::setIndividualTabColour(COLORREF colour2Set, int colourIndex, bool isDarkMode) |
|
|
|
|
{ |
|
|
|
|
if (colourIndex < 0 || colourIndex > 4) return; |
|
|
|
|
|
|
|
|
|
if (isDarkMode) |
|
|
|
|
individualTabHuesFor_Dark[colourIndex].changeHLSFrom(colour2Set); |
|
|
|
|
else |
|
|
|
|
individualTabHues[colourIndex].changeHLSFrom(colour2Set); |
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
COLORREF NppParameters::getIndividualTabColour(int colourIndex, bool themeDependant, bool saturated) |
|
|
|
|
COLORREF NppParameters::getIndividualTabColour(int colourIndex, bool isDarkMode, bool saturated) |
|
|
|
|
{ |
|
|
|
|
if (colourIndex < 0 || colourIndex > 4) return {}; |
|
|
|
|
|
|
|
|
|
HLSColour result; |
|
|
|
|
if (themeDependant) |
|
|
|
|
if (isDarkMode) |
|
|
|
|
{ |
|
|
|
|
result = individualTabHuesFor_Dark[colourIndex]; |
|
|
|
|
|
|
|
|
|