pub struct Options {
pub title: String,
pub width: u32,
pub height: u32,
pub theme: Option<Theme>,
pub font: Option<FontConfig>,
pub fullscreen: bool,
}Expand description
窗口参数。
Fields§
§title: String窗口标题。
width: u32客户区宽度,单位 DIP(逻辑像素,96 DPI = 1:1)。
实际物理像素 = round(DIP × dpi_scale):125% 缩放下 640 会得到 800 像素客户区,
与 Windows 其它应用一致(见 docs/design/dpi-policy.md)。
height: u32客户区高度,单位 DIP。缩放规则同 Options::width。
theme: Option<Theme>主题(None = y901_ui::theme::DARK_THEME)。
主题是渲染属性,由后端持有;UiTree 不保存主题(树不关心颜色)。
若将来需要“运行时切主题“,再引入 set_theme——当前只支持启动时注入。
font: Option<FontConfig>字体(None = NSimSun / 16px)。
fullscreen: boolborderless fullscreen(无边框全屏)。
与环境变量 Y901_FULLSCREEN 取 OR:
环境变量保留为测试覆盖手段(无需改代码即可跑全屏场景)。
Trait Implementations§
Auto Trait Implementations§
impl Forget for Options
impl Freeze for Options
impl Move for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnsafeUnpin for Options
impl UnwindSafe for Options
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