-
Notifications
You must be signed in to change notification settings - Fork 2
splash: update artwork, tweak timeout and positioning logic [CPP-744] [CPP-752] #557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I believe all you will need to change now is this line to something like swift-toolbox/entrypoint/src/splash.rs Line 27 in df811eb
Might have been nicer for me to make it a constant 😬 |
…lbox into silverjam/update-art
entrypoint/src/splash.rs
Outdated
let size = current_monitor.size(); | ||
let pos_x = ((size.width as f64 - image.width() as f64) / 2.0) as isize; | ||
let pos_y = ((size.height as f64 - image.height() as f64) / 2.0) as isize; | ||
let scale_factor = fetch_scale_factor(¤t_monitor); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have been having success using the to_logical function, I believe it should just be dividing the scale factor though.
let size = current_monitor.size();
let (width, height) = if cfg!(target_os = "macos") {
let size = size.to_logical::<f64>(current_monitor.scale_factor());
(size.width, size.height)
} else {
(size.width as f64, size.height as f64)
};
let pos_x = ((width - image.width() as f64) / 2.0) as isize;
let pos_y = ((height - image.height() as f64) / 2.0) as isize;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll paste this in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this code in, can't test it currently though.
FWIW if we wanted to implement support for Wayland with the splash screen we would probably need to use a different package to display the splash image, such as just using winit directly: rust-windowing/winit#1240 -- there's a package that implements showing images with winit: https://github.com/robohouse-delft/show-image-rs -- it says it's a "debugging tool for writing image manipulation software" but probably sufficient for implementing a splash screen. |
Update splash screen and icon png (updated to be much largest so it isn't pixelated when blown up).