mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-01 20:31:27 +00:00
Janitor: Update issue1327_inlined_state_property.slint to new syntax
Ran the slint-updater over it. The formatting of legacy transition is not implemented and it is not idempotent. Since the legacy syntax is irrelevant for the test, just move to the new syntax. So that we can test idempotence of the formatter over all our tests
This commit is contained in:
parent
7ec5f783f5
commit
b6b034b0c1
1 changed files with 19 additions and 22 deletions
|
|
@ -4,40 +4,37 @@
|
|||
|
||||
// based on https://github.com/slint-ui/slint/issues/1327#issuecomment-1151244049
|
||||
|
||||
export RipplCircle := Rectangle {
|
||||
property <length> radius: 0;
|
||||
property <length> mx: 0;
|
||||
property <length> my: 0;
|
||||
property <float> fwidth: 0;
|
||||
property <float> fheight: 0;
|
||||
property <bool> running: false;
|
||||
width: radius * 2;
|
||||
height: radius * 2;
|
||||
x: mx - width / 2;
|
||||
y: my - height / 2;
|
||||
export component RipplCircle inherits Rectangle {
|
||||
in-out property <length> radius: 0;
|
||||
in-out property <length> mx: 0;
|
||||
in-out property <length> my: 0;
|
||||
in-out property <float> fwidth: 0;
|
||||
in-out property <float> fheight: 0;
|
||||
in-out property <bool> running: false;
|
||||
width: root.radius * 2;
|
||||
height: root.radius * 2;
|
||||
x: root.mx - root.width / 2;
|
||||
y: root.my - root.height / 2;
|
||||
background: rgba(0,0,0, 0.5);
|
||||
border-radius: width / 2;
|
||||
border-radius: root.width / 2;
|
||||
|
||||
property <float> counter: 0;
|
||||
in-out property <float> counter: 0;
|
||||
animate counter { duration: 800ms; }
|
||||
|
||||
states [
|
||||
ripple when counter > 0 && counter < 0.1 : {
|
||||
ripple when root.counter > 0 && root.counter < 0.1 : {
|
||||
radius: 100px;
|
||||
opacity: 0.;
|
||||
running: true;
|
||||
}
|
||||
]
|
||||
|
||||
transitions [
|
||||
in ripple: {
|
||||
in {
|
||||
animate radius { duration: 800ms; }
|
||||
animate opacity { duration: 800ms; }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
export InkEffect := Rectangle {
|
||||
export component InkEffect inherits Rectangle {
|
||||
|
||||
preferred-width: 200px;
|
||||
preferred-height: 200px;
|
||||
|
|
@ -55,8 +52,8 @@ export InkEffect := Rectangle {
|
|||
pointer-event(ev) => {
|
||||
if (ev.kind == PointerEventKind.down && ev.button == PointerEventButton.left) {
|
||||
if (!circle1.running) {
|
||||
circle1.mx = mouse-x;
|
||||
circle1.my = mouse-y;
|
||||
circle1.mx = self.mouse-x;
|
||||
circle1.my = self.mouse-y;
|
||||
circle1.fwidth = parent.width / 1px;
|
||||
circle1.fheight = parent.height / 1px;
|
||||
circle1.counter = circle1.counter == 0 ? 0.1 : 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue