Files
Unlucky-Launcher/crates/app/ui/theme/metrics.slint
T
AskaEth bc41dfcf7d
CI / fmt (rustfmt --check) (push) Canceled after 0s
CI / clippy (ubuntu-latest) (push) Canceled after 0s
CI / clippy (windows-latest) (push) Canceled after 0s
CI / test (ubuntu-latest) (push) Canceled after 0s
CI / test (windows-latest) (push) Canceled after 0s
CI / build release (ubuntu-latest) (push) Canceled after 0s
CI / build release (windows-latest) (push) Canceled after 0s
Guards / core 零 UI 守门 (push) Canceled after 0s
Guards / 文件行数 ≤400 守门 (push) Canceled after 0s
Guards / 依赖许可与来源(cargo-deny) (push) Canceled after 0s
Unlucky Launcher v0.0.1-alpha
Rust 原生单文件 Minecraft 启动器:CLI 完整可用(install/launch/accounts/java/diagnose/agent),
MCP server 接入外部 Agent 工具,GUI 开发中。
2026-10-31 21:54:10 +08:00

49 lines
1.9 KiB
Plaintext

// 布局度量令牌(D16 定稿的尺寸口径集中在此):
// 导航栏折叠宽度、AI 栏宽度、标题栏高度、磁贴三档尺寸与列数。
import { TileSize } from "../models.slint";
export global Metrics {
// 间距刻度(4 的倍数,Metro 栅格)
out property <length> gap-1: 4px;
out property <length> gap-2: 8px;
out property <length> gap-3: 12px;
out property <length> gap-4: 16px;
out property <length> gap-5: 24px;
out property <length> gap-6: 32px;
out property <length> radius-sm: 2px;
out property <length> radius-md: 4px;
out property <length> radius-lg: 8px;
// 主窗口骨架
out property <length> titlebar-height: 40px;
out property <length> titlebar-button-width: 46px;
out property <length> accent-line: 2px;
out property <length> nav-expanded-width: 88px;
out property <length> nav-collapsed-width: 48px;
out property <length> ai-panel-width: 320px;
out property <length> ai-rail-width: 44px;
out property <length> page-header-height: 56px;
out property <length> running-strip-height: 32px;
out property <length> row-height: 44px;
out property <length> control-height: 32px;
out property <length> touch-target: 32px;
// 磁贴三档(Q24-3:默认中磁贴 4 列,设置可调小 6 / 大 3)
in-out property <TileSize> tile-size: TileSize.medium;
out property <int> tile-columns:
tile-size == TileSize.small ? 6
: tile-size == TileSize.large ? 3
: 4;
out property <length> tile-height:
tile-size == TileSize.small ? 104px
: tile-size == TileSize.large ? 176px
: 136px;
out property <length> tile-icon-size:
tile-size == TileSize.small ? 32px
: tile-size == TileSize.large ? 56px
: 44px;
// 小磁贴只留图标+名字+启动键,藏起徽标与最后游玩时间(空间不足)
out property <bool> tile-compact: tile-size == TileSize.small;
}