mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 08:54:53 +01:00
simplified set active
This commit is contained in:
parent
5d0836de08
commit
f73beb50ae
1 changed files with 5 additions and 4 deletions
|
|
@ -793,13 +793,14 @@ class InstanceCardWidget(QtWidgets.QWidget):
|
|||
def set_active(self, new_value):
|
||||
checkbox_value = self.active_checkbox.isChecked()
|
||||
instance_value = self.instance.data["active"]
|
||||
if instance_value == checkbox_value == new_value:
|
||||
return
|
||||
|
||||
# First change instance value and them change checkbox
|
||||
# - prevent to trigger `active_changed` signal
|
||||
self.instance.data["active"] = new_value
|
||||
self.active_checkbox.setChecked(new_value)
|
||||
if instance_value != new_value:
|
||||
self.instance.data["active"] = new_value
|
||||
|
||||
if checkbox_value != new_value:
|
||||
self.active_checkbox.setChecked(new_value)
|
||||
|
||||
def update_instance(self, instance):
|
||||
self.instance = instance
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue