+chg: reusing size: definition of "Indentation Guide" scheme settings for text area offset to margin area

This commit is contained in:
METANEOCORTEX\Kotti 2024-02-26 19:38:09 +01:00
parent 16208cb2e2
commit fb0605f655
3 changed files with 16 additions and 3 deletions

View File

@ -2520,6 +2520,9 @@ static void _InitializeSciEditCtrl(HWND hwndEditCtrl)
SciCall_SetMarginTypeN(MARGIN_SCI_FOLDING, SC_MARGIN_COLOUR);
SciCall_SetMarginMaskN(MARGIN_SCI_FOLDING, SC_MASK_FOLDERS);
//~SciCall_SetMarginLeft(1); ~ set by STYLE_INDENTGUIDE
//~SciCall_SetMarginRight(1);
SciCall_SetEOLMode(Settings.DefaultEOLMode);
SciCall_SetPasteConvertEndings(true);
SciCall_UsePopUp(SC_POPUP_TEXT);

View File

@ -662,6 +662,8 @@ DeclareSciCallV2(SetMarginCursorN, SETMARGINCURSORN, uintptr_t, margin, int, cur
DeclareSciCallV2(SetFoldMarginColour, SETFOLDMARGINCOLOUR, bool, useSetting, COLORREF, colour);
DeclareSciCallV2(SetFoldMarginHiColour, SETFOLDMARGINHICOLOUR, bool, useSetting, COLORREF, colour);
DeclareSciCallV01(SetDefaultFoldDisplayText, SETDEFAULTFOLDDISPLAYTEXT, const char*, text);
DeclareSciCallV01(SetMarginLeft, SETMARGINLEFT, int, width);
DeclareSciCallV01(SetMarginRight, SETMARGINRIGHT, int, width);
DeclareSciCallR2(TextWidth, TEXTWIDTH, int, int, styleNumber, const char *, text);

View File

@ -4100,9 +4100,17 @@ void Style_SetStyles(HWND hwnd, const int iStyle, LPCWSTR lpszStyle, const float
}
// Size values are relative to BaseFontSize/CurrentFontSize
float fFontSize = fBaseFontSize;
Style_StrGetSizeFloatEx(lpszStyle, &fFontSize);
SendMessage(hwnd, SCI_STYLESETSIZEFRACTIONAL, iStyle, f2int(fFontSize * SC_FONT_SIZE_MULTIPLIER));
if (iStyle != STYLE_INDENTGUIDE) {
float fFontSize = fBaseFontSize;
Style_StrGetSizeFloatEx(lpszStyle, &fFontSize);
SendMessage(hwnd, SCI_STYLESETSIZEFRACTIONAL, iStyle, f2int(fFontSize * SC_FONT_SIZE_MULTIPLIER));
}
else {
float fWidth = 1.0;
Style_StrGetSizeFloatEx(lpszStyle, &fWidth);
int const width = clampi(f2int(fWidth), 0, 256);
SciCall_SetMarginLeft(width);
}
char localeNameA[LOCALE_NAME_MAX_LENGTH] = "en-us\0";
#if defined(HAVE_DYN_LOAD_LIBS_MUI_LNGS)