aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorNeil Hodgson <nyamatongwe@gmail.com>2024-03-15 17:54:07 +1100
committerNeil Hodgson <nyamatongwe@gmail.com>2024-03-15 17:54:07 +1100
commitbb387ecf5a9a81723637a153896e4ee0eb16bbc8 (patch)
tree7de0a961b8571033c1c4a3ea10ac4b54f2a8fc5b /src
parent16f53f7b3f2f16f5caf62ae01d3e892d70f7d9ca (diff)
downloadscintilla-mirror-bb387ecf5a9a81723637a153896e4ee0eb16bbc8.tar.gz
Bug [#2417]. Add elements for inactive additional selections
SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_TEXT and SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_BACK.
Diffstat (limited to 'src')
-rw-r--r--src/EditView.cxx13
-rw-r--r--src/ViewStyle.cxx6
2 files changed, 15 insertions, 4 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx
index b3e024fe1..5c88080a1 100644
--- a/src/EditView.cxx
+++ b/src/EditView.cxx
@@ -844,8 +844,13 @@ ColourRGBA SelectionBackground(const EditModel &model, const ViewStyle &vsDraw,
element = Element::SelectionAdditionalBack;
if (!model.primarySelection)
element = Element::SelectionSecondaryBack;
- if (!model.hasFocus && vsDraw.ElementColour(Element::SelectionInactiveBack))
- element = Element::SelectionInactiveBack;
+ if (!model.hasFocus) {
+ if ((inSelection == InSelection::inAdditional) && vsDraw.ElementColour(Element::SelectionInactiveAdditionalBack)) {
+ element = Element::SelectionInactiveAdditionalBack;
+ } else if (vsDraw.ElementColour(Element::SelectionInactiveBack)) {
+ element = Element::SelectionInactiveBack;
+ }
+ }
return vsDraw.ElementColour(element).value_or(colourBug);
}
@@ -858,7 +863,9 @@ ColourOptional SelectionForeground(const EditModel &model, const ViewStyle &vsDr
if (!model.primarySelection) // Secondary selection
element = Element::SelectionSecondaryText;
if (!model.hasFocus) {
- if (vsDraw.ElementColour(Element::SelectionInactiveText)) {
+ if ((inSelection == InSelection::inAdditional) && vsDraw.ElementColour(Element::SelectionInactiveAdditionalText)) {
+ element = Element::SelectionInactiveAdditionalText;
+ } else if (vsDraw.ElementColour(Element::SelectionInactiveText)) {
element = Element::SelectionInactiveText;
} else {
return {};
diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx
index afca0e0e7..a06882879 100644
--- a/src/ViewStyle.cxx
+++ b/src/ViewStyle.cxx
@@ -177,6 +177,7 @@ ViewStyle::ViewStyle(size_t stylesSize_) :
elementColours.erase(Element::SelectionAdditionalText);
elementColours.erase(Element::SelectionSecondaryText);
elementColours.erase(Element::SelectionInactiveText);
+ elementColours.erase(Element::SelectionInactiveAdditionalText);
// Shades of grey for selection backgrounds
elementBaseColours[Element::SelectionBack] = ColourRGBA::Grey(light);
constexpr unsigned int veryLight = 0xd7U;
@@ -193,6 +194,8 @@ ViewStyle::ViewStyle(size_t stylesSize_) :
Element::SelectionSecondaryBack,
Element::SelectionInactiveText,
Element::SelectionInactiveBack,
+ Element::SelectionInactiveAdditionalText,
+ Element::SelectionInactiveAdditionalBack,
});
foldmarginColour.reset();
@@ -590,7 +593,8 @@ bool ViewStyle::SelectionTextDrawn() const {
ElementIsSet(Element::SelectionText) ||
ElementIsSet(Element::SelectionAdditionalText) ||
ElementIsSet(Element::SelectionSecondaryText) ||
- ElementIsSet(Element::SelectionInactiveText);
+ ElementIsSet(Element::SelectionInactiveText) ||
+ ElementIsSet(Element::SelectionInactiveAdditionalText);
}
bool ViewStyle::WhitespaceBackgroundDrawn() const {