slint icon indicating copy to clipboard operation
slint copied to clipboard

Transition syntax `animate *` not work

Open cEvolve05 opened this issue 1 year ago • 1 comments

C++ & Slint 1.7.0

In document, it says that syntax animate * { ... } used to animate all properties, but it actually not works.

With below code, it is expected to animate background change, but actually no animation.

export component Example inherits Window {
    width: 100px;
    height: 100px;
    background: white;

    area := TouchArea{}

    states [
        test when area.has-hover : {
            background: black;
            in {
                animate * { duration: 1s; }
            }
            out {
                animate * { duration: 1s; }
            }
        }
    ]
}

cEvolve05 avatar Jul 25 '24 04:07 cEvolve05

Thanks for the bug report. This was documented for a very long time as we intended for this to work, but it was never actually implemented it seems.

https://github.com/slint-ui/slint/blob/9c30cdaf3b2eff60e7cb6beeea1b734d835f3fc7/internal/compiler/object_tree.rs#L2365-L2366

This test is for the legacy (<1.0) transition syntax, and that check was not even implemented in the new transition syntax with in and out.

ogoffart avatar Jul 25 '24 09:07 ogoffart