diff options
author | Neil <nyamatongwe@gmail.com> | 2021-03-29 08:25:51 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2021-03-29 08:25:51 +1100 |
commit | ab70e1041cb40c9d807a18ca7abb5c000adf2fdf (patch) | |
tree | 709d60718e9cf33924a625f82ff7999494027f6f /src/ViewStyle.cxx | |
parent | 508d037ed3389c5678addebefb62485ebfc10bb7 (diff) | |
download | scintilla-mirror-ab70e1041cb40c9d807a18ca7abb5c000adf2fdf.tar.gz |
Add SCI_SETELEMENTCOLOUR and related APIs to change colours of visible elements.
Implement SC_ELEMENT_LIST* to change colours of autocompletion lists.
Diffstat (limited to 'src/ViewStyle.cxx')
-rw-r--r-- | src/ViewStyle.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
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 <string_view> #include <vector> #include <map> +#include <set> #include <optional> #include <algorithm> #include <memory> @@ -517,6 +518,20 @@ void ViewStyle::AddMultiEdge(uptr_t wParam, sptr_t lParam) { EdgeProperties(column, lParam)); } +std::optional<ColourAlpha> 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_) { |