Rename mac platform Window to MacWindow for clarity

This commit is contained in:
Nathan Sobo 2023-08-08 17:21:06 -06:00
parent fc96676662
commit 0dc70e6cbf
3 changed files with 8 additions and 8 deletions

View file

@ -21,7 +21,7 @@ pub use fonts::FontSystem;
use platform::{MacForegroundPlatform, MacPlatform}; use platform::{MacForegroundPlatform, MacPlatform};
pub use renderer::Surface; pub use renderer::Surface;
use std::{ops::Range, rc::Rc, sync::Arc}; use std::{ops::Range, rc::Rc, sync::Arc};
use window::Window; use window::MacWindow;
use crate::executor; use crate::executor;

View file

@ -1,6 +1,6 @@
use super::{ use super::{
event::key_to_native, screen::Screen, status_item::StatusItem, BoolExt as _, Dispatcher, event::key_to_native, screen::Screen, status_item::StatusItem, BoolExt as _, Dispatcher,
FontSystem, Window, FontSystem, MacWindow,
}; };
use crate::{ use crate::{
executor, executor,
@ -594,11 +594,11 @@ impl platform::Platform for MacPlatform {
options: platform::WindowOptions, options: platform::WindowOptions,
executor: Rc<executor::Foreground>, executor: Rc<executor::Foreground>,
) -> Box<dyn platform::Window> { ) -> Box<dyn platform::Window> {
Box::new(Window::open(handle, options, executor, self.fonts())) Box::new(MacWindow::open(handle, options, executor, self.fonts()))
} }
fn main_window(&self) -> Option<AnyWindowHandle> { fn main_window(&self) -> Option<AnyWindowHandle> {
Window::main_window() MacWindow::main_window()
} }
fn add_status_item(&self, _handle: AnyWindowHandle) -> Box<dyn platform::Window> { fn add_status_item(&self, _handle: AnyWindowHandle) -> Box<dyn platform::Window> {

View file

@ -423,9 +423,9 @@ impl WindowState {
} }
} }
pub struct Window(Rc<RefCell<WindowState>>); pub struct MacWindow(Rc<RefCell<WindowState>>);
impl Window { impl MacWindow {
pub fn open( pub fn open(
handle: AnyWindowHandle, handle: AnyWindowHandle,
options: platform::WindowOptions, options: platform::WindowOptions,
@ -636,7 +636,7 @@ impl Window {
} }
} }
impl Drop for Window { impl Drop for MacWindow {
fn drop(&mut self) { fn drop(&mut self) {
let this = self.0.borrow(); let this = self.0.borrow();
let window = this.native_window; let window = this.native_window;
@ -650,7 +650,7 @@ impl Drop for Window {
} }
} }
impl platform::Window for Window { impl platform::Window for MacWindow {
fn bounds(&self) -> WindowBounds { fn bounds(&self) -> WindowBounds {
self.0.as_ref().borrow().bounds() self.0.as_ref().borrow().bounds()
} }