diff --git a/openpype/style/style.css b/openpype/style/style.css index c57b9a8da6..da7335d5c4 100644 --- a/openpype/style/style.css +++ b/openpype/style/style.css @@ -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; +} diff --git a/openpype/tools/new_publisher/widgets.py b/openpype/tools/new_publisher/widgets.py index d4872d02b9..ce33cfbb13 100644 --- a/openpype/tools/new_publisher/widgets.py +++ b/openpype/tools/new_publisher/widgets.py @@ -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)