From b1c01ef45c739b860088fd327374bfb6b256500a Mon Sep 17 00:00:00 2001 From: Junkui Zhang <364772080@qq.com> Date: Mon, 8 Apr 2024 23:38:09 +0800 Subject: [PATCH] add restore size --- crates/gpui/src/platform.rs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/crates/gpui/src/platform.rs b/crates/gpui/src/platform.rs index 03027299b1..04f7d52cba 100644 --- a/crates/gpui/src/platform.rs +++ b/crates/gpui/src/platform.rs @@ -567,16 +567,25 @@ pub(crate) struct WindowParams { pub window_background: WindowBackgroundAppearance, } -/// TODO: +/// Represents the status of how a window should be opened. #[derive(Debug, Copy, Clone, PartialEq)] pub enum WindowOpenStatus { - /// The bounds of the window in screen coordinates. - /// None -> inherit, Some(bounds) -> set bounds + /// Specifies the bounds of the window in screen coordinates. + /// - `None`: Inherit the bounds. + /// - `Some(bounds)`: Set the bounds to the specified value. Windowed(Option>), - /// maximized - Maximized, - /// fullscreen - FullScreen, + /// Indicates that the window should open in a maximized state. + /// The bounds provided here represent the restore size of the window. + Maximized(Bounds), + /// Indicates that the window should open in fullscreen mode. + /// The bounds provided here represent the restore size of the window. + FullScreen(Bounds), +} + +impl Default for WindowOpenStatus { + fn default() -> Self { + WindowOpenStatus::Windowed(None) + } } impl Default for WindowOptions {