-
My App needs to create a window on the Mac that requires the window to not take away the user's focus from the previous application due to a user's click, similar to the Emoji App on the Mac! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
Currently I'm using a more cumbersome way to accomplish my needs, but the user experience is not very good |
Beta Was this translation helpful? Give feedback.
-
It's unlikely for Slint to offer a generic API for this, but fortunately you can interact with the backend directly. For example if you're using winit, then see the following issue for a discussion about achieving this: rust-windowing/winit#3072. Also see #4284 (reply in thread) for a winit and macOS-specific customization example. |
Beta Was this translation helpful? Give feedback.
-
I apologize for my lack of programming skills. use i_slint_backend_winit::winit::event_loop::EventLoopBuilder;
use i_slint_backend_winit::winit::platform::macos::WindowBuilderExtMacOS;
use i_slint_backend_winit::winit::platform::macos::EventLoopBuilderExtMacOS;
slint::include_modules!();
fn main() -> Result<(), slint::PlatformError> {
let mut backend = i_slint_backend_winit::Backend::new().unwrap();
let event_loop = EventLoopBuilder::new()
.with_activate_ignoring_other_apps(false)
.build();
backend.window_builder_hook = Some(Box::new(|builder| {
builder
.with_fullsize_content_view(true)
.with_title_hidden(true)
.with_titlebar_transparent(true)
}));
slint::platform::set_platform(Box::new(backend));
let ui = AppWindow::new()?;
let calc = ui.window();
ui.run()
} |
Beta Was this translation helpful? Give feedback.
-
If anyone finds that the software cannot be opened after being packaged into an .App just add
to info.plist |
Beta Was this translation helpful? Give feedback.
I'm currently accomplishing my needs by modifying the event_loop.rs source code directly, it would be great if I could add EventLoopBuilder!
event_loop.rs