Closed newtome8888 closed 10 months ago
This will probably point you in the right direction: https://github.com/slint-ui/slint/discussions/3859
Thanks for filling an issue, and thanks @Vadoola for answering it. Closing since this is duplicated with the discussion #3859
(Note: for such question, please use the GitHub discussion instead of issues which we use for bug report and feature request rather than questions)
I am using slint in Rust, I have a very simple question: How to put my component in the center of screen? Usually, in other libraries such as SDL, I can implement it with the formula:
x:screen_width/2-self.width/2
,y:screen_height/2-self.height/2
. But there is no way to get the screen width and screen height in slint. What should I do?