aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx2
-rw-r--r--src/Geometry.h4
-rw-r--r--src/ViewStyle.cxx16
3 files changed, 21 insertions, 1 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index e6a31f11a..17749d799 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -7200,7 +7200,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
break;
case SCI_GETELEMENTCOLOUR:
- return vs.ElementColour(static_cast<int>(wParam)).value_or(ColourAlpha()).OpaqueRGB();
+ return vs.ElementColour(static_cast<int>(wParam)).value_or(ColourAlpha()).AsInteger();
case SCI_RESETELEMENTCOLOUR:
vs.ResetElement(static_cast<int>(wParam));
diff --git a/src/Geometry.h b/src/Geometry.h
index e9cb5a6c8..01af92969 100644
--- a/src/Geometry.h
+++ b/src/Geometry.h
@@ -187,6 +187,10 @@ public:
return ColourAlpha(co | (0xffu << 24));
}
+ constexpr int AsInteger() const noexcept {
+ return co;
+ }
+
constexpr int OpaqueRGB() const noexcept {
return co & 0xffffff;
}
diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx
index ed08ad6ce..4d555b1c2 100644
--- a/src/ViewStyle.cxx
+++ b/src/ViewStyle.cxx
@@ -206,6 +206,17 @@ void ViewStyle::Init(size_t stylesSize_) {
elementBaseColours[SC_ELEMENT_SELECTION_ADDITIONAL_BACK] = ColourAlpha(0xd7, 0xd7, 0xd7, 0xff);
elementBaseColours[SC_ELEMENT_SELECTION_SECONDARY_BACK] = ColourAlpha(0xb0, 0xb0, 0xb0, 0xff);
elementBaseColours[SC_ELEMENT_SELECTION_NO_FOCUS_BACK] = ColourAlpha(0x80, 0x80, 0x80, 0x3f);
+ elementAllowsTranslucent.insert({
+ SC_ELEMENT_SELECTION_TEXT,
+ SC_ELEMENT_SELECTION_BACK,
+ SC_ELEMENT_SELECTION_ADDITIONAL_TEXT,
+ SC_ELEMENT_SELECTION_ADDITIONAL_BACK,
+ SC_ELEMENT_SELECTION_SECONDARY_TEXT,
+ SC_ELEMENT_SELECTION_SECONDARY_BACK,
+ SC_ELEMENT_SELECTION_NO_FOCUS_TEXT,
+ SC_ELEMENT_SELECTION_BACK,
+ SC_ELEMENT_SELECTION_NO_FOCUS_BACK,
+ });
selection.layer = Layer::base;
selection.eolFilled = false;
@@ -224,6 +235,11 @@ void ViewStyle::Init(size_t stylesSize_) {
elementBaseColours[SC_ELEMENT_CARET] = ColourAlpha(0, 0, 0);
elementBaseColours[SC_ELEMENT_CARET_ADDITIONAL] = ColourAlpha(0x7f, 0x7f, 0x7f);
elementBaseColours[SC_ELEMENT_CARET_SECONDARY] = ColourAlpha(0, 0, 0, 0x40);
+ elementAllowsTranslucent.insert({
+ SC_ELEMENT_CARET,
+ SC_ELEMENT_CARET_ADDITIONAL,
+ SC_ELEMENT_CARET_SECONDARY,
+ });
caret.style = CARETSTYLE_LINE;
caret.width = 1;