@@ -5,7 +5,7 @@ use iced::widget::{column, container, row, Space};
55use iced:: { executor, Application , Command , Event , Length , Settings , Subscription } ;
66use iced_native:: window;
77
8- use cosmic_time:: { self , chain, keyframes, Duration , Instant , Speed , Timeline } ;
8+ use cosmic_time:: { self , anim , chain, keyframes, Duration , Instant , Speed , Timeline } ;
99
1010use once_cell:: sync:: Lazy ;
1111use rand:: prelude:: * ;
@@ -167,21 +167,15 @@ impl Application for Pong {
167167 let paddle_right = container ( Space :: new ( width, height) ) . style ( theme:: Container :: Paddle ) ;
168168
169169 let content = row ! [
170- column![
171- keyframes:: Space :: as_widget( PADDLE_LEFT . clone( ) , & self . timeline) ,
172- paddle_left
173- ] ,
170+ column![ anim!( PADDLE_LEFT , & self . timeline) , paddle_left] ,
174171 Space :: new( Length :: Fill , Length :: Fill ) ,
175- column![
176- keyframes:: Space :: as_widget( PADDLE_RIGHT . clone( ) , & self . timeline) ,
177- paddle_right
178- ] ,
172+ column![ anim!( PADDLE_RIGHT , & self . timeline) , paddle_right] ,
179173 ] ;
180174
181175 let ball = column ! [
182- keyframes :: Space :: as_widget ( BALL_Y . clone ( ) , & self . timeline) ,
176+ anim! ( BALL_Y , & self . timeline) ,
183177 row![
184- keyframes :: Space :: as_widget ( BALL_X . clone ( ) , & self . timeline) ,
178+ anim! ( BALL_X , & self . timeline) ,
185179 container( Space :: new( width, width) ) . style( theme:: Container :: Ball )
186180 ]
187181 ] ;
0 commit comments