aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/EditView.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/EditView.cxx')
-rw-r--r--src/EditView.cxx22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx
index 5c88080a1..7070bc60f 100644
--- a/src/EditView.cxx
+++ b/src/EditView.cxx
@@ -845,10 +845,13 @@ ColourRGBA SelectionBackground(const EditModel &model, const ViewStyle &vsDraw,
if (!model.primarySelection)
element = Element::SelectionSecondaryBack;
if (!model.hasFocus) {
- if ((inSelection == InSelection::inAdditional) && vsDraw.ElementColour(Element::SelectionInactiveAdditionalBack)) {
- element = Element::SelectionInactiveAdditionalBack;
- } else if (vsDraw.ElementColour(Element::SelectionInactiveBack)) {
- element = Element::SelectionInactiveBack;
+ if (inSelection == InSelection::inAdditional) {
+ if (ColourOptional colour = vsDraw.ElementColour(Element::SelectionInactiveAdditionalBack)) {
+ return *colour;
+ }
+ }
+ if (ColourOptional colour = vsDraw.ElementColour(Element::SelectionInactiveBack)) {
+ return *colour;
}
}
return vsDraw.ElementColour(element).value_or(colourBug);
@@ -863,13 +866,12 @@ ColourOptional SelectionForeground(const EditModel &model, const ViewStyle &vsDr
if (!model.primarySelection) // Secondary selection
element = Element::SelectionSecondaryText;
if (!model.hasFocus) {
- if ((inSelection == InSelection::inAdditional) && vsDraw.ElementColour(Element::SelectionInactiveAdditionalText)) {
- element = Element::SelectionInactiveAdditionalText;
- } else if (vsDraw.ElementColour(Element::SelectionInactiveText)) {
- element = Element::SelectionInactiveText;
- } else {
- return {};
+ if (inSelection == InSelection::inAdditional) {
+ if (ColourOptional colour = vsDraw.ElementColour(Element::SelectionInactiveAdditionalText)) {
+ return colour;
+ }
}
+ element = Element::SelectionInactiveText;
}
return vsDraw.ElementColour(element);
}