From f35a4835be4888005f19dd8fbd638ff209bb77fc Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 5 May 2021 13:32:23 +1000 Subject: 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. --- src/ViewStyle.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/ViewStyle.h') 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> elementColours; + using ElementMap = std::map>; + ElementMap elementColours; std::set elementAllowsTranslucent; WrapAppearance wrap; @@ -234,13 +235,14 @@ public: bool IsLineFrameOpaque(bool caretActive, bool lineContainsCaret) const noexcept; std::optional 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 ElementColour(int index) const; - bool ElementAllowsTranslucent(int index) const; + std::optional ElementColour(int element) const; + bool ElementAllowsTranslucent(int element) const; bool SetWrapState(int wrapState_) noexcept; bool SetWrapVisualFlags(int wrapVisualFlags_) noexcept; -- cgit v1.2.3