mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 05:42:15 +01:00
use float numbers for animation
This commit is contained in:
parent
ab40ab6201
commit
2e9572aaeb
2 changed files with 7 additions and 6 deletions
|
|
@ -93,8 +93,8 @@ class OverviewWidget(QtWidgets.QFrame):
|
|||
main_layout.addWidget(subset_content_widget, 1)
|
||||
|
||||
change_anim = QtCore.QVariantAnimation()
|
||||
change_anim.setStartValue(0)
|
||||
change_anim.setEndValue(self.anim_end_value)
|
||||
change_anim.setStartValue(float(0))
|
||||
change_anim.setEndValue(float(self.anim_end_value))
|
||||
change_anim.setDuration(self.anim_duration)
|
||||
change_anim.setEasingCurve(QtCore.QEasingCurve.InOutQuad)
|
||||
|
||||
|
|
@ -264,9 +264,10 @@ class OverviewWidget(QtWidgets.QFrame):
|
|||
+ (self._subset_content_layout.spacing() * 2)
|
||||
)
|
||||
)
|
||||
subset_attrs_width = int(float(width) / self.anim_end_value) * value
|
||||
subset_attrs_width = int((float(width) / self.anim_end_value) * value)
|
||||
if subset_attrs_width > width:
|
||||
subset_attrs_width = width
|
||||
|
||||
create_width = width - subset_attrs_width
|
||||
|
||||
self._create_widget.setMinimumWidth(create_width)
|
||||
|
|
|
|||
|
|
@ -248,13 +248,13 @@ class PublishFrame(QtWidgets.QWidget):
|
|||
hint = self._top_content_widget.minimumSizeHint()
|
||||
end = hint.height()
|
||||
|
||||
self._shrunk_anim.setStartValue(start)
|
||||
self._shrunk_anim.setEndValue(end)
|
||||
self._shrunk_anim.setStartValue(float(start))
|
||||
self._shrunk_anim.setEndValue(float(end))
|
||||
if not anim_is_running:
|
||||
self._shrunk_anim.start()
|
||||
|
||||
def _on_shrunk_anim(self, value):
|
||||
diff = self._top_content_widget.height() - value
|
||||
diff = self._top_content_widget.height() - int(value)
|
||||
if not self._top_content_widget.isVisible():
|
||||
diff -= self._content_layout.spacing()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue