Theme.qml 2.03 KB
pragma Singleton
import QtQuick

QtObject {
    // 颜色 — Apple 高级浅色
    readonly property color bgCanvas:    "#fbfbfd"
    readonly property color bgSurface:   "#ffffff"
    readonly property color bgElevated:  "#ffffff"
    readonly property color bgSubtle:    "#f4f4f7"
    readonly property color bgHover:     "#f0f0f3"

    readonly property color textPrimary:   "#1d1d1f"
    readonly property color textSecondary: "#6e6e73"
    readonly property color textTertiary:  "#86868b"
    readonly property color textOnAccent:  "#ffffff"

    readonly property color borderDefault: Qt.rgba(0, 0, 0, 0.10)
    readonly property color borderStrong:  Qt.rgba(0, 0, 0, 0.18)
    readonly property color divider:       Qt.rgba(0, 0, 0, 0.06)

    readonly property color accent:        "#0071e3"
    readonly property color accentHover:   "#0077ed"
    readonly property color accentPressed: "#0062c4"
    readonly property color accentSubtle:  Qt.rgba(0, 0.443, 0.89, 0.10)

    readonly property color success: "#34c759"
    readonly property color warning: "#ff9500"
    readonly property color danger:  "#ff3b30"

    // 尺寸
    readonly property int radiusSm: 4
    readonly property int radiusMd: 8
    readonly property int radiusLg: 12
    readonly property int radiusPill: 980

    readonly property int space1: 4
    readonly property int space2: 8
    readonly property int space3: 12
    readonly property int space4: 16
    readonly property int space5: 20
    readonly property int space6: 24

    readonly property int controlHSm: 28
    readonly property int controlHMd: 36
    readonly property int controlHLg: 44

    // 字号(pt)
    readonly property int fontXs:   10
    readonly property int fontSm:   11
    readonly property int fontBase: 12
    readonly property int fontLg:   14
    readonly property int fontXl:   17
    readonly property int fontXxl:  22

    // 字体族
    readonly property string fontFamily: Qt.platform.os === "osx"
        ? "SF Pro Text, PingFang SC"
        : "Segoe UI Variable, Segoe UI, Microsoft YaHei UI"
}