get rid of warning style

This commit is contained in:
iLLiCiTiT 2021-04-29 19:31:57 +02:00
parent b1f3f8a01d
commit 64e08801e9
2 changed files with 4 additions and 14 deletions

View file

@ -177,9 +177,9 @@ class MongoUrlInput(QtWidgets.QLineEdit):
self.setProperty("state", "valid")
self.style().polish(self)
def set_warning(self):
def remove_state(self):
"""Set invalid state on mongo url input."""
self.setProperty("state", "warning")
self.setProperty("state", "")
self.style().polish(self)
def set_invalid(self):
@ -191,7 +191,7 @@ class MongoUrlInput(QtWidgets.QLineEdit):
class InstallDialog(QtWidgets.QDialog):
"""Main Igniter dialog window."""
mongo_url_regex = re.compile(r"(mongodb|mongodb\+srv)://.+")
mongo_url_regex = re.compile(r"^(mongodb|mongodb\+srv)://.*?")
_width = 500
_height = 200
@ -437,7 +437,7 @@ class InstallDialog(QtWidgets.QDialog):
msg = None
# Change style of input
if not new_value:
self._mongo_input.set_warning()
self._mongo_input.remove_state()
elif not self.mongo_url_regex.match(new_value):
self._mongo_input.set_invalid()
msg = (

View file

@ -43,12 +43,6 @@ QLineEdit[state="invalid"] {
border-color: rgb(64, 32, 32);
}
QLineEdit[state="warning"] {
background-color: rgb(32, 32, 19);
color: rgb(255, 190, 15);
border-color: rgb(64, 64, 32);
}
QLabel {
background: transparent;
color: #969b9e;
@ -284,7 +278,3 @@ QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
background-color: rgba(72, 200, 150, 31);
color: rgba(64, 64, 64, 63);
}
#Separator {
background-color: rgb(15, 15, 15);
}