Open new windows with a default size and position (#9204)
This PR changes GPUI to open windows with a default size and location, and to otherwise inherit from their spawning window. Note: The linux build now crashes on startup. Release Notes: - N/A --------- Co-authored-by: Nathan <nathan@zed.dev> Co-authored-by: Ezekiel Warren <zaucy@users.noreply.github.com>
This commit is contained in:
parent
9a2dceeea1
commit
e792c1a5c5
30 changed files with 443 additions and 347 deletions
|
@ -3,7 +3,7 @@ use crate::{
|
|||
Action, AnyWindowHandle, BackgroundExecutor, ClipboardItem, CursorStyle, DisplayId,
|
||||
ForegroundExecutor, Keymap, MacDispatcher, MacDisplay, MacTextSystem, MacWindow, Menu,
|
||||
MenuItem, PathPromptOptions, Platform, PlatformDisplay, PlatformInput, PlatformTextSystem,
|
||||
PlatformWindow, Result, SemanticVersion, Task, WindowAppearance, WindowOptions,
|
||||
PlatformWindow, Result, SemanticVersion, Task, WindowAppearance, WindowParams,
|
||||
};
|
||||
use anyhow::{anyhow, bail};
|
||||
use block::ConcreteBlock;
|
||||
|
@ -477,6 +477,10 @@ impl Platform for MacPlatform {
|
|||
}
|
||||
}
|
||||
|
||||
fn primary_display(&self) -> Option<Rc<dyn PlatformDisplay>> {
|
||||
Some(Rc::new(MacDisplay::primary()))
|
||||
}
|
||||
|
||||
fn displays(&self) -> Vec<Rc<dyn PlatformDisplay>> {
|
||||
MacDisplay::all()
|
||||
.map(|screen| Rc::new(screen) as Rc<_>)
|
||||
|
@ -494,7 +498,7 @@ impl Platform for MacPlatform {
|
|||
fn open_window(
|
||||
&self,
|
||||
handle: AnyWindowHandle,
|
||||
options: WindowOptions,
|
||||
options: WindowParams,
|
||||
) -> Box<dyn PlatformWindow> {
|
||||
// Clippy thinks that this evaluates to `()`, for some reason.
|
||||
#[allow(clippy::unit_arg, clippy::clone_on_copy)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue