mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
added style changes of variant input border
This commit is contained in:
parent
6c67bf3381
commit
d0399e798f
2 changed files with 30 additions and 0 deletions
|
|
@ -614,3 +614,15 @@ QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
|
|||
border: 1px solid {color:border};
|
||||
border-radius: 0.1em;
|
||||
}
|
||||
|
||||
#VariantInput[state="new"], #VariantInput[state="new"]:focus, #VariantInput[state="new"]:hover {
|
||||
border-color: #7AAB8F;
|
||||
}
|
||||
|
||||
#VariantInput[state="empty"], #VariantInput[state="empty"]:focus, #VariantInput[state="empty"]:hover {
|
||||
border-color: {color:bg-inputs};
|
||||
}
|
||||
|
||||
#VariantInput[state="exists"], #VariantInput[state="exists"]:focus, #VariantInput[state="exists"]:hover {
|
||||
border-color: #4E76BB;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,6 +118,7 @@ class CreateDialog(QtWidgets.QDialog):
|
|||
family_view.setModel(family_model)
|
||||
|
||||
variant_input = QtWidgets.QLineEdit(self)
|
||||
variant_input.setObjectName("VariantInput")
|
||||
|
||||
variant_hints_btn = QtWidgets.QPushButton(self)
|
||||
variant_hints_btn.setFixedWidth(18)
|
||||
|
|
@ -370,6 +371,23 @@ class CreateDialog(QtWidgets.QDialog):
|
|||
action = self.variant_hints_menu.addAction(variant_hint)
|
||||
self.variant_hints_group.addAction(action)
|
||||
|
||||
# Indicate subset existence
|
||||
if not variant_value:
|
||||
property_value = "empty"
|
||||
|
||||
elif subset_name.lower() in existing_subset_names_low:
|
||||
# validate existence of subset name with lowered text
|
||||
# - "renderMain" vs. "rendermain" mean same path item for
|
||||
# windows
|
||||
property_value = "exists"
|
||||
else:
|
||||
property_value = "new"
|
||||
|
||||
current_value = self.variant_input.property("state")
|
||||
if current_value != property_value:
|
||||
self.variant_input.setProperty("state", property_value)
|
||||
self.variant_input.style().polish(self.variant_input)
|
||||
|
||||
variant_is_valid = variant_value.strip() != ""
|
||||
if variant_is_valid != self.create_btn.isEnabled():
|
||||
self.create_btn.setEnabled(variant_is_valid)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue