颜色主题
This commit is contained in:
1 parent
4b1a329e1b
commit
7ce5ad3166
43 files changed
+837
-636
No files matched your search
@@ -9,6 +9,7 @@ export const SYSTEM_SETTINGS_VERSION = 1
|
||||
const SYSTEM_SETTINGS_CACHE_KEY = 'SpineParticle.SystemSettings.v1'
|
||||
|
||||
export type SystemSettingsState = Pick<SettingsState,
|
||||
| 'uiTheme'
|
||||
| 'parameterPanelOnRight'
|
||||
| 'floatingMenuEnabled'
|
||||
| 'undoLimit'
|
||||
@@ -40,6 +41,7 @@ function clamp(value: unknown, min: number, max: number, fallback: number) {
|
||||
|
||||
export function captureSystemSettings(settings: SettingsState): SystemSettingsState {
|
||||
return {
|
||||
uiTheme: settings.uiTheme,
|
||||
parameterPanelOnRight: settings.parameterPanelOnRight,
|
||||
floatingMenuEnabled: settings.floatingMenuEnabled,
|
||||
undoLimit: settings.undoLimit,
|
||||
@@ -65,7 +67,11 @@ function normalizedSystemSettings(value: Partial<SystemSettingsState>, current:
|
||||
const axisColor = typeof value.axisColor === 'string' && /^#[0-9a-f]{6}$/i.test(value.axisColor)
|
||||
? value.axisColor
|
||||
: current.axisColor
|
||||
const uiTheme = value.uiTheme === 'gray-white' || value.uiTheme === 'deep-blue'
|
||||
? value.uiTheme
|
||||
: current.uiTheme
|
||||
return {
|
||||
uiTheme,
|
||||
parameterPanelOnRight: booleanValue('parameterPanelOnRight'),
|
||||
floatingMenuEnabled: booleanValue('floatingMenuEnabled'),
|
||||
undoLimit: Math.round(clamp(value.undoLimit, 1, 200, current.undoLimit)),
|
||||
|
||||
Reference in new issue
Block a user