aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ViewStyle.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2021-03-29 08:25:51 +1100
committerNeil <nyamatongwe@gmail.com>2021-03-29 08:25:51 +1100
commitab70e1041cb40c9d807a18ca7abb5c000adf2fdf (patch)
tree709d60718e9cf33924a625f82ff7999494027f6f /src/ViewStyle.cxx
parent508d037ed3389c5678addebefb62485ebfc10bb7 (diff)
downloadscintilla-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.cxx15
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_) {