1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 05:25:41 -05:00

settings: refactor for maintainability

This commit is contained in:
bbedward
2025-11-04 12:58:50 -05:00
parent bca5ee0c0d
commit 20116b3933
27 changed files with 959 additions and 1628 deletions

View File

@@ -223,37 +223,37 @@ Singleton {
console.info("SessionData: Migrating configuration from undefined to version 1") console.info("SessionData: Migrating configuration from undefined to version 1")
if (typeof SettingsData !== "undefined") { if (typeof SettingsData !== "undefined") {
if (settings.acMonitorTimeout !== undefined) { if (settings.acMonitorTimeout !== undefined) {
SettingsData.setAcMonitorTimeout(settings.acMonitorTimeout) SettingsData.set("acMonitorTimeout", settings.acMonitorTimeout)
} }
if (settings.acLockTimeout !== undefined) { if (settings.acLockTimeout !== undefined) {
SettingsData.setAcLockTimeout(settings.acLockTimeout) SettingsData.set("acLockTimeout", settings.acLockTimeout)
} }
if (settings.acSuspendTimeout !== undefined) { if (settings.acSuspendTimeout !== undefined) {
SettingsData.setAcSuspendTimeout(settings.acSuspendTimeout) SettingsData.set("acSuspendTimeout", settings.acSuspendTimeout)
} }
if (settings.acHibernateTimeout !== undefined) { if (settings.acHibernateTimeout !== undefined) {
SettingsData.setAcHibernateTimeout(settings.acHibernateTimeout) SettingsData.set("acHibernateTimeout", settings.acHibernateTimeout)
} }
if (settings.batteryMonitorTimeout !== undefined) { if (settings.batteryMonitorTimeout !== undefined) {
SettingsData.setBatteryMonitorTimeout(settings.batteryMonitorTimeout) SettingsData.set("batteryMonitorTimeout", settings.batteryMonitorTimeout)
} }
if (settings.batteryLockTimeout !== undefined) { if (settings.batteryLockTimeout !== undefined) {
SettingsData.setBatteryLockTimeout(settings.batteryLockTimeout) SettingsData.set("batteryLockTimeout", settings.batteryLockTimeout)
} }
if (settings.batterySuspendTimeout !== undefined) { if (settings.batterySuspendTimeout !== undefined) {
SettingsData.setBatterySuspendTimeout(settings.batterySuspendTimeout) SettingsData.set("batterySuspendTimeout", settings.batterySuspendTimeout)
} }
if (settings.batteryHibernateTimeout !== undefined) { if (settings.batteryHibernateTimeout !== undefined) {
SettingsData.setBatteryHibernateTimeout(settings.batteryHibernateTimeout) SettingsData.set("batteryHibernateTimeout", settings.batteryHibernateTimeout)
} }
if (settings.lockBeforeSuspend !== undefined) { if (settings.lockBeforeSuspend !== undefined) {
SettingsData.setLockBeforeSuspend(settings.lockBeforeSuspend) SettingsData.set("lockBeforeSuspend", settings.lockBeforeSuspend)
} }
if (settings.loginctlLockIntegration !== undefined) { if (settings.loginctlLockIntegration !== undefined) {
SettingsData.setLoginctlLockIntegration(settings.loginctlLockIntegration) SettingsData.set("loginctlLockIntegration", settings.loginctlLockIntegration)
} }
if (settings.launchPrefix !== undefined) { if (settings.launchPrefix !== undefined) {
SettingsData.setLaunchPrefix(settings.launchPrefix) SettingsData.set("launchPrefix", settings.launchPrefix)
} }
} }
if (typeof CacheData !== "undefined") { if (typeof CacheData !== "undefined") {

File diff suppressed because it is too large Load Diff

View File

@@ -482,7 +482,7 @@ Singleton {
} }
const isGreeterMode = (typeof SessionData !== "undefined" && SessionData.isGreeterMode) const isGreeterMode = (typeof SessionData !== "undefined" && SessionData.isGreeterMode)
if (savePrefs && typeof SettingsData !== "undefined" && !isGreeterMode) if (savePrefs && typeof SettingsData !== "undefined" && !isGreeterMode)
SettingsData.setTheme(currentTheme) SettingsData.set("currentThemeName", currentTheme)
if (!isGreeterMode) { if (!isGreeterMode) {
generateSystemThemesFromCurrentTheme() generateSystemThemesFromCurrentTheme()

53
Common/settings/Lists.qml Normal file
View File

@@ -0,0 +1,53 @@
pragma Singleton
pragma ComponentBehavior: Bound
import Quickshell
import QtQuick
Singleton {
id: root
function init(leftModel, centerModel, rightModel, left, center, right) {
const dummy = {
widgetId: "dummy",
enabled: true,
size: 20,
selectedGpuIndex: 0,
pciId: "",
mountPath: "/",
minimumWidth: true
}
leftModel.append(dummy)
centerModel.append(dummy)
rightModel.append(dummy)
update(leftModel, left)
update(centerModel, center)
update(rightModel, right)
}
function update(model, order) {
model.clear()
for (var i = 0; i < order.length; i++) {
var widgetId = typeof order[i] === "string" ? order[i] : order[i].id
var enabled = typeof order[i] === "string" ? true : order[i].enabled
var size = typeof order[i] === "string" ? undefined : order[i].size
var selectedGpuIndex = typeof order[i] === "string" ? undefined : order[i].selectedGpuIndex
var pciId = typeof order[i] === "string" ? undefined : order[i].pciId
var mountPath = typeof order[i] === "string" ? undefined : order[i].mountPath
var minimumWidth = typeof order[i] === "string" ? undefined : order[i].minimumWidth
var item = {
widgetId: widgetId,
enabled: enabled
}
if (size !== undefined) item.size = size
if (selectedGpuIndex !== undefined) item.selectedGpuIndex = selectedGpuIndex
if (pciId !== undefined) item.pciId = pciId
if (mountPath !== undefined) item.mountPath = mountPath
if (minimumWidth !== undefined) item.minimumWidth = minimumWidth
model.append(item)
}
}
}

View File

@@ -0,0 +1,131 @@
pragma Singleton
pragma ComponentBehavior: Bound
import QtQuick
import Quickshell
import Quickshell.Io
Singleton {
id: root
property var settingsRoot: null
function detectIcons() {
systemDefaultDetectionProcess.running = true
}
function detectQtTools() {
qtToolsDetectionProcess.running = true
}
function detectFprintd() {
fprintdDetectionProcess.running = true
}
function checkPluginSettings() {
pluginSettingsCheckProcess.running = true
}
function checkDefaultSettings() {
defaultSettingsCheckProcess.running = true
}
property var systemDefaultDetectionProcess: Process {
command: ["sh", "-c", "gsettings get org.gnome.desktop.interface icon-theme 2>/dev/null | sed \"s/'//g\" || echo ''"]
running: false
onExited: function(exitCode) {
if (!settingsRoot) return;
if (exitCode === 0 && stdout && stdout.length > 0) {
settingsRoot.systemDefaultIconTheme = stdout.trim();
} else {
settingsRoot.systemDefaultIconTheme = "";
}
iconThemeDetectionProcess.running = true;
}
}
property var iconThemeDetectionProcess: Process {
command: ["sh", "-c", "find /usr/share/icons ~/.local/share/icons ~/.icons -maxdepth 1 -type d 2>/dev/null | sed 's|.*/||' | grep -v '^icons$' | sort -u"]
running: false
stdout: StdioCollector {
onStreamFinished: {
if (!settingsRoot) return
var detectedThemes = ["System Default"]
if (text && text.trim()) {
var themes = text.trim().split('\n')
for (var i = 0; i < themes.length; i++) {
var theme = themes[i].trim()
if (theme && theme !== "" && theme !== "default" && theme !== "hicolor" && theme !== "locolor") {
detectedThemes.push(theme)
}
}
}
settingsRoot.availableIconThemes = detectedThemes
}
}
}
property var qtToolsDetectionProcess: Process {
command: ["sh", "-c", "echo -n 'qt5ct:'; command -v qt5ct >/dev/null && echo 'true' || echo 'false'; echo -n 'qt6ct:'; command -v qt6ct >/dev/null && echo 'true' || echo 'false'; echo -n 'gtk:'; (command -v gsettings >/dev/null || command -v dconf >/dev/null) && echo 'true' || echo 'false'"]
running: false
stdout: StdioCollector {
onStreamFinished: {
if (!settingsRoot) return;
if (text && text.trim()) {
var lines = text.trim().split('\n');
for (var i = 0; i < lines.length; i++) {
var line = lines[i];
if (line.startsWith('qt5ct:')) {
settingsRoot.qt5ctAvailable = line.split(':')[1] === 'true';
} else if (line.startsWith('qt6ct:')) {
settingsRoot.qt6ctAvailable = line.split(':')[1] === 'true';
} else if (line.startsWith('gtk:')) {
settingsRoot.gtkAvailable = line.split(':')[1] === 'true';
}
}
}
}
}
}
property var defaultSettingsCheckProcess: Process {
command: ["sh", "-c", "CONFIG_DIR=\"" + (settingsRoot?._configDir || "") + "/DankMaterialShell\"; if [ -f \"$CONFIG_DIR/default-settings.json\" ] && [ ! -f \"$CONFIG_DIR/settings.json\" ]; then cp --no-preserve=mode \"$CONFIG_DIR/default-settings.json\" \"$CONFIG_DIR/settings.json\" && echo 'copied'; else echo 'not_found'; fi"]
running: false
onExited: function(exitCode) {
if (!settingsRoot) return;
if (exitCode === 0) {
console.info("Copied default-settings.json to settings.json");
if (settingsRoot.settingsFile) {
settingsRoot.settingsFile.reload();
}
} else {
if (typeof ThemeApplier !== "undefined") {
ThemeApplier.applyStoredTheme(settingsRoot);
}
}
}
}
property var fprintdDetectionProcess: Process {
command: ["sh", "-c", "command -v fprintd-list >/dev/null 2>&1"]
running: false
onExited: function(exitCode) {
if (!settingsRoot) return;
settingsRoot.fprintdAvailable = (exitCode === 0);
}
}
property var pluginSettingsCheckProcess: Process {
command: ["test", "-f", settingsRoot?.pluginSettingsPath || ""]
running: false
onExited: function(exitCode) {
if (!settingsRoot) return;
settingsRoot.pluginSettingsFileExists = (exitCode === 0);
}
}
}

View File

@@ -0,0 +1,230 @@
.pragma library
function percentToUnit(v) {
if (v === undefined || v === null) return undefined;
return v > 1 ? v / 100 : v;
}
var SPEC = {
currentThemeName: { def: "blue", onChange: "applyStoredTheme" },
customThemeFile: { def: "" },
matugenScheme: { def: "scheme-tonal-spot", onChange: "regenSystemThemes" },
runUserMatugenTemplates: { def: true, onChange: "regenSystemThemes" },
matugenTargetMonitor: { def: "", onChange: "regenSystemThemes" },
dankBarTransparency: { def: 1.0, coerce: percentToUnit, migrate: ["topBarTransparency"] },
dankBarWidgetTransparency: { def: 1.0, coerce: percentToUnit, migrate: ["topBarWidgetTransparency"] },
popupTransparency: { def: 1.0, coerce: percentToUnit },
dockTransparency: { def: 1.0, coerce: percentToUnit },
widgetBackgroundColor: { def: "sch" },
surfaceBase: { def: "s", onChange: "regenSystemThemes" },
cornerRadius: { def: 12, onChange: "updateNiriLayout" },
use24HourClock: { def: true },
showSeconds: { def: false },
useFahrenheit: { def: false },
nightModeEnabled: { def: false },
animationSpeed: { def: 1 },
customAnimationDuration: { def: 500 },
wallpaperFillMode: { def: "Fill" },
blurredWallpaperLayer: { def: false },
blurWallpaperOnOverview: { def: false },
showLauncherButton: { def: true },
showWorkspaceSwitcher: { def: true },
showFocusedWindow: { def: true },
showWeather: { def: true },
showMusic: { def: true },
showClipboard: { def: true },
showCpuUsage: { def: true },
showMemUsage: { def: true },
showCpuTemp: { def: true },
showGpuTemp: { def: true },
selectedGpuIndex: { def: 0 },
enabledGpuPciIds: { def: [] },
showSystemTray: { def: true },
showClock: { def: true },
showNotificationButton: { def: true },
showBattery: { def: true },
showControlCenterButton: { def: true },
controlCenterShowNetworkIcon: { def: true },
controlCenterShowBluetoothIcon: { def: true },
controlCenterShowAudioIcon: { def: true },
controlCenterWidgets: { def: [
{ id: "volumeSlider", enabled: true, width: 50 },
{ id: "brightnessSlider", enabled: true, width: 50 },
{ id: "wifi", enabled: true, width: 50 },
{ id: "bluetooth", enabled: true, width: 50 },
{ id: "audioOutput", enabled: true, width: 50 },
{ id: "audioInput", enabled: true, width: 50 },
{ id: "nightMode", enabled: true, width: 50 },
{ id: "darkMode", enabled: true, width: 50 }
]},
showWorkspaceIndex: { def: false },
showWorkspacePadding: { def: false },
workspaceScrolling: { def: false },
showWorkspaceApps: { def: false },
maxWorkspaceIcons: { def: 3 },
workspacesPerMonitor: { def: true },
dwlShowAllTags: { def: false },
workspaceNameIcons: { def: {} },
waveProgressEnabled: { def: true },
clockCompactMode: { def: false },
focusedWindowCompactMode: { def: false },
runningAppsCompactMode: { def: true },
keyboardLayoutNameCompactMode: { def: false },
runningAppsCurrentWorkspace: { def: false },
runningAppsGroupByApp: { def: false },
clockDateFormat: { def: "" },
lockDateFormat: { def: "" },
mediaSize: { def: 1 },
dankBarLeftWidgets: { def: ["launcherButton", "workspaceSwitcher", "focusedWindow"], migrate: ["topBarLeftWidgets"] },
dankBarCenterWidgets: { def: ["music", "clock", "weather"], migrate: ["topBarCenterWidgets"] },
dankBarRightWidgets: { def: ["systemTray", "clipboard", "cpuUsage", "memUsage", "notificationButton", "battery", "controlCenterButton"], migrate: ["topBarRightWidgets"] },
dankBarWidgetOrder: { def: [] },
appLauncherViewMode: { def: "list" },
spotlightModalViewMode: { def: "list" },
sortAppsAlphabetically: { def: false },
weatherLocation: { def: "New York, NY" },
weatherCoordinates: { def: "40.7128,-74.0060" },
useAutoLocation: { def: false },
weatherEnabled: { def: true },
networkPreference: { def: "auto" },
vpnLastConnected: { def: "" },
iconTheme: { def: "System Default", onChange: "applyStoredIconTheme" },
availableIconThemes: { def: ["System Default"], persist: false },
systemDefaultIconTheme: { def: "", persist: false },
qt5ctAvailable: { def: false, persist: false },
qt6ctAvailable: { def: false, persist: false },
gtkAvailable: { def: false, persist: false },
launcherLogoMode: { def: "apps" },
launcherLogoCustomPath: { def: "" },
launcherLogoColorOverride: { def: "" },
launcherLogoColorInvertOnMode: { def: false },
launcherLogoBrightness: { def: 0.5 },
launcherLogoContrast: { def: 1 },
launcherLogoSizeOffset: { def: 0 },
fontFamily: { def: "Inter Variable" },
monoFontFamily: { def: "Fira Code" },
fontWeight: { def: 400 },
fontScale: { def: 1.0 },
dankBarFontScale: { def: 1.0 },
notepadUseMonospace: { def: true },
notepadFontFamily: { def: "" },
notepadFontSize: { def: 14 },
notepadShowLineNumbers: { def: false },
notepadTransparencyOverride: { def: -1 },
notepadLastCustomTransparency: { def: 0.7 },
soundsEnabled: { def: true },
useSystemSoundTheme: { def: false },
soundNewNotification: { def: true },
soundVolumeChanged: { def: true },
soundPluggedIn: { def: true },
acMonitorTimeout: { def: 0 },
acLockTimeout: { def: 0 },
acSuspendTimeout: { def: 0 },
acHibernateTimeout: { def: 0 },
batteryMonitorTimeout: { def: 0 },
batteryLockTimeout: { def: 0 },
batterySuspendTimeout: { def: 0 },
batteryHibernateTimeout: { def: 0 },
lockBeforeSuspend: { def: false },
loginctlLockIntegration: { def: true },
launchPrefix: { def: "" },
brightnessDevicePins: { def: {} },
gtkThemingEnabled: { def: false, onChange: "regenSystemThemes" },
qtThemingEnabled: { def: false, onChange: "regenSystemThemes" },
syncModeWithPortal: { def: true },
showDock: { def: false },
dockAutoHide: { def: false },
dockGroupByApp: { def: false },
dockOpenOnOverview: { def: false },
dockPosition: { def: 1 },
dockSpacing: { def: 4 },
dockBottomGap: { def: 0 },
dockIconSize: { def: 40 },
dockIndicatorStyle: { def: "circle" },
notificationOverlayEnabled: { def: false },
dankBarAutoHide: { def: false, migrate: ["topBarAutoHide"] },
dankBarOpenOnOverview: { def: false, migrate: ["topBarOpenOnOverview"] },
dankBarVisible: { def: true, migrate: ["topBarVisible"] },
overviewRows: { def: 2, persist: false },
overviewColumns: { def: 5, persist: false },
overviewScale: { def: 0.16, persist: false },
dankBarSpacing: { def: 4, migrate: ["topBarSpacing"], onChange: "updateNiriLayout" },
dankBarBottomGap: { def: 0, migrate: ["topBarBottomGap"] },
dankBarInnerPadding: { def: 4, migrate: ["topBarInnerPadding"] },
dankBarPosition: { def: 0, migrate: ["dankBarAtBottom", "topBarAtBottom"] },
dankBarIsVertical: { def: false, persist: false },
dankBarSquareCorners: { def: false, migrate: ["topBarSquareCorners"] },
dankBarNoBackground: { def: false, migrate: ["topBarNoBackground"] },
dankBarGothCornersEnabled: { def: false, migrate: ["topBarGothCornersEnabled"] },
dankBarBorderEnabled: { def: false },
dankBarBorderColor: { def: "surfaceText" },
dankBarBorderOpacity: { def: 1.0 },
dankBarBorderThickness: { def: 1 },
popupGapsAuto: { def: true },
popupGapsManual: { def: 4 },
modalDarkenBackground: { def: true },
lockScreenShowPowerActions: { def: true },
enableFprint: { def: false },
maxFprintTries: { def: 3 },
fprintdAvailable: { def: false, persist: false },
hideBrightnessSlider: { def: false },
notificationTimeoutLow: { def: 5000 },
notificationTimeoutNormal: { def: 5000 },
notificationTimeoutCritical: { def: 0 },
notificationPopupPosition: { def: 0 },
osdAlwaysShowValue: { def: false },
powerActionConfirm: { def: true },
customPowerActionLock: { def: "" },
customPowerActionLogout: { def: "" },
customPowerActionSuspend: { def: "" },
customPowerActionHibernate: { def: "" },
customPowerActionReboot: { def: "" },
customPowerActionPowerOff: { def: "" },
updaterUseCustomCommand: { def: false },
updaterCustomCommand: { def: "" },
updaterTerminalAdditionalParams: { def: "" },
screenPreferences: { def: {} },
showOnLastDisplay: { def: {} }
};
function getValidKeys() {
return Object.keys(SPEC).filter(function(k) { return SPEC[k].persist !== false; }).concat(["configVersion"]);
}
function set(root, key, value, saveFn, hooks) {
if (!(key in SPEC)) return;
root[key] = value;
var hookName = SPEC[key].onChange;
if (hookName && hooks && hooks[hookName]) {
hooks[hookName](root);
}
saveFn();
}

View File

@@ -0,0 +1,118 @@
.pragma library
.import "./SettingsSpec.js" as SpecModule
function parse(root, jsonObj) {
var SPEC = SpecModule.SPEC;
for (var k in SPEC) {
var spec = SPEC[k];
root[k] = spec.def;
}
if (!jsonObj) return;
for (var k in jsonObj) {
if (!SPEC[k]) continue;
var raw = jsonObj[k];
var spec = SPEC[k];
var coerce = spec.coerce;
root[k] = coerce ? (coerce(raw) !== undefined ? coerce(raw) : root[k]) : raw;
}
}
function toJson(root) {
var SPEC = SpecModule.SPEC;
var out = {};
for (var k in SPEC) {
if (SPEC[k].persist === false) continue;
out[k] = root[k];
}
out.configVersion = root.settingsConfigVersion;
return out;
}
function migrate(root, jsonObj) {
var SPEC = SpecModule.SPEC;
if (!jsonObj) return;
if (jsonObj.themeIndex !== undefined || jsonObj.themeIsDynamic !== undefined) {
var themeNames = ["blue", "deepBlue", "purple", "green", "orange", "red", "cyan", "pink", "amber", "coral"];
if (jsonObj.themeIsDynamic) {
root.currentThemeName = "dynamic";
} else if (jsonObj.themeIndex >= 0 && jsonObj.themeIndex < themeNames.length) {
root.currentThemeName = themeNames[jsonObj.themeIndex];
}
console.info("Auto-migrated theme from index", jsonObj.themeIndex, "to", root.currentThemeName);
}
if ((jsonObj.dankBarWidgetOrder && jsonObj.dankBarWidgetOrder.length > 0) ||
(jsonObj.topBarWidgetOrder && jsonObj.topBarWidgetOrder.length > 0)) {
if (jsonObj.dankBarLeftWidgets === undefined && jsonObj.dankBarCenterWidgets === undefined && jsonObj.dankBarRightWidgets === undefined) {
var widgetOrder = jsonObj.dankBarWidgetOrder || jsonObj.topBarWidgetOrder;
root.dankBarLeftWidgets = widgetOrder.filter(function(w) { return ["launcherButton", "workspaceSwitcher", "focusedWindow"].indexOf(w) >= 0; });
root.dankBarCenterWidgets = widgetOrder.filter(function(w) { return ["clock", "music", "weather"].indexOf(w) >= 0; });
root.dankBarRightWidgets = widgetOrder.filter(function(w) { return ["systemTray", "clipboard", "systemResources", "notificationButton", "battery", "controlCenterButton"].indexOf(w) >= 0; });
}
}
if (jsonObj.useOSLogo !== undefined) {
root.launcherLogoMode = jsonObj.useOSLogo ? "os" : "apps";
root.launcherLogoColorOverride = jsonObj.osLogoColorOverride !== undefined ? jsonObj.osLogoColorOverride : "";
root.launcherLogoBrightness = jsonObj.osLogoBrightness !== undefined ? jsonObj.osLogoBrightness : 0.5;
root.launcherLogoContrast = jsonObj.osLogoContrast !== undefined ? jsonObj.osLogoContrast : 1;
}
if (jsonObj.mediaCompactMode !== undefined && jsonObj.mediaSize === undefined) {
root.mediaSize = jsonObj.mediaCompactMode ? 0 : 1;
}
for (var k in SPEC) {
var spec = SPEC[k];
if (!spec.migrate) continue;
for (var i = 0; i < spec.migrate.length; i++) {
var oldKey = spec.migrate[i];
if (jsonObj[oldKey] !== undefined && jsonObj[k] === undefined) {
var raw = jsonObj[oldKey];
var coerce = spec.coerce;
root[k] = coerce ? (coerce(raw) !== undefined ? coerce(raw) : root[k]) : raw;
break;
}
}
}
if (jsonObj.dankBarAtBottom !== undefined || jsonObj.topBarAtBottom !== undefined) {
var atBottom = jsonObj.dankBarAtBottom !== undefined ? jsonObj.dankBarAtBottom : jsonObj.topBarAtBottom;
root.dankBarPosition = atBottom ? 1 : 0;
}
if (jsonObj.pluginSettings !== undefined) {
root.pluginSettings = jsonObj.pluginSettings;
return true;
}
return false;
}
function cleanup(fileText) {
var getValidKeys = SpecModule.getValidKeys;
if (!fileText || !fileText.trim()) return;
try {
var settings = JSON.parse(fileText);
var validKeys = getValidKeys();
var needsSave = false;
for (var key in settings) {
if (validKeys.indexOf(key) < 0) {
console.log("SettingsData: Removing unused key:", key);
delete settings[key];
needsSave = true;
}
}
return needsSave ? JSON.stringify(settings, null, 2) : null;
} catch (e) {
console.warn("SettingsData: Failed to cleanup unused keys:", e.message);
return null;
}
}

View File

@@ -64,7 +64,7 @@ Item {
text: I18n.tr("Show Power Actions") text: I18n.tr("Show Power Actions")
description: I18n.tr("Show power, restart, and logout buttons on the lock screen") description: I18n.tr("Show power, restart, and logout buttons on the lock screen")
checked: SettingsData.lockScreenShowPowerActions checked: SettingsData.lockScreenShowPowerActions
onToggled: checked => SettingsData.setLockScreenShowPowerActions(checked) onToggled: checked => SettingsData.set("lockScreenShowPowerActions", checked)
} }
StyledText { StyledText {
@@ -84,7 +84,7 @@ Item {
enabled: SessionService.loginctlAvailable enabled: SessionService.loginctlAvailable
onToggled: checked => { onToggled: checked => {
if (SessionService.loginctlAvailable) { if (SessionService.loginctlAvailable) {
SettingsData.setLoginctlLockIntegration(checked) SettingsData.set("loginctlLockIntegration", checked)
} }
} }
} }
@@ -95,7 +95,7 @@ Item {
description: I18n.tr("Automatically lock the screen when the system prepares to suspend") description: I18n.tr("Automatically lock the screen when the system prepares to suspend")
checked: SettingsData.lockBeforeSuspend checked: SettingsData.lockBeforeSuspend
visible: SessionService.loginctlAvailable && SettingsData.loginctlLockIntegration visible: SessionService.loginctlAvailable && SettingsData.loginctlLockIntegration
onToggled: checked => SettingsData.setLockBeforeSuspend(checked) onToggled: checked => SettingsData.set("lockBeforeSuspend", checked)
} }
DankToggle { DankToggle {
@@ -104,7 +104,7 @@ Item {
description: I18n.tr("Use fingerprint reader for lock screen authentication (requires enrolled fingerprints)") description: I18n.tr("Use fingerprint reader for lock screen authentication (requires enrolled fingerprints)")
checked: SettingsData.enableFprint checked: SettingsData.enableFprint
visible: SettingsData.fprintdAvailable visible: SettingsData.fprintdAvailable
onToggled: checked => SettingsData.setEnableFprint(checked) onToggled: checked => SettingsData.set("enableFprint", checked)
} }
} }
} }
@@ -186,9 +186,9 @@ Item {
if (index >= 0) { if (index >= 0) {
const timeout = timeoutValues[index] const timeout = timeoutValues[index]
if (powerCategory.currentIndex === 0) { if (powerCategory.currentIndex === 0) {
SettingsData.setAcLockTimeout(timeout) SettingsData.set("acLockTimeout", timeout)
} else { } else {
SettingsData.setBatteryLockTimeout(timeout) SettingsData.set("batteryLockTimeout", timeout)
} }
} }
} }
@@ -222,9 +222,9 @@ Item {
if (index >= 0) { if (index >= 0) {
const timeout = timeoutValues[index] const timeout = timeoutValues[index]
if (powerCategory.currentIndex === 0) { if (powerCategory.currentIndex === 0) {
SettingsData.setAcMonitorTimeout(timeout) SettingsData.set("acMonitorTimeout", timeout)
} else { } else {
SettingsData.setBatteryMonitorTimeout(timeout) SettingsData.set("batteryMonitorTimeout", timeout)
} }
} }
} }
@@ -258,9 +258,9 @@ Item {
if (index >= 0) { if (index >= 0) {
const timeout = timeoutValues[index] const timeout = timeoutValues[index]
if (powerCategory.currentIndex === 0) { if (powerCategory.currentIndex === 0) {
SettingsData.setAcSuspendTimeout(timeout) SettingsData.set("acSuspendTimeout", timeout)
} else { } else {
SettingsData.setBatterySuspendTimeout(timeout) SettingsData.set("batterySuspendTimeout", timeout)
} }
} }
} }
@@ -295,9 +295,9 @@ Item {
if (index >= 0) { if (index >= 0) {
const timeout = timeoutValues[index] const timeout = timeoutValues[index]
if (powerCategory.currentIndex === 0) { if (powerCategory.currentIndex === 0) {
SettingsData.setAcHibernateTimeout(timeout) SettingsData.set("acHibernateTimeout", timeout)
} else { } else {
SettingsData.setBatteryHibernateTimeout(timeout) SettingsData.set("batteryHibernateTimeout", timeout)
} }
} }
} }
@@ -352,7 +352,7 @@ Item {
text: I18n.tr("Show Confirmation on Power Actions") text: I18n.tr("Show Confirmation on Power Actions")
description: I18n.tr("Request confirmation on power off, restart, suspend, hibernate and logout actions") description: I18n.tr("Request confirmation on power off, restart, suspend, hibernate and logout actions")
checked: SettingsData.powerActionConfirm checked: SettingsData.powerActionConfirm
onToggled: checked => SettingsData.setPowerActionConfirm(checked) onToggled: checked => SettingsData.set("powerActionConfirm", checked)
} }
} }
} }
@@ -418,7 +418,7 @@ Item {
} }
onTextEdited: { onTextEdited: {
SettingsData.setCustomPowerActionLock(text.trim()); SettingsData.set("customPowerActionLock", text.trim());
} }
} }
} }
@@ -450,7 +450,7 @@ Item {
} }
onTextEdited: { onTextEdited: {
SettingsData.setCustomPowerActionLogout(text.trim()); SettingsData.set("customPowerActionLogout", text.trim());
} }
} }
} }
@@ -482,7 +482,7 @@ Item {
} }
onTextEdited: { onTextEdited: {
SettingsData.setCustomPowerActionSuspend(text.trim()); SettingsData.set("customPowerActionSuspend", text.trim());
} }
} }
} }
@@ -514,7 +514,7 @@ Item {
} }
onTextEdited: { onTextEdited: {
SettingsData.setCustomPowerActionHibernate(text.trim()); SettingsData.set("customPowerActionHibernate", text.trim());
} }
} }
} }
@@ -546,7 +546,7 @@ Item {
} }
onTextEdited: { onTextEdited: {
SettingsData.setCustomPowerActionReboot(text.trim()); SettingsData.set("customPowerActionReboot", text.trim());
} }
} }
} }
@@ -578,7 +578,7 @@ Item {
} }
onTextEdited: { onTextEdited: {
SettingsData.setCustomPowerActionPowerOff(text.trim()); SettingsData.set("customPowerActionPowerOff", text.trim());
} }
} }
} }

View File

@@ -160,7 +160,7 @@ Item {
parentModal.hide() parentModal.hide()
} }
onViewModeSelected: mode => { onViewModeSelected: mode => {
SettingsData.setSpotlightModalViewMode(mode) SettingsData.set("spotlightModalViewMode", mode)
} }
} }

View File

@@ -59,7 +59,7 @@ DankPopout {
gridColumns: 4 gridColumns: 4
onAppLaunched: appDrawerPopout.close() onAppLaunched: appDrawerPopout.close()
onViewModeSelected: function (mode) { onViewModeSelected: function (mode) {
SettingsData.setAppLauncherViewMode(mode) SettingsData.set("appLauncherViewMode", mode)
} }
} }

View File

@@ -50,7 +50,7 @@ Item {
} }
return w return w
}) })
SettingsData.setControlCenterWidgets(newWidgets) SettingsData.set("controlCenterWidgets", newWidgets)
if (root.collapseCallback) { if (root.collapseCallback) {
root.collapseCallback() root.collapseCallback()
} }
@@ -74,7 +74,7 @@ Item {
} }
return w return w
}) })
SettingsData.setControlCenterWidgets(newWidgets) SettingsData.set("controlCenterWidgets", newWidgets)
if (root.collapseCallback) { if (root.collapseCallback) {
root.collapseCallback() root.collapseCallback()
} }

View File

@@ -83,7 +83,7 @@ Item {
} }
return w return w
}) })
SettingsData.setControlCenterWidgets(newWidgets) SettingsData.set("controlCenterWidgets", newWidgets)
} }
} }
} }

View File

@@ -110,7 +110,7 @@ Item {
copy[i] = copy[j]; copy[i] = copy[j];
copy[j] = tmp; copy[j] = tmp;
SettingsData.setControlCenterWidgets(copy); SettingsData.set("controlCenterWidgets", copy);
} }
function snapToGrid() { function snapToGrid() {
@@ -244,7 +244,7 @@ Item {
var widgets = SettingsData.controlCenterWidgets.slice() var widgets = SettingsData.controlCenterWidgets.slice()
if (widgetIndex >= 0 && widgetIndex < widgets.length) { if (widgetIndex >= 0 && widgetIndex < widgets.length) {
widgets[widgetIndex].width = newSize widgets[widgetIndex].width = newSize
SettingsData.setControlCenterWidgets(widgets) SettingsData.set("controlCenterWidgets", widgets)
} }
} }
} }

View File

@@ -85,7 +85,7 @@ Rectangle {
pins[screenName] = currentDeviceName pins[screenName] = currentDeviceName
} }
SettingsData.setBrightnessDevicePins(pins) SettingsData.set("brightnessDevicePins", pins)
} }
implicitHeight: brightnessContent.height + Theme.spacingM implicitHeight: brightnessContent.height + Theme.spacingM
@@ -314,7 +314,7 @@ Rectangle {
const pins = JSON.parse(JSON.stringify(SettingsData.brightnessDevicePins || {})) const pins = JSON.parse(JSON.stringify(SettingsData.brightnessDevicePins || {}))
if (pins[screenName]) { if (pins[screenName]) {
delete pins[screenName] delete pins[screenName]
SettingsData.setBrightnessDevicePins(pins) SettingsData.set("brightnessDevicePins", pins)
} }
} }
currentDeviceName = modelData.name currentDeviceName = modelData.name

View File

@@ -139,7 +139,7 @@ Item {
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
if (WeatherService.weather.available) { if (WeatherService.weather.available) {
SettingsData.setTemperatureUnit(!SettingsData.useFahrenheit) SettingsData.set("temperatureUnit", !SettingsData.useFahrenheit)
} }
} }
enabled: WeatherService.weather.available enabled: WeatherService.weather.available

View File

@@ -164,7 +164,7 @@ Rectangle {
onValueChanged: value => { onValueChanged: value => {
for (let i = 0; i < timeoutOptions.length; i++) { for (let i = 0; i < timeoutOptions.length; i++) {
if (timeoutOptions[i].text === value) { if (timeoutOptions[i].text === value) {
SettingsData.setNotificationTimeoutLow(timeoutOptions[i].value) SettingsData.set("notificationTimeoutLow", timeoutOptions[i].value)
break break
} }
} }
@@ -179,7 +179,7 @@ Rectangle {
onValueChanged: value => { onValueChanged: value => {
for (let i = 0; i < timeoutOptions.length; i++) { for (let i = 0; i < timeoutOptions.length; i++) {
if (timeoutOptions[i].text === value) { if (timeoutOptions[i].text === value) {
SettingsData.setNotificationTimeoutNormal(timeoutOptions[i].value) SettingsData.set("notificationTimeoutNormal", timeoutOptions[i].value)
break break
} }
} }
@@ -194,7 +194,7 @@ Rectangle {
onValueChanged: value => { onValueChanged: value => {
for (let i = 0; i < timeoutOptions.length; i++) { for (let i = 0; i < timeoutOptions.length; i++) {
if (timeoutOptions[i].text === value) { if (timeoutOptions[i].text === value) {
SettingsData.setNotificationTimeoutCritical(timeoutOptions[i].value) SettingsData.set("notificationTimeoutCritical", timeoutOptions[i].value)
break break
} }
} }
@@ -245,7 +245,7 @@ Rectangle {
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.notificationOverlayEnabled checked: SettingsData.notificationOverlayEnabled
onToggled: toggled => SettingsData.setNotificationOverlayEnabled(toggled) onToggled: toggled => SettingsData.set("notificationOverlayEnabled", toggled)
} }
} }
} }

View File

@@ -502,11 +502,11 @@ Item {
function handleControlCenterSettingChanged(sectionId, widgetIndex, settingName, value) { function handleControlCenterSettingChanged(sectionId, widgetIndex, settingName, value) {
// Control Center settings are global, not per-widget instance // Control Center settings are global, not per-widget instance
if (settingName === "showNetworkIcon") { if (settingName === "showNetworkIcon") {
SettingsData.setControlCenterShowNetworkIcon(value) SettingsData.set("controlCenterShowNetworkIcon", value)
} else if (settingName === "showBluetoothIcon") { } else if (settingName === "showBluetoothIcon") {
SettingsData.setControlCenterShowBluetoothIcon(value) SettingsData.set("controlCenterShowBluetoothIcon", value)
} else if (settingName === "showAudioIcon") { } else if (settingName === "showAudioIcon") {
SettingsData.setControlCenterShowAudioIcon(value) SettingsData.set("controlCenterShowAudioIcon", value)
} }
} }
@@ -786,7 +786,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.dankBarAutoHide checked: SettingsData.dankBarAutoHide
onToggled: toggled => { onToggled: toggled => {
return SettingsData.setDankBarAutoHide( return SettingsData.set("dankBarAutoHide",
toggled) toggled)
} }
} }
@@ -838,7 +838,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.dankBarVisible checked: SettingsData.dankBarVisible
onToggled: toggled => { onToggled: toggled => {
return SettingsData.setDankBarVisible( return SettingsData.set("dankBarVisible",
toggled) toggled)
} }
} }
@@ -892,7 +892,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.dankBarOpenOnOverview checked: SettingsData.dankBarOpenOnOverview
onToggled: toggled => { onToggled: toggled => {
return SettingsData.setDankBarOpenOnOverview( return SettingsData.set("dankBarOpenOnOverview",
toggled) toggled)
} }
} }
@@ -1047,7 +1047,7 @@ Item {
iconColor: Theme.surfaceText iconColor: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
onClicked: { onClicked: {
SettingsData.setDankBarBottomGap(0) SettingsData.set("dankBarBottomGap", 0)
} }
} }
@@ -1069,7 +1069,7 @@ Item {
wheelEnabled: false wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.setDankBarBottomGap( SettingsData.set("dankBarBottomGap",
newValue) newValue)
} }
@@ -1119,7 +1119,7 @@ Item {
iconColor: Theme.surfaceText iconColor: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
onClicked: { onClicked: {
SettingsData.setDankBarInnerPadding(4) SettingsData.set("dankBarInnerPadding", 4)
} }
} }
@@ -1141,7 +1141,7 @@ Item {
wheelEnabled: false wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.setDankBarInnerPadding( SettingsData.set("dankBarInnerPadding",
newValue) newValue)
} }
@@ -1164,7 +1164,7 @@ Item {
description: I18n.tr("Automatically calculate popup distance from bar edge.") description: I18n.tr("Automatically calculate popup distance from bar edge.")
checked: SettingsData.popupGapsAuto checked: SettingsData.popupGapsAuto
onToggled: checked => { onToggled: checked => {
SettingsData.setPopupGapsAuto(checked) SettingsData.set("popupGapsAuto", checked)
} }
} }
@@ -1218,7 +1218,7 @@ Item {
iconColor: Theme.surfaceText iconColor: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
onClicked: { onClicked: {
SettingsData.setPopupGapsManual(4) SettingsData.set("popupGapsManual", 4)
} }
} }
@@ -1240,7 +1240,7 @@ Item {
wheelEnabled: false wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.setPopupGapsManual(newValue) SettingsData.set("popupGapsManual", newValue)
} }
Binding { Binding {
@@ -1260,7 +1260,7 @@ Item {
description: "Removes rounded corners from bar container." description: "Removes rounded corners from bar container."
checked: SettingsData.dankBarSquareCorners checked: SettingsData.dankBarSquareCorners
onToggled: checked => { onToggled: checked => {
SettingsData.setDankBarSquareCorners( SettingsData.set("dankBarSquareCorners",
checked) checked)
} }
} }
@@ -1271,7 +1271,7 @@ Item {
description: "Remove widget backgrounds for a minimal look with tighter spacing." description: "Remove widget backgrounds for a minimal look with tighter spacing."
checked: SettingsData.dankBarNoBackground checked: SettingsData.dankBarNoBackground
onToggled: checked => { onToggled: checked => {
SettingsData.setDankBarNoBackground( SettingsData.set("dankBarNoBackground",
checked) checked)
} }
} }
@@ -1282,7 +1282,7 @@ Item {
description: "Add curved swooping tips at the bottom of the bar." description: "Add curved swooping tips at the bottom of the bar."
checked: SettingsData.dankBarGothCornersEnabled checked: SettingsData.dankBarGothCornersEnabled
onToggled: checked => { onToggled: checked => {
SettingsData.setDankBarGothCornersEnabled( SettingsData.set("dankBarGothCornersEnabled",
checked) checked)
} }
} }
@@ -1297,7 +1297,7 @@ Item {
description: "Add a 1px border to the bar. Smart edge detection only shows border on exposed sides." description: "Add a 1px border to the bar. Smart edge detection only shows border on exposed sides."
checked: SettingsData.dankBarBorderEnabled checked: SettingsData.dankBarBorderEnabled
onToggled: checked => { onToggled: checked => {
SettingsData.setDankBarBorderEnabled(checked) SettingsData.set("dankBarBorderEnabled", checked)
} }
} }
@@ -1565,7 +1565,7 @@ Item {
iconColor: Theme.surfaceText iconColor: Theme.surfaceText
onClicked: { onClicked: {
var newScale = Math.max(0.5, SettingsData.dankBarFontScale - 0.05) var newScale = Math.max(0.5, SettingsData.dankBarFontScale - 0.05)
SettingsData.setDankBarFontScale(newScale) SettingsData.set("dankBarFontScale", newScale)
} }
} }
@@ -1595,7 +1595,7 @@ Item {
iconColor: Theme.surfaceText iconColor: Theme.surfaceText
onClicked: { onClicked: {
var newScale = Math.min(2.0, SettingsData.dankBarFontScale + 0.05) var newScale = Math.min(2.0, SettingsData.dankBarFontScale + 0.05)
SettingsData.setDankBarFontScale(newScale) SettingsData.set("dankBarFontScale", newScale)
} }
} }
} }
@@ -1770,19 +1770,19 @@ Item {
} }
onCompactModeChanged: (widgetId, value) => { onCompactModeChanged: (widgetId, value) => {
if (widgetId === "clock") { if (widgetId === "clock") {
SettingsData.setClockCompactMode( SettingsData.set("clockCompactMode",
value) value)
} else if (widgetId === "music") { } else if (widgetId === "music") {
SettingsData.setMediaSize( SettingsData.set("mediaSize",
value) value)
} else if (widgetId === "focusedWindow") { } else if (widgetId === "focusedWindow") {
SettingsData.setFocusedWindowCompactMode( SettingsData.set("focusedWindowCompactMode",
value) value)
} else if (widgetId === "runningApps") { } else if (widgetId === "runningApps") {
SettingsData.setRunningAppsCompactMode( SettingsData.set("runningAppsCompactMode",
value) value)
} else if (widgetId === "keyboard_layout_name") { } else if (widgetId === "keyboard_layout_name") {
SettingsData.setKeyboardLayoutNameCompactMode( SettingsData.set("keyboardLayoutNameCompactMode",
value) value)
} }
} }
@@ -1849,19 +1849,19 @@ Item {
} }
onCompactModeChanged: (widgetId, value) => { onCompactModeChanged: (widgetId, value) => {
if (widgetId === "clock") { if (widgetId === "clock") {
SettingsData.setClockCompactMode( SettingsData.set("clockCompactMode",
value) value)
} else if (widgetId === "music") { } else if (widgetId === "music") {
SettingsData.setMediaSize( SettingsData.set("mediaSize",
value) value)
} else if (widgetId === "focusedWindow") { } else if (widgetId === "focusedWindow") {
SettingsData.setFocusedWindowCompactMode( SettingsData.set("focusedWindowCompactMode",
value) value)
} else if (widgetId === "runningApps") { } else if (widgetId === "runningApps") {
SettingsData.setRunningAppsCompactMode( SettingsData.set("runningAppsCompactMode",
value) value)
} else if (widgetId === "keyboard_layout_name") { } else if (widgetId === "keyboard_layout_name") {
SettingsData.setKeyboardLayoutNameCompactMode( SettingsData.set("keyboardLayoutNameCompactMode",
value) value)
} }
} }
@@ -1928,19 +1928,19 @@ Item {
} }
onCompactModeChanged: (widgetId, value) => { onCompactModeChanged: (widgetId, value) => {
if (widgetId === "clock") { if (widgetId === "clock") {
SettingsData.setClockCompactMode( SettingsData.set("clockCompactMode",
value) value)
} else if (widgetId === "music") { } else if (widgetId === "music") {
SettingsData.setMediaSize( SettingsData.set("mediaSize",
value) value)
} else if (widgetId === "focusedWindow") { } else if (widgetId === "focusedWindow") {
SettingsData.setFocusedWindowCompactMode( SettingsData.set("focusedWindowCompactMode",
value) value)
} else if (widgetId === "runningApps") { } else if (widgetId === "runningApps") {
SettingsData.setRunningAppsCompactMode( SettingsData.set("runningAppsCompactMode",
value) value)
} else if (widgetId === "keyboard_layout_name") { } else if (widgetId === "keyboard_layout_name") {
SettingsData.setKeyboardLayoutNameCompactMode( SettingsData.set("keyboardLayoutNameCompactMode",
value) value)
} }
} }

View File

@@ -59,7 +59,7 @@ Item {
var prefs = SettingsData.screenPreferences || {}; var prefs = SettingsData.screenPreferences || {};
var newPrefs = Object.assign({}, prefs); var newPrefs = Object.assign({}, prefs);
newPrefs[componentId] = screenNames; newPrefs[componentId] = screenNames;
SettingsData.setScreenPreferences(newPrefs); SettingsData.set("screenPreferences", newPrefs);
} }
function getShowOnLastDisplay(componentId) { function getShowOnLastDisplay(componentId) {
@@ -70,7 +70,7 @@ Item {
var prefs = SettingsData.showOnLastDisplay || {}; var prefs = SettingsData.showOnLastDisplay || {};
var newPrefs = Object.assign({}, prefs); var newPrefs = Object.assign({}, prefs);
newPrefs[componentId] = enabled; newPrefs[componentId] = enabled;
SettingsData.setShowOnLastDisplay(newPrefs); SettingsData.set("showOnLastDisplay", newPrefs);
} }
DankFlickable { DankFlickable {

View File

@@ -146,7 +146,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.dockAutoHide checked: SettingsData.dockAutoHide
onToggled: checked => { onToggled: checked => {
SettingsData.setDockAutoHide(checked) SettingsData.set("dockAutoHide", checked)
} }
} }
} }
@@ -250,7 +250,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.dockOpenOnOverview checked: SettingsData.dockOpenOnOverview
onToggled: checked => { onToggled: checked => {
SettingsData.setDockOpenOnOverview(checked) SettingsData.set("dockOpenOnOverview", checked)
} }
} }
} }
@@ -315,7 +315,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.dockGroupByApp checked: SettingsData.dockGroupByApp
onToggled: checked => { onToggled: checked => {
SettingsData.setDockGroupByApp(checked) SettingsData.set("dockGroupByApp", checked)
} }
} }
} }
@@ -380,7 +380,7 @@ Item {
currentIndex: SettingsData.dockIndicatorStyle === "circle" ? 0 : 1 currentIndex: SettingsData.dockIndicatorStyle === "circle" ? 0 : 1
onSelectionChanged: (index, selected) => { onSelectionChanged: (index, selected) => {
if (selected) { if (selected) {
SettingsData.setDockIndicatorStyle(index === 0 ? "circle" : "line") SettingsData.set("dockIndicatorStyle", index === 0 ? "circle" : "line")
} }
} }
} }
@@ -445,7 +445,7 @@ Item {
wheelEnabled: false wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.setDockIconSize(newValue) SettingsData.set("dockIconSize", newValue)
} }
} }
} }
@@ -519,7 +519,7 @@ Item {
wheelEnabled: false wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.setDockSpacing( SettingsData.set("dockSpacing",
newValue) newValue)
} }
} }
@@ -547,7 +547,7 @@ Item {
wheelEnabled: false wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.setDockBottomGap( SettingsData.set("dockBottomGap",
newValue) newValue)
} }
} }
@@ -612,7 +612,7 @@ Item {
wheelEnabled: false wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.setDockTransparency( SettingsData.set("dockTransparency",
newValue / 100) newValue / 100)
} }
} }

View File

@@ -18,7 +18,7 @@ Item {
browserType: "generic" browserType: "generic"
filterExtensions: ["*.svg", "*.png", "*.jpg", "*.jpeg", "*.webp"] filterExtensions: ["*.svg", "*.png", "*.jpg", "*.jpeg", "*.webp"]
onFileSelected: path => { onFileSelected: path => {
SettingsData.setLauncherLogoCustomPath(path.replace("file://", "")) SettingsData.set("launcherLogoCustomPath", path.replace("file://", ""))
} }
} }
@@ -112,15 +112,15 @@ Item {
onSelectionChanged: (index, selected) => { onSelectionChanged: (index, selected) => {
if (!selected) return if (!selected) return
if (index === 0) { if (index === 0) {
SettingsData.setLauncherLogoMode("apps") SettingsData.set("launcherLogoMode", "apps")
} else if (index === 1) { } else if (index === 1) {
SettingsData.setLauncherLogoMode("os") SettingsData.set("launcherLogoMode", "os")
} else if (index === 2) { } else if (index === 2) {
SettingsData.setLauncherLogoMode("dank") SettingsData.set("launcherLogoMode", "dank")
} else if (index === 3) { } else if (index === 3) {
SettingsData.setLauncherLogoMode("compositor") SettingsData.set("launcherLogoMode", "compositor")
} else if (index === 4) { } else if (index === 4) {
SettingsData.setLauncherLogoMode("custom") SettingsData.set("launcherLogoMode", "custom")
} }
} }
} }
@@ -210,16 +210,16 @@ Item {
onSelectionChanged: (index, selected) => { onSelectionChanged: (index, selected) => {
if (!selected) return if (!selected) return
if (index === 0) { if (index === 0) {
SettingsData.setLauncherLogoColorOverride("") SettingsData.set("launcherLogoColorOverride", "")
} else if (index === 1) { } else if (index === 1) {
SettingsData.setLauncherLogoColorOverride("primary") SettingsData.set("launcherLogoColorOverride", "primary")
} else if (index === 2) { } else if (index === 2) {
SettingsData.setLauncherLogoColorOverride("surface") SettingsData.set("launcherLogoColorOverride", "surface")
} else if (index === 3) { } else if (index === 3) {
const currentOverride = SettingsData.launcherLogoColorOverride const currentOverride = SettingsData.launcherLogoColorOverride
const isPreset = currentOverride === "" || currentOverride === "primary" || currentOverride === "surface" const isPreset = currentOverride === "" || currentOverride === "primary" || currentOverride === "surface"
if (isPreset) { if (isPreset) {
SettingsData.setLauncherLogoColorOverride("#ffffff") SettingsData.set("launcherLogoColorOverride", "#ffffff")
} }
} }
} }
@@ -252,7 +252,7 @@ Item {
PopoutService.colorPickerModal.selectedColor = SettingsData.launcherLogoColorOverride PopoutService.colorPickerModal.selectedColor = SettingsData.launcherLogoColorOverride
PopoutService.colorPickerModal.pickerTitle = I18n.tr("Choose Launcher Logo Color") PopoutService.colorPickerModal.pickerTitle = I18n.tr("Choose Launcher Logo Color")
PopoutService.colorPickerModal.onColorSelectedCallback = function(selectedColor) { PopoutService.colorPickerModal.onColorSelectedCallback = function(selectedColor) {
SettingsData.setLauncherLogoColorOverride(selectedColor) SettingsData.set("launcherLogoColorOverride", selectedColor)
} }
PopoutService.colorPickerModal.show() PopoutService.colorPickerModal.show()
} }
@@ -291,7 +291,7 @@ Item {
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.setLauncherLogoSizeOffset(newValue) SettingsData.set("launcherLogoSizeOffset", newValue)
} }
} }
} }
@@ -342,7 +342,7 @@ Item {
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.setLauncherLogoBrightness(newValue / 100) SettingsData.set("launcherLogoBrightness", newValue / 100)
} }
} }
} }
@@ -371,7 +371,7 @@ Item {
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.setLauncherLogoContrast(newValue / 100) SettingsData.set("launcherLogoContrast", newValue / 100)
} }
} }
} }
@@ -394,7 +394,7 @@ Item {
checked: SettingsData.launcherLogoColorInvertOnMode checked: SettingsData.launcherLogoColorInvertOnMode
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
onToggled: checked => { onToggled: checked => {
SettingsData.setLauncherLogoColorInvertOnMode(checked) SettingsData.set("launcherLogoColorInvertOnMode", checked)
} }
} }
} }
@@ -453,7 +453,7 @@ Item {
text: SettingsData.launchPrefix text: SettingsData.launchPrefix
placeholderText: I18n.tr("Enter launch prefix (e.g., 'uwsm-app')") placeholderText: I18n.tr("Enter launch prefix (e.g., 'uwsm-app')")
onTextEdited: { onTextEdited: {
SettingsData.setLaunchPrefix(text) SettingsData.set("launchPrefix", text)
} }
} }
} }
@@ -509,7 +509,7 @@ Item {
checked: SettingsData.sortAppsAlphabetically checked: SettingsData.sortAppsAlphabetically
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
onToggled: checked => { onToggled: checked => {
SettingsData.setSortAppsAlphabetically(checked) SettingsData.set("sortAppsAlphabetically", checked)
} }
} }
} }

View File

@@ -413,7 +413,7 @@ Item {
onSelectionChanged: (index, selected) => { onSelectionChanged: (index, selected) => {
if (selected) { if (selected) {
const modes = ["Stretch", "Fit", "Fill", "Tile", "TileVertically", "TileHorizontally", "Pad"] const modes = ["Stretch", "Fit", "Fill", "Tile", "TileVertically", "TileHorizontally", "Pad"]
SettingsData.setWallpaperFillMode(modes[index]) SettingsData.set("wallpaperFillMode", modes[index])
} }
} }
@@ -930,7 +930,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.blurWallpaperOnOverview checked: SettingsData.blurWallpaperOnOverview
onToggled: checked => { onToggled: checked => {
SettingsData.setBlurWallpaperOnOverview(checked) SettingsData.set("blurWallpaperOnOverview", checked)
} }
} }
} }
@@ -1461,7 +1461,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.blurredWallpaperLayer checked: SettingsData.blurredWallpaperLayer
onToggled: checked => { onToggled: checked => {
SettingsData.setBlurredWallpaperLayer(checked) SettingsData.set("blurredWallpaperLayer", checked)
} }
} }
} }
@@ -1573,7 +1573,7 @@ Item {
currentIndex: SettingsData.animationSpeed currentIndex: SettingsData.animationSpeed
onSelectionChanged: (index, selected) => { onSelectionChanged: (index, selected) => {
if (selected) { if (selected) {
SettingsData.setAnimationSpeed(index) SettingsData.set("animationSpeed", index)
} }
} }
@@ -1654,8 +1654,8 @@ Item {
wheelEnabled: false wheelEnabled: false
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.setAnimationSpeed(SettingsData.AnimationSpeed.Custom) SettingsData.set("animationSpeed", SettingsData.AnimationSpeed.Custom)
SettingsData.setCustomAnimationDuration(newValue) SettingsData.set("customAnimationDuration", newValue)
} }
Connections { Connections {
@@ -1926,7 +1926,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.soundsEnabled checked: SettingsData.soundsEnabled
onToggled: checked => { onToggled: checked => {
SettingsData.setSoundsEnabled(checked) SettingsData.set("soundsEnabled", checked)
} }
} }
} }
@@ -1974,7 +1974,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.useSystemSoundTheme checked: SettingsData.useSystemSoundTheme
onToggled: checked => { onToggled: checked => {
SettingsData.setUseSystemSoundTheme(checked) SettingsData.set("useSystemSoundTheme", checked)
} }
} }
} }
@@ -2039,7 +2039,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.soundNewNotification checked: SettingsData.soundNewNotification
onToggled: checked => { onToggled: checked => {
SettingsData.setSoundNewNotification(checked) SettingsData.set("soundNewNotification", checked)
} }
} }
} }
@@ -2073,7 +2073,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.soundVolumeChanged checked: SettingsData.soundVolumeChanged
onToggled: checked => { onToggled: checked => {
SettingsData.setSoundVolumeChanged(checked) SettingsData.set("soundVolumeChanged", checked)
} }
} }
} }
@@ -2108,7 +2108,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.soundPluggedIn checked: SettingsData.soundPluggedIn
onToggled: checked => { onToggled: checked => {
SettingsData.setSoundPluggedIn(checked) SettingsData.set("soundPluggedIn", checked)
} }
} }
} }

View File

@@ -770,7 +770,7 @@ Item {
wheelEnabled: false wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.setDankBarTransparency( SettingsData.set("dankBarTransparency",
newValue / 100) newValue / 100)
} }
} }
@@ -835,7 +835,7 @@ Item {
onSelectionChanged: (index, selected) => { onSelectionChanged: (index, selected) => {
if (!selected) return if (!selected) return
const colorOptions = ["sth", "s", "sc", "sch"] const colorOptions = ["sth", "s", "sc", "sch"]
SettingsData.setWidgetBackgroundColor(colorOptions[index]) SettingsData.set("widgetBackgroundColor", colorOptions[index])
} }
} }
} }
@@ -852,7 +852,7 @@ Item {
wheelEnabled: false wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.setDankBarWidgetTransparency( SettingsData.set("dankBarWidgetTransparency",
newValue / 100) newValue / 100)
} }
} }
@@ -889,7 +889,7 @@ Item {
wheelEnabled: false wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
SettingsData.setPopupTransparency( SettingsData.set("popupTransparency",
newValue / 100) newValue / 100)
} }
} }
@@ -968,7 +968,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.modalDarkenBackground checked: SettingsData.modalDarkenBackground
onToggled: checked => { onToggled: checked => {
SettingsData.setModalDarkenBackground(checked) SettingsData.set("modalDarkenBackground", checked)
} }
} }
} }
@@ -1026,9 +1026,9 @@ Item {
options: cachedFontFamilies options: cachedFontFamilies
onValueChanged: value => { onValueChanged: value => {
if (value.startsWith("Default")) if (value.startsWith("Default"))
SettingsData.setFontFamily(SettingsData.defaultFontFamily) SettingsData.set("fontFamily", SettingsData.defaultFontFamily)
else else
SettingsData.setFontFamily(value) SettingsData.set("fontFamily", value)
} }
} }
@@ -1094,7 +1094,7 @@ Item {
weight = Font.Normal weight = Font.Normal
break break
} }
SettingsData.setFontWeight(weight) SettingsData.set("fontWeight", weight)
} }
} }
@@ -1113,9 +1113,9 @@ Item {
options: cachedMonoFamilies options: cachedMonoFamilies
onValueChanged: value => { onValueChanged: value => {
if (value === "Default") if (value === "Default")
SettingsData.setMonoFontFamily(SettingsData.defaultMonoFontFamily) SettingsData.set("monoFontFamily", SettingsData.defaultMonoFontFamily)
else else
SettingsData.setMonoFontFamily(value) SettingsData.set("monoFontFamily", value)
} }
} }
@@ -1165,7 +1165,7 @@ Item {
iconColor: Theme.surfaceText iconColor: Theme.surfaceText
onClicked: { onClicked: {
var newScale = Math.max(1.0, SettingsData.fontScale - 0.05) var newScale = Math.max(1.0, SettingsData.fontScale - 0.05)
SettingsData.setFontScale(newScale) SettingsData.set("fontScale", newScale)
} }
} }
@@ -1199,7 +1199,7 @@ Item {
onClicked: { onClicked: {
var newScale = Math.min(2.0, var newScale = Math.min(2.0,
SettingsData.fontScale + 0.05) SettingsData.fontScale + 0.05)
SettingsData.setFontScale(newScale) SettingsData.set("fontScale", newScale)
} }
} }
} }
@@ -1258,7 +1258,7 @@ Item {
height: 32 height: 32
checked: SettingsData.syncModeWithPortal checked: SettingsData.syncModeWithPortal
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
onToggled: checked => SettingsData.setSyncModeWithPortal(checked) onToggled: checked => SettingsData.set("syncModeWithPortal", checked)
} }
} }
} }
@@ -1499,7 +1499,7 @@ Item {
onFileSelected: function(filePath) { onFileSelected: function(filePath) {
// Save the custom theme file path and switch to custom theme // Save the custom theme file path and switch to custom theme
if (filePath.endsWith(".json")) { if (filePath.endsWith(".json")) {
SettingsData.setCustomThemeFile(filePath) SettingsData.set("customThemeFile", filePath)
Theme.switchTheme("custom") Theme.switchTheme("custom")
close() close()
} }

View File

@@ -77,7 +77,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.use24HourClock checked: SettingsData.use24HourClock
onToggled: checked => { onToggled: checked => {
return SettingsData.setClockFormat( return SettingsData.set("clockFormat",
checked) checked)
} }
} }
@@ -140,7 +140,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.showSeconds checked: SettingsData.showSeconds
onToggled: checked => { onToggled: checked => {
return SettingsData.setTimeFormat( return SettingsData.set("timeFormat",
checked) checked)
} }
} }
@@ -240,7 +240,7 @@ Item {
customFormatInput.visible = true customFormatInput.visible = true
} else { } else {
customFormatInput.visible = false customFormatInput.visible = false
SettingsData.setClockDateFormat( SettingsData.set("clockDateFormat",
formatMap[value]) formatMap[value])
} }
} }
@@ -302,7 +302,7 @@ Item {
customLockFormatInput.visible = true customLockFormatInput.visible = true
} else { } else {
customLockFormatInput.visible = false customLockFormatInput.visible = false
SettingsData.setLockDateFormat( SettingsData.set("lockDateFormat",
formatMap[value]) formatMap[value])
} }
} }
@@ -317,7 +317,7 @@ Item {
text: SettingsData.clockDateFormat text: SettingsData.clockDateFormat
onTextChanged: { onTextChanged: {
if (visible && text) if (visible && text)
SettingsData.setClockDateFormat(text) SettingsData.set("clockDateFormat", text)
} }
} }
@@ -330,7 +330,7 @@ Item {
text: SettingsData.lockDateFormat text: SettingsData.lockDateFormat
onTextChanged: { onTextChanged: {
if (visible && text) if (visible && text)
SettingsData.setLockDateFormat(text) SettingsData.set("lockDateFormat", text)
} }
} }
@@ -491,7 +491,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.weatherEnabled checked: SettingsData.weatherEnabled
onToggled: checked => { onToggled: checked => {
return SettingsData.setWeatherEnabled( return SettingsData.set("weatherEnabled",
checked) checked)
} }
} }
@@ -556,7 +556,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.useFahrenheit checked: SettingsData.useFahrenheit
onToggled: checked => { onToggled: checked => {
return SettingsData.setTemperatureUnit( return SettingsData.set("temperatureUnit",
checked) checked)
} }
} }
@@ -628,7 +628,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.useAutoLocation checked: SettingsData.useAutoLocation
onToggled: checked => { onToggled: checked => {
return SettingsData.setAutoLocation( return SettingsData.set("autoLocation",
checked) checked)
} }
} }
@@ -966,7 +966,7 @@ Item {
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
if (WeatherService.weather.available) { if (WeatherService.weather.available) {
SettingsData.setTemperatureUnit(!SettingsData.useFahrenheit) SettingsData.set("temperatureUnit", !SettingsData.useFahrenheit)
} }
} }
enabled: WeatherService.weather.available enabled: WeatherService.weather.available

View File

@@ -61,7 +61,7 @@ Item {
description: I18n.tr("Show workspace index numbers in the top bar workspace switcher") description: I18n.tr("Show workspace index numbers in the top bar workspace switcher")
checked: SettingsData.showWorkspaceIndex checked: SettingsData.showWorkspaceIndex
onToggled: checked => { onToggled: checked => {
return SettingsData.setShowWorkspaceIndex( return SettingsData.set("showWorkspaceIndex",
checked) checked)
} }
} }
@@ -71,7 +71,7 @@ Item {
description: I18n.tr("Always show a minimum of 3 workspaces, even if fewer are available") description: I18n.tr("Always show a minimum of 3 workspaces, even if fewer are available")
checked: SettingsData.showWorkspacePadding checked: SettingsData.showWorkspacePadding
onToggled: checked => { onToggled: checked => {
return SettingsData.setShowWorkspacePadding( return SettingsData.set("showWorkspacePadding",
checked) checked)
} }
} }
@@ -82,7 +82,7 @@ Item {
description: I18n.tr("Display application icons in workspace indicators") description: I18n.tr("Display application icons in workspace indicators")
checked: SettingsData.showWorkspaceApps checked: SettingsData.showWorkspaceApps
onToggled: checked => { onToggled: checked => {
return SettingsData.setShowWorkspaceApps( return SettingsData.set("showWorkspaceApps",
checked) checked)
} }
} }
@@ -116,7 +116,7 @@ Item {
topPadding: Theme.spacingXS topPadding: Theme.spacingXS
bottomPadding: Theme.spacingXS bottomPadding: Theme.spacingXS
onEditingFinished: { onEditingFinished: {
SettingsData.setMaxWorkspaceIcons(parseInt(text, 10)) SettingsData.set("maxWorkspaceIcons", parseInt(text, 10))
} }
} }
} }
@@ -135,7 +135,7 @@ Item {
description: I18n.tr("Show only workspaces belonging to each specific monitor.") description: I18n.tr("Show only workspaces belonging to each specific monitor.")
checked: SettingsData.workspacesPerMonitor checked: SettingsData.workspacesPerMonitor
onToggled: checked => { onToggled: checked => {
return SettingsData.setWorkspacesPerMonitor(checked); return SettingsData.set("workspacesPerMonitor", checked);
} }
} }
@@ -146,7 +146,7 @@ Item {
checked: SettingsData.dwlShowAllTags checked: SettingsData.dwlShowAllTags
visible: CompositorService.isDwl visible: CompositorService.isDwl
onToggled: checked => { onToggled: checked => {
return SettingsData.setDwlShowAllTags(checked); return SettingsData.set("dwlShowAllTags", checked);
} }
} }
} }
@@ -194,7 +194,7 @@ Item {
description: I18n.tr("Use animated wave progress bars for media playback") description: I18n.tr("Use animated wave progress bars for media playback")
checked: SettingsData.waveProgressEnabled checked: SettingsData.waveProgressEnabled
onToggled: checked => { onToggled: checked => {
return SettingsData.setWaveProgressEnabled(checked); return SettingsData.set("waveProgressEnabled", checked);
} }
} }
} }
@@ -244,10 +244,10 @@ Item {
if (!checked) { if (!checked) {
updaterCustomCommand.text = ""; updaterCustomCommand.text = "";
updaterTerminalCustomClass.text = ""; updaterTerminalCustomClass.text = "";
SettingsData.setUpdaterCustomCommand(""); SettingsData.set("updaterCustomCommand", "");
SettingsData.setUpdaterTerminalAdditionalParams(""); SettingsData.set("updaterTerminalAdditionalParams", "");
} }
return SettingsData.setUpdaterUseCustomCommandEnabled(checked); return SettingsData.set("updaterUseCustomCommandEnabled", checked);
} }
} }
@@ -284,7 +284,7 @@ Item {
} }
onTextEdited: { onTextEdited: {
SettingsData.setUpdaterCustomCommand(text.trim()); SettingsData.set("updaterCustomCommand", text.trim());
} }
MouseArea { MouseArea {
@@ -331,7 +331,7 @@ Item {
} }
onTextEdited: { onTextEdited: {
SettingsData.setUpdaterTerminalAdditionalParams(text.trim()); SettingsData.set("updaterTerminalAdditionalParams", text.trim());
} }
MouseArea { MouseArea {
@@ -389,7 +389,7 @@ Item {
description: I18n.tr("Show only apps running in current workspace") description: I18n.tr("Show only apps running in current workspace")
checked: SettingsData.runningAppsCurrentWorkspace checked: SettingsData.runningAppsCurrentWorkspace
onToggled: checked => { onToggled: checked => {
return SettingsData.setRunningAppsCurrentWorkspace( return SettingsData.set("runningAppsCurrentWorkspace",
checked) checked)
} }
} }
@@ -621,19 +621,19 @@ Item {
onValueChanged: value => { onValueChanged: value => {
switch (value) { switch (value) {
case "Top Right": case "Top Right":
SettingsData.setNotificationPopupPosition(SettingsData.Position.Top) SettingsData.set("notificationPopupPosition", SettingsData.Position.Top)
break break
case "Top Left": case "Top Left":
SettingsData.setNotificationPopupPosition(SettingsData.Position.Left) SettingsData.set("notificationPopupPosition", SettingsData.Position.Left)
break break
case "Top Center": case "Top Center":
SettingsData.setNotificationPopupPosition(-1) SettingsData.set("notificationPopupPosition", -1)
break break
case "Bottom Right": case "Bottom Right":
SettingsData.setNotificationPopupPosition(SettingsData.Position.Right) SettingsData.set("notificationPopupPosition", SettingsData.Position.Right)
break break
case "Bottom Left": case "Bottom Left":
SettingsData.setNotificationPopupPosition(SettingsData.Position.Bottom) SettingsData.set("notificationPopupPosition", SettingsData.Position.Bottom)
break break
} }
SettingsData.sendTestNotifications() SettingsData.sendTestNotifications()
@@ -693,7 +693,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.osdAlwaysShowValue checked: SettingsData.osdAlwaysShowValue
onToggleCompleted: checked => { onToggleCompleted: checked => {
SettingsData.setOsdAlwaysShowValue(checked) SettingsData.set("osdAlwaysShowValue", checked)
} }
} }
} }

View File

@@ -483,7 +483,7 @@ Column {
iconSize: 16 iconSize: 16
iconColor: SettingsData.runningAppsGroupByApp ? Theme.primary : Theme.outline iconColor: SettingsData.runningAppsGroupByApp ? Theme.primary : Theme.outline
onClicked: { onClicked: {
SettingsData.setRunningAppsGroupByApp(!SettingsData.runningAppsGroupByApp) SettingsData.set("runningAppsGroupByApp", !SettingsData.runningAppsGroupByApp)
} }
onEntered: { onEntered: {
groupByAppTooltipLoader.active = true groupByAppTooltipLoader.active = true

View File

@@ -280,7 +280,7 @@ Singleton {
if (vpnConnected && activeUuid) { if (vpnConnected && activeUuid) {
lastConnectedVpnUuid = activeUuid lastConnectedVpnUuid = activeUuid
SettingsData.setVpnLastConnected(activeUuid) SettingsData.set("vpnLastConnected", activeUuid)
} }
if (vpnIsBusy) { if (vpnIsBusy) {
@@ -558,7 +558,7 @@ Singleton {
userPreference = preference userPreference = preference
changingPreference = true changingPreference = true
targetPreference = preference targetPreference = preference
SettingsData.setNetworkPreference(preference) SettingsData.set("networkPreference", preference)
DMSService.sendRequest("network.preference.set", { preference: preference }, response => { DMSService.sendRequest("network.preference.set", { preference: preference }, response => {
changingPreference = false changingPreference = false

View File

@@ -764,7 +764,7 @@ Singleton {
root.userPreference = preference root.userPreference = preference
root.changingPreference = true root.changingPreference = true
root.targetPreference = preference root.targetPreference = preference
SettingsData.setNetworkPreference(preference) SettingsData.set("networkPreference", preference)
if (preference === "wifi") { if (preference === "wifi") {
setConnectionPriority("wifi") setConnectionPriority("wifi")