pub struct WindowOptions {
pub title: String,
pub width: i16,
pub height: i16,
pub theme: Option<CoreTheme>,
pub locale: Option<Locale>,
pub dpi_scale: Option<usize>,
pub backend: Option<DesktopRenderBackend>,
pub scroll_list_id: Option<u32>,
}Expand description
桌面窗口创建配置项(参照 gpui-kit WindowOptions)。
Fields§
§title: String窗口标题。
width: i16初始逻辑宽度(像素,默认 960)。
height: i16初始逻辑高度(像素,默认 640)。
theme: Option<CoreTheme>可选窗口级主题覆盖(未指定时继承 Application 全局主题,默认暗色)。
locale: Option<Locale>可选窗口级语言区域覆盖(未指定时继承 Application 全局语言)。
dpi_scale: Option<usize>可选固定 HiDPI 缩放倍率(None 时自动跟随操作系统缩放)。
backend: Option<DesktopRenderBackend>桌面渲染后端(默认 DesktopRenderBackend::default_desktop)。
scroll_list_id: Option<u32>可选默认滚轮回退目标列表 ID。
Implementations§
Source§impl WindowOptions
impl WindowOptions
Sourcepub const fn backend(self, backend: DesktopRenderBackend) -> Self
pub const fn backend(self, backend: DesktopRenderBackend) -> Self
配置渲染后端(GPU 或 Software)。
Sourcepub const fn scroll_list_id(self, id: u32) -> Self
pub const fn scroll_list_id(self, id: u32) -> Self
绑定未命中滚动容器时的回退滚动列表 ID。
Trait Implementations§
Source§impl Clone for WindowOptions
impl Clone for WindowOptions
Source§impl Debug for WindowOptions
impl Debug for WindowOptions
Auto Trait Implementations§
impl Forget for WindowOptions
impl Freeze for WindowOptions
impl Move for WindowOptions
impl RefUnwindSafe for WindowOptions
impl Send for WindowOptions
impl Sync for WindowOptions
impl Unpin for WindowOptions
impl UnsafeUnpin for WindowOptions
impl UnwindSafe for WindowOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FluentBuilder for T
impl<T> FluentBuilder for T
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
当
condition 为 true 时执行闭包修饰自身,否则原样返回。Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Self
fn when_else( self, condition: bool, then: impl FnOnce(Self) -> Self, else_fn: impl FnOnce(Self) -> Self, ) -> Self
根据
condition 在两个修饰分支之间二选一。Source§fn when_some<O>(
self,
option: Option<O>,
then: impl FnOnce(Self, O) -> Self,
) -> Self
fn when_some<O>( self, option: Option<O>, then: impl FnOnce(Self, O) -> Self, ) -> Self
当
option 为 Some(value) 时执行闭包修饰自身,否则原样返回。