mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
give a separate style to SubsetManagerDetailsText
This commit is contained in:
parent
e73ac627e3
commit
5d527e1d27
2 changed files with 18 additions and 5 deletions
|
|
@ -765,6 +765,11 @@ QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
|
|||
border: 1px solid {color:border};
|
||||
border-radius: 0.1em;
|
||||
}
|
||||
/* Subset Manager */
|
||||
#SubsetManagerDetailsText {}
|
||||
#SubsetManagerDetailsText[state="invalid"] {
|
||||
border: 1px solid #ff0000;
|
||||
}
|
||||
|
||||
/* Python console interpreter */
|
||||
#PythonInterpreterOutput, #PythonCodeEditor {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ class InstanceDetail(QtWidgets.QWidget):
|
|||
super(InstanceDetail, self).__init__(parent)
|
||||
|
||||
details_widget = QtWidgets.QPlainTextEdit(self)
|
||||
details_widget.setObjectName("SubsetManagerDetailsText")
|
||||
|
||||
save_btn = QtWidgets.QPushButton("Save", self)
|
||||
|
||||
self._block_changes = False
|
||||
|
|
@ -46,12 +48,18 @@ class InstanceDetail(QtWidgets.QWidget):
|
|||
if valid is None:
|
||||
valid = self.is_valid()
|
||||
|
||||
style_sheet = ""
|
||||
if not valid:
|
||||
style_sheet = "border-color: #ff0000;"
|
||||
self._save_btn.setEnabled(valid)
|
||||
self._set_invalid_detail(valid)
|
||||
|
||||
self.save_btn.setEnabled(valid)
|
||||
self._details_widget.setStyleSheet(style_sheet)
|
||||
def _set_invalid_detail(self, valid):
|
||||
state = ""
|
||||
if not valid:
|
||||
state = "invalid"
|
||||
|
||||
current_state = self._details_widget.property("state")
|
||||
if current_state != state:
|
||||
self._details_widget.setProperty("state", state)
|
||||
self._details_widget.style().polish(self._details_widget)
|
||||
|
||||
def set_details(self, container, item_id):
|
||||
self._item_id = item_id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue