aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--doc/ScintillaDoc.html25
-rw-r--r--doc/ScintillaHistory.html14
-rw-r--r--include/Scintilla.h2
-rw-r--r--include/Scintilla.iface2
-rw-r--r--include/ScintillaTypes.h2
-rw-r--r--src/EditView.cxx13
-rw-r--r--src/ViewStyle.cxx6
7 files changed, 59 insertions, 5 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index 9f8f6d937..b5ad08649 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -3804,6 +3804,22 @@ struct Sci_TextToFindFull {
<td>Cocoa</td>
<td>Background colour of selections when another window has focus</td>
</tr>
+ <tr>
+ <th align="left"><code>SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_TEXT</code></th>
+ <td>18</td>
+ <td>Translucent</td>
+ <td>All</td>
+ <td></td>
+ <td>Text colour of additional selections when another window has focus</td>
+ </tr>
+ <tr>
+ <th align="left"><code>SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_BACK</code></th>
+ <td>19</td>
+ <td>Translucent</td>
+ <td>All</td>
+ <td></td>
+ <td>Background colour of additional selections when another window has focus</td>
+ </tr>
<tr class="section">
<th align="left"><code>SC_ELEMENT_CARET</code></th>
<td>40</td>
@@ -3911,6 +3927,8 @@ struct Sci_TextToFindFull {
<br />
<a class="element" href="#SC_ELEMENT_SELECTION_INACTIVE_TEXT">SC_ELEMENT_SELECTION_INACTIVE_TEXT : colouralpha</a><br />
<a class="element" href="#SC_ELEMENT_SELECTION_INACTIVE_BACK">SC_ELEMENT_SELECTION_INACTIVE_BACK : colouralpha</a><br />
+ <a class="element" href="#SC_ELEMENT_SELECTION_INACTIVE_TEXT">SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_TEXT : colouralpha</a><br />
+ <a class="element" href="#SC_ELEMENT_SELECTION_INACTIVE_BACK">SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_BACK : colouralpha</a><br />
<br />
<a class="element" href="#SC_ELEMENT_CARET_LINE_BACK">SC_ELEMENT_CARET_LINE_BACK : colouralpha</a><br />
<a class="message" href="#SCI_SETCARETLINELAYER">SCI_SETCARETLINELAYER(int layer)</a><br />
@@ -4035,8 +4053,13 @@ struct Sci_TextToFindFull {
<p>
<b id="SC_ELEMENT_SELECTION_INACTIVE_TEXT">SC_ELEMENT_SELECTION_INACTIVE_TEXT : colouralpha</b><br />
<b id="SC_ELEMENT_SELECTION_INACTIVE_BACK">SC_ELEMENT_SELECTION_INACTIVE_BACK : colouralpha</b><br />
+ <b id="SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_TEXT">SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_TEXT : colouralpha</b><br />
+ <b id="SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_BACK">SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_BACK : colouralpha</b><br />
When a window no longer has the keyboard focus, it is customary to make its selection less noticeable by colouring it grey.
- These elements define the colours to be used for selections without focus.
+ These elements define the colours to be used for selections without focus. When the <code>ADDITIONAL</code> elements are not set then
+ the standard values are used:
+ <code>SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_TEXT</code>&rarr;<code>SC_ELEMENT_SELECTION_INACTIVE_TEXT</code> and
+ <code>SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_BACK</code>&rarr;<code>SC_ELEMENT_SELECTION_INACTIVE_BACK</code>.
</p>
<p>
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index be468929d..9ec26d44c 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -584,6 +584,20 @@
</table>
<h2>Releases</h2>
<h3>
+ <a href="https://www.scintilla.org/scintilla544.zip">Release 5.4.4</a>
+ </h3>
+ <ul>
+ <li>
+ Released 9 March 2024.
+ </li>
+ <li>
+ Add elements for inactive additional selections SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_TEXT
+ and SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_BACK.
+ When not set these default to SC_ELEMENT_SELECTION_INACTIVE_TEXT and SC_ELEMENT_SELECTION_INACTIVE_BACK.
+ <a href="https://sourceforge.net/p/scintilla/bugs/2417/">Bug #2417</a>.
+ </li>
+ </ul>
+ <h3>
<a href="https://www.scintilla.org/scintilla543.zip">Release 5.4.3</a>
</h3>
<ul>
diff --git a/include/Scintilla.h b/include/Scintilla.h
index 9b53ae174..75583a824 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -295,6 +295,8 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP
#define SC_ELEMENT_SELECTION_SECONDARY_BACK 15
#define SC_ELEMENT_SELECTION_INACTIVE_TEXT 16
#define SC_ELEMENT_SELECTION_INACTIVE_BACK 17
+#define SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_TEXT 18
+#define SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_BACK 19
#define SC_ELEMENT_CARET 40
#define SC_ELEMENT_CARET_ADDITIONAL 41
#define SC_ELEMENT_CARET_LINE_BACK 50
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index 3f88653ce..72d2a7d41 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -717,6 +717,8 @@ val SC_ELEMENT_SELECTION_SECONDARY_TEXT=14
val SC_ELEMENT_SELECTION_SECONDARY_BACK=15
val SC_ELEMENT_SELECTION_INACTIVE_TEXT=16
val SC_ELEMENT_SELECTION_INACTIVE_BACK=17
+val SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_TEXT=18
+val SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_BACK=19
val SC_ELEMENT_CARET=40
val SC_ELEMENT_CARET_ADDITIONAL=41
val SC_ELEMENT_CARET_LINE_BACK=50
diff --git a/include/ScintillaTypes.h b/include/ScintillaTypes.h
index 128b73002..62d220b2a 100644
--- a/include/ScintillaTypes.h
+++ b/include/ScintillaTypes.h
@@ -178,6 +178,8 @@ enum class Element {
SelectionSecondaryBack = 15,
SelectionInactiveText = 16,
SelectionInactiveBack = 17,
+ SelectionInactiveAdditionalText = 18,
+ SelectionInactiveAdditionalBack = 19,
Caret = 40,
CaretAdditional = 41,
CaretLineBack = 50,
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 {