Fluent-Qt

API 參考

ThemeRegistry

供 FluentElement 使用的執行階段設計 token 存放區。以內建預設值初始化,並在應用程式或 UserTheme 套用覆寫時進行原子更新。

fluent::ThemeRegistry

方法

Snapshot snapshot() const

傳回目前狀態中相容的 Light/Dark 與共用部分。

ExtendedSnapshot extendedSnapshot() const

傳回完整的三調色盤主題狀態。

static Snapshot defaultSnapshot()

傳回內建 Light/Dark 與共用狀態,而不變更登錄表。

static ExtendedSnapshot defaultExtendedSnapshot()

傳回內建三調色盤主題狀態。

bool applySnapshot(const Snapshot& snapshot)

以原子方式提交相容快照並保留高對比;若狀態有變更則傳回 true。

bool applyExtendedSnapshot(const ExtendedSnapshot& snapshot)

以原子方式提交全部三組調色盤與共用主題 token;若狀態有變更則傳回 true。

const FluentElement::Colors& colors(bool dark) const

已棄用 · Use colors(FluentElement::Theme)

依布林值傳回 Light 或 Dark 調色盤(已棄用:請改用 colors(FluentElement::Theme) 以支援 HighContrast)。

FluentElement::FontStyle resolvedFontStyle(Typography::FontRole role) const

解析套用目前字型家族覆寫與縮放倍率後的 @p role 字型組態。

void setColors(bool dark, const FluentElement::Colors& colors)

已棄用 · Use setColors(FluentElement::Theme, const Colors&)

依布林值更新 Light 或 Dark 調色盤(已棄用:請改用 setColors(FluentElement::Theme, const Colors&))。

void setColors(FluentElement::Theme theme, const FluentElement::Colors& colors)

便利設定方法;每次呼叫皆會提交不可分割的快照更新。

void resetToDefaults()

還原內建 Fluent 預設值。

int revision() const

每次提交快照變更時遞增一次的單調計數器。

型別與別名

struct Snapshot

舊版相容的 Light/Dark 調色盤與共用執行時期主題狀態。

struct ExtendedSnapshot

包含高對比度調色盤的延伸佈景主題狀態。保留 Snapshot 作為其基底成員,以維持與既有初始化寫法的原始碼相容性。

fluent::ThemeRegistry::Snapshot

舊版相容的 Light/Dark 調色盤與共用執行時期主題狀態。

欄位

fluent::ThemeRegistry::ExtendedSnapshot

包含高對比度調色盤的延伸佈景主題狀態。保留 Snapshot 作為其基底成員,以維持與既有初始化寫法的原始碼相容性。

欄位