From ab70e1041cb40c9d807a18ca7abb5c000adf2fdf Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 29 Mar 2021 08:25:51 +1100 Subject: Add SCI_SETELEMENTCOLOUR and related APIs to change colours of visible elements. Implement SC_ELEMENT_LIST* to change colours of autocompletion lists. --- src/ViewStyle.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/ViewStyle.cxx') diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index d1f866906..6aa459895 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -517,6 +518,20 @@ void ViewStyle::AddMultiEdge(uptr_t wParam, sptr_t lParam) { EdgeProperties(column, lParam)); } +std::optional ViewStyle::ElementColour(int index) const noexcept { + auto search = elementColours.find(index); + if (search != elementColours.end()) { + if (search->second.has_value()) { + return search->second; + } + } + return {}; +} + +bool ViewStyle::ElementAllowsTranslucent(int index) const noexcept { + return elementAllowsTranslucent.count(index) > 0; +} + bool ViewStyle::SetWrapState(int wrapState_) noexcept { WrapMode wrapStateWanted; switch (wrapState_) { -- cgit v1.2.3