This post was flagged by the community and is temporarily hidden.
I found what I was looking for now I have to figure out how to
do this in iced.
The above example is using glutin and not iced
glutin
A low-level library for OpenGL context creation, written in pure Rust.
There is a window setting that is supposed to do this, but I haven’t been able to get it working. Here it is in the docs: iced::window::Settings
Here is how to change it from false
to true
:
use iced::window;
use iced::window::{Level, Position};
use iced::{Element, Sandbox, Settings};
struct Hello;
impl Sandbox for Hello {
type Message = ();
fn new() -> Hello {
Hello
}
fn title(&self) -> String {
String::from("A cool application")
}
fn update(&mut self, _message: Self::Message) {
// This application has no interactions
}
fn view(&self) -> Element<Self::Message> {
"Hello, world!".into()
}
}
pub fn main() -> iced::Result {
Hello::run(Settings {
window: window::Settings {
transparent: true, // I didn't see any difference.
..window::Settings::default() // Window specific settings.
},
..Settings::default() // This deals with the global settings.
})
}
The snippet you want is in main()
and the call to run()
.
Yes, this exact example that got me boxed into a corner with re-implementing the Sandbox and Application Traits to use the the glutin, wgpu, and iced-winit’s “WindowBuilder,” I also went down the trail of banging my head on Theme’s and Style’s in this process.
If I just used iced-winit I would be good but then I’m no longer really using Iced (and all of it’s features). iced-winit, does support the transparency feature but, I have to manage the state in the eventloop manually…
transparent: true
Right now I see the transparency feature is having problems everywhere not just in Iced. This is more of a one-off feature in Iced rather like the tree in the forest type problem I’m experiencing, obviously.
I’m also dabbling in micro-controllers and their are custom solutions to get something working “now.” But, the more you chase those “now” features, like I am, the more you leave the ecosystem of the project.
It is really just amazing how advanced Rust has got in such a short span!
I’m fine with waiting a year or so while these giants make mountains.