slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.54k stars 600 forks source link

Add API to allow for the window to always stay on top #324

Closed tronical closed 1 year ago

tronical commented 3 years ago

Currently the public API in Rust/C++/JavaScript only allows showing or hiding the window. This issue tracks the availability of API to control whether the window on the screen is always on top or not.

Both Qt and winit have APIs for that.

ogoffart commented 3 years ago

I wonder if that shouldn't simply be a property on the Window .60 element. then the developer can choose to expose that to the native code

ogoffart commented 3 years ago

Also the question is weather the user really need that, or if they want more something to raise the window as we would need for https://github.com/sixtyfpsui/sixtyfps/issues/196

Another option would be to expose the Backend's window (eg, winit::Window or QWindow) uing a Box<dyn Any> or void* ptr. Btw, from the C++ API, it is already possible to access the QWidget if one is using the the Qt backend.

tronical commented 3 years ago

Also the question is weather the user really need that, or if they want more something to raise the window as we would need for #196

I think likely both. I mean, both are features the window manager offers, for different use-cases.

You're right, exposing the backend window helps at least with the Rust API.

ogoffart commented 1 year ago

https://github.com/slint-ui/slint/pull/2557