+ cln: IME color styler: cleanup merged code

This commit is contained in:
RaiKoHoff 2020-01-17 13:12:34 +01:00
parent 5ac1e18781
commit d146de76d5
6 changed files with 17 additions and 28 deletions

View File

@ -1 +1 @@
2709
2710

View File

@ -3,7 +3,7 @@
<assemblyIdentity
name="Notepad3"
processorArchitecture="*"
version="5.20.116.2709"
version="5.20.117.2710"
type="win32"
/>
<description>Notepad3 BETA</description>

View File

@ -68,7 +68,7 @@ typedef enum {
STY_MARK_OCC = 13,
STY_URL_HOTSPOT = 14,
STY_MULTI_EDIT = 15,
STY_IME_COLOR = 17,
STY_IME_COLOR = 16,
STY_INVISIBLE = 17,
STY_READONLY = 18

View File

@ -22,8 +22,8 @@ SCLEX_NULL, IDS_LEX_DEF_TXT, L"Common Base", L"", L"",
/* 12 */ { {_STYLE_GETSTYLEID(STY_BOOK_MARK)}, IDS_LEX_STD_BKMRK, L"Bookmarks and Folding (Colors, Size)", L"size:+2; fore:#000000; back:#00DC00; alpha:100", L"" },
/* 13 */ { {_STYLE_GETSTYLEID(STY_MARK_OCC)}, IDS_LEX_STR_63262, L"Mark Occurrences (Indicator)", L"fore:#3399FF; alpha:60; alpha2:60; indic_roundbox", L"" },
/* 14 */ { {_STYLE_GETSTYLEID(STY_URL_HOTSPOT)}, IDS_LEX_STR_63264, L"Hyperlink Hotspots", L"fore:#0000FF; back:#0000BF; indic_plain", L"" },
/* 16 */ { {_STYLE_GETSTYLEID(STY_IME_COLOR)}, IDS_LEX_STR_63352, L"Inline-IME Color", L"fore:#00AA00", L"" },
/* 15 */ { {_STYLE_GETSTYLEID(STY_MULTI_EDIT)}, IDS_LEX_STR_63354, L"Multi Edit Indicator", L"fore:#FFA000; alpha:60; alpha2:180; indic_roundbox", L"" },
/* 16 */ { {_STYLE_GETSTYLEID(STY_IME_COLOR)}, IDS_LEX_STR_63352, L"Inline-IME Color", L"fore:#00AA00", L"" },
EDITLEXER_SENTINEL } };
@ -45,8 +45,8 @@ SCLEX_NULL, IDS_LEX_STR_63266, L"2nd Common Base", L"", L"",
/* 12 */ { {_STYLE_GETSTYLEID(STY_BOOK_MARK)}, IDS_LEX_2ND_BKMRK, L"2nd Bookmarks and Folding (Colors, Size)", L"size:+2; fore:#000000; back:#00DC00; charset:2; case:U; alpha:100", L"" },
/* 13 */ { {_STYLE_GETSTYLEID(STY_MARK_OCC)}, IDS_LEX_STR_63263, L"2nd Mark Occurrences (Indicator)", L"fore:#0000FF; alpha:60; alpha2:60; indic_box", L"" },
/* 14 */ { {_STYLE_GETSTYLEID(STY_URL_HOTSPOT)}, IDS_LEX_STR_63265, L"2nd Hyperlink Hotspots", L"fore:#00D000; back:#009C00; alpha:180; indic_compositionthin", L"" },
/* 15 */ { {_STYLE_GETSTYLEID(STY_MULTI_EDIT)}, IDS_LEX_STR_63355, L"2nd Multi Edit Indicator", L"fore:#00A5FF; indic_box", L"" },
/* 16 */ { {_STYLE_GETSTYLEID(STY_IME_COLOR)}, IDS_LEX_STR_63353, L"2nd Inline-IME Color", L"fore:#FF0000", L"" },
/* 15 */ { {_STYLE_GETSTYLEID(STY_MULTI_EDIT)}, IDS_LEX_STR_63355, L"Multi Edit Indicator", L"fore:#00A5FF; indic_box", L"" },
EDITLEXER_SENTINEL } };

View File

@ -1142,20 +1142,13 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew)
#define _SC_INDIC_IME_CONVERTED (INDIC_IME + 2)
#define _SC_INDIC_IME_UNKNOWN INDIC_IME_MAX
if (Style_StrGetColor(pCurrentStandard->Styles[STY_IME_COLOR].szValue, FOREGROUND_LAYER, &dColor)) // IME foregr
{
SciCall_IndicSetFore(_SC_INDIC_IME_INPUT, dColor);
SciCall_IndicSetFore(_SC_INDIC_IME_TARGET, dColor);
SciCall_IndicSetFore(_SC_INDIC_IME_CONVERTED, dColor);
SciCall_IndicSetFore(_SC_INDIC_IME_UNKNOWN, dColor);
} else {
SciCall_IndicSetFore(_SC_INDIC_IME_INPUT, dColor);
SciCall_IndicSetFore(_SC_INDIC_IME_TARGET, dColor);
SciCall_IndicSetFore(_SC_INDIC_IME_CONVERTED, dColor);
SciCall_IndicSetFore(_SC_INDIC_IME_UNKNOWN, dColor);
}
COLORREF rgb = RGB(0xFF, 0xA0, 0x00);
Style_StrGetColor(pCurrentStandard->Styles[STY_IME_COLOR].szValue, FOREGROUND_LAYER, &rgb); // IME foregr
SciCall_IndicSetFore(_SC_INDIC_IME_INPUT, rgb);
SciCall_IndicSetFore(_SC_INDIC_IME_TARGET, rgb);
SciCall_IndicSetFore(_SC_INDIC_IME_CONVERTED, rgb);
SciCall_IndicSetFore(_SC_INDIC_IME_UNKNOWN, rgb);
COLORREF rgb;
if (pLexNew != &lexANSI) {
Style_SetStyles(hwnd, pCurrentStandard->Styles[STY_CTRL_CHR].iStyle, pCurrentStandard->Styles[STY_CTRL_CHR].szValue, false); // control char
}
@ -1170,14 +1163,10 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew)
SendMessage(hwnd, SCI_SETADDITIONALSELFORE, 0, 0);
}
if (Style_StrGetColor(pCurrentStandard->Styles[STY_SEL_TXT].szValue, BACKGROUND_LAYER , &dColor)) { // selection back
SendMessage(hwnd, SCI_SETSELBACK, true, dColor);
SendMessage(hwnd, SCI_SETADDITIONALSELBACK, dColor, 0);
}
else {
SendMessage(hwnd, SCI_SETSELBACK, true, RGB(0xC0, 0xC0, 0xC0)); // use a default value...
SendMessage(hwnd, SCI_SETADDITIONALSELBACK, RGB(0xC0, 0xC0, 0xC0), 0);
}
rgb = RGB(0xC0, 0xC0, 0xC0);
Style_StrGetColor(pCurrentStandard->Styles[STY_SEL_TXT].szValue, BACKGROUND_LAYER, &rgb); // selection back
SendMessage(hwnd, SCI_SETSELBACK, true, rgb);
SendMessage(hwnd, SCI_SETADDITIONALSELBACK, rgb, 0);
if (Style_StrGetAlpha(pCurrentStandard->Styles[STY_SEL_TXT].szValue, &iValue, true)) { // selection alpha
SendMessage(hwnd, SCI_SETSELALPHA, iValue, 0);

View File

@ -8,8 +8,8 @@
#define SAPPNAME "Notepad3"
#define VERSION_MAJOR 5
#define VERSION_MINOR 20
#define VERSION_REV 116
#define VERSION_BUILD 2709
#define VERSION_REV 117
#define VERSION_BUILD 2710
#define SCINTILLA_VER 423
#define ONIGURUMA_REGEX_VER 6.9.4
#define UCHARDET_VER 2018.09.27