Skip to content

Conversation

task-jp
Copy link
Contributor

@task-jp task-jp commented Oct 3, 2025

This adds an enabled boolean property to the animate block, which defaults to true. When set to false, property changes apply immediately without animation, bypassing duration, easing, and iterations.

  • Added enabled field to PropertyAnimation struct
  • Updated compiler to handle enabled property with proper defaults
  • Added runtime check to skip animation when disabled
  • Included comprehensive tests for static and dynamic enabled values
  • Updated documentation and CHANGELOG

This adds an `enabled` boolean property to the `animate` block, which
defaults to `true`. When set to `false`, property changes apply
immediately without animation, bypassing duration, easing, and iterations.

- Added `enabled` field to PropertyAnimation struct
- Updated compiler to handle enabled property with proper defaults
- Added runtime check to skip animation when disabled
- Included comprehensive tests for static and dynamic enabled values
- Updated documentation and CHANGELOG
Copy link
Member

@ogoffart ogoffart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.

From an implementation point of view, i don't think this will work as expected.
The test only test what happens when the property value is set with a value.
However i don't think this will work in the following case:

  • The animated property is a binding whose value is being changed because of another property
  • The enabled property is being changed after the animation is started.

One problem being that animation property are not reactive and this really limit the usefulness of this property. (see #348 )

So I think you will need more test involving bindings and disabling animation in-flight. (and probably fixing #348 might be a prerequisite)

// Copyright © SixtyFPS GmbH <[email protected]>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0

TestCase := Rectangle {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for new test, please use the new syntax with component TestCase {

@tasuku-suzuki-signalslot
Copy link
Contributor

Thank you for your review. I understood that this won't be useful until #348 is done. I'll try to fix #348 first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants