aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gui.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/gui.py b/gui.py
index c4bb8c7..5828d0d 100644
--- a/gui.py
+++ b/gui.py
@@ -382,16 +382,21 @@ class MuddleWindow(QMainWindow):
@pyqtSlot(str)
def onSearchBarTextChanged(self, text):
moodleTreeView = self.findChild(QTreeView, "moodleTree")
+ searchBar = self.findChild(QLineEdit, "searchBar")
+
if not text:
self.filterModel.setFilterRegularExpression(".*")
moodleTreeView.collapseAll()
+ searchBar.setStyleSheet("")
else:
regexp = QRegularExpression(text)
if regexp.isValid():
self.filterModel.setFilterRegularExpression(regexp)
moodleTreeView.expandAll()
+ searchBar.setStyleSheet("")
else:
log.debug("invalid search regular expression, not searching")
+ searchBar.setStyleSheet("QLineEdit { color: red; }")
@pyqtSlot(str)
def onNewLogMessage(self, msg):