diff options
author | Neil <nyamatongwe@gmail.com> | 2021-05-05 13:32:23 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2021-05-05 13:32:23 +1000 |
commit | f35a4835be4888005f19dd8fbd638ff209bb77fc (patch) | |
tree | 5e7ee5d9b00ca9707754964dad68eb4b404cee97 /src/ViewStyle.h | |
parent | 9b8ce7d9a3b7cbfe1a56fdb422f9e91b8f3ece14 (diff) | |
download | scintilla-mirror-f35a4835be4888005f19dd8fbd638ff209bb77fc.tar.gz |
Hoist selection text colour into SelectionForeground function and whether
there is a selection text colour into ViewStyle::SelectionTextDrawn.
Pass EditModel to SelectionBackground so focus can be used in a future change.
Simplify code, use const and better names.
Prefer explicit iterator type to auto in cases where it makes little difference.
Diffstat (limited to 'src/ViewStyle.h')
-rw-r--r-- | src/ViewStyle.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ViewStyle.h b/src/ViewStyle.h index 27abfdf6f..4118f0daf 100644 --- a/src/ViewStyle.h +++ b/src/ViewStyle.h @@ -201,7 +201,8 @@ public: int ctrlCharPadding; // the padding around control character text blobs int lastSegItalicsOffset; // the offset so as not to clip italic characters at EOLs - std::map<int, std::optional<ColourAlpha>> elementColours; + using ElementMap = std::map<int, std::optional<ColourAlpha>>; + ElementMap elementColours; std::set<int> elementAllowsTranslucent; WrapAppearance wrap; @@ -234,13 +235,14 @@ public: bool IsLineFrameOpaque(bool caretActive, bool lineContainsCaret) const noexcept; std::optional<ColourAlpha> Background(int marksOfLine, bool caretActive, bool lineContainsCaret) const; bool SelectionBackgroundDrawn() const noexcept; + bool SelectionTextDrawn() const; bool WhitespaceBackgroundDrawn() const noexcept; ColourAlpha WrapColour() const noexcept; void AddMultiEdge(uptr_t wParam, sptr_t lParam); - std::optional<ColourAlpha> ElementColour(int index) const; - bool ElementAllowsTranslucent(int index) const; + std::optional<ColourAlpha> ElementColour(int element) const; + bool ElementAllowsTranslucent(int element) const; bool SetWrapState(int wrapState_) noexcept; bool SetWrapVisualFlags(int wrapVisualFlags_) noexcept; |