Use error text colour instead for editor search box

This commit is contained in:
Veronica Berglyd Olsen
2025-01-22 22:43:38 +01:00
parent 7c3eb16800
commit 47ffc83c73
+6 -9
View File
@@ -2685,12 +2685,6 @@ class GuiDocEditSearch(QFrame):
self.searchOpt.setStyleSheet("QToolBar {padding: 0;}") self.searchOpt.setStyleSheet("QToolBar {padding: 0;}")
self.showReplace.setStyleSheet("QToolButton {border: none; background: transparent;}") self.showReplace.setStyleSheet("QToolButton {border: none; background: transparent;}")
# Construct Box Colours
self.rxCol = {
True: palette.base().color(),
False: SHARED.theme.errorText.darker(200),
}
return return
def cycleFocus(self) -> bool: def cycleFocus(self) -> bool:
@@ -2791,9 +2785,12 @@ class GuiDocEditSearch(QFrame):
"""Highlight the search box to indicate the search string is or """Highlight the search box to indicate the search string is or
isn't valid. Take the colour from the replace box. isn't valid. Take the colour from the replace box.
""" """
qPalette = self.replaceBox.palette() palette = self.replaceBox.palette()
qPalette.setColor(QPalette.ColorRole.Base, self.rxCol[isValid]) palette.setColor(
self.searchBox.setPalette(qPalette) QPalette.ColorRole.Text,
palette.text().color() if isValid else SHARED.theme.errorText
)
self.searchBox.setPalette(palette)
return return