You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using slint hope to develop a video player , I need change the window to fit video size when I load the video file . Is there having something like life cycle that can change the window size on first ? or according to my function have else comment ?
I know we can use the winit API to set window size ,but it will lose slint animate (width ,height) .
exportcomponentReelRosUIinheritsWindow {
in-outproperty <Page> page: Welcome;
in-outproperty <string> bag-path;
callbackopen-file();
background: page == Page.Welcome ? transparent : #000000;
preferred-width: 640px;
preferred-height: 360px;
animate height, width { duration: 1s; }
if page == Page.Welcome: welcome-view := WelcomeView {
width: root.width;
height: root.height;
open-file => {
root.open-file();
// if I change window size here , the WelcomeView will change size to 1920x1080 . Because the open-file is async ?// root.height = 1080px;// root.width = 1920px;
}
}
if page == Page.Player: player-view := PlayerView {
width: root.width;
height: root.height;
bag-path: root.bag-path;
}
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello , everyone .
I am using slint hope to develop a video player , I need change the window to fit video size when I load the video file . Is there having something like life cycle that can change the window size on first ? or according to my function have else comment ?
I know we can use the winit API to set window size ,but it will lose slint animate (width ,height) .
2025-07-31.21.06.44.mov
Beta Was this translation helpful? Give feedback.
All reactions