Use Size in both Resize and FetchSize window actions

This commit is contained in:
Héctor Ramón Jiménez 2023-07-06 06:41:28 +02:00
parent b394c84b37
commit cc32bd4de0
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
3 changed files with 15 additions and 18 deletions

View file

@ -6,6 +6,7 @@ pub use action::Action;
use crate::command::{self, Command};
use crate::core::time::Instant;
use crate::core::window::{Event, Icon, Level, Mode, UserAttention};
use crate::core::Size;
use crate::futures::subscription::{self, Subscription};
/// Subscribes to the frames of the window of the running application.
@ -34,8 +35,8 @@ pub fn drag<Message>() -> Command<Message> {
}
/// Resizes the window to the given logical dimensions.
pub fn resize<Message>(width: u32, height: u32) -> Command<Message> {
Command::single(command::Action::Window(Action::Resize { width, height }))
pub fn resize<Message>(new_size: Size<u32>) -> Command<Message> {
Command::single(command::Action::Window(Action::Resize(new_size)))
}
/// Maximizes the window.