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:
@@ -223,37 +223,37 @@ Singleton {
|
||||
console.info("SessionData: Migrating configuration from undefined to version 1")
|
||||
if (typeof SettingsData !== "undefined") {
|
||||
if (settings.acMonitorTimeout !== undefined) {
|
||||
SettingsData.setAcMonitorTimeout(settings.acMonitorTimeout)
|
||||
SettingsData.set("acMonitorTimeout", settings.acMonitorTimeout)
|
||||
}
|
||||
if (settings.acLockTimeout !== undefined) {
|
||||
SettingsData.setAcLockTimeout(settings.acLockTimeout)
|
||||
SettingsData.set("acLockTimeout", settings.acLockTimeout)
|
||||
}
|
||||
if (settings.acSuspendTimeout !== undefined) {
|
||||
SettingsData.setAcSuspendTimeout(settings.acSuspendTimeout)
|
||||
SettingsData.set("acSuspendTimeout", settings.acSuspendTimeout)
|
||||
}
|
||||
if (settings.acHibernateTimeout !== undefined) {
|
||||
SettingsData.setAcHibernateTimeout(settings.acHibernateTimeout)
|
||||
SettingsData.set("acHibernateTimeout", settings.acHibernateTimeout)
|
||||
}
|
||||
if (settings.batteryMonitorTimeout !== undefined) {
|
||||
SettingsData.setBatteryMonitorTimeout(settings.batteryMonitorTimeout)
|
||||
SettingsData.set("batteryMonitorTimeout", settings.batteryMonitorTimeout)
|
||||
}
|
||||
if (settings.batteryLockTimeout !== undefined) {
|
||||
SettingsData.setBatteryLockTimeout(settings.batteryLockTimeout)
|
||||
SettingsData.set("batteryLockTimeout", settings.batteryLockTimeout)
|
||||
}
|
||||
if (settings.batterySuspendTimeout !== undefined) {
|
||||
SettingsData.setBatterySuspendTimeout(settings.batterySuspendTimeout)
|
||||
SettingsData.set("batterySuspendTimeout", settings.batterySuspendTimeout)
|
||||
}
|
||||
if (settings.batteryHibernateTimeout !== undefined) {
|
||||
SettingsData.setBatteryHibernateTimeout(settings.batteryHibernateTimeout)
|
||||
SettingsData.set("batteryHibernateTimeout", settings.batteryHibernateTimeout)
|
||||
}
|
||||
if (settings.lockBeforeSuspend !== undefined) {
|
||||
SettingsData.setLockBeforeSuspend(settings.lockBeforeSuspend)
|
||||
SettingsData.set("lockBeforeSuspend", settings.lockBeforeSuspend)
|
||||
}
|
||||
if (settings.loginctlLockIntegration !== undefined) {
|
||||
SettingsData.setLoginctlLockIntegration(settings.loginctlLockIntegration)
|
||||
SettingsData.set("loginctlLockIntegration", settings.loginctlLockIntegration)
|
||||
}
|
||||
if (settings.launchPrefix !== undefined) {
|
||||
SettingsData.setLaunchPrefix(settings.launchPrefix)
|
||||
SettingsData.set("launchPrefix", settings.launchPrefix)
|
||||
}
|
||||
}
|
||||
if (typeof CacheData !== "undefined") {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -482,7 +482,7 @@ Singleton {
|
||||
}
|
||||
const isGreeterMode = (typeof SessionData !== "undefined" && SessionData.isGreeterMode)
|
||||
if (savePrefs && typeof SettingsData !== "undefined" && !isGreeterMode)
|
||||
SettingsData.setTheme(currentTheme)
|
||||
SettingsData.set("currentThemeName", currentTheme)
|
||||
|
||||
if (!isGreeterMode) {
|
||||
generateSystemThemesFromCurrentTheme()
|
||||
|
||||
53
Common/settings/Lists.qml
Normal file
53
Common/settings/Lists.qml
Normal 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
131
Common/settings/Processes.qml
Normal file
131
Common/settings/Processes.qml
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
230
Common/settings/SettingsSpec.js
Normal file
230
Common/settings/SettingsSpec.js
Normal 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();
|
||||
}
|
||||
118
Common/settings/SettingsStore.js
Normal file
118
Common/settings/SettingsStore.js
Normal 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;
|
||||
}
|
||||
}
|
||||
@@ -64,7 +64,7 @@ Item {
|
||||
text: I18n.tr("Show Power Actions")
|
||||
description: I18n.tr("Show power, restart, and logout buttons on the lock screen")
|
||||
checked: SettingsData.lockScreenShowPowerActions
|
||||
onToggled: checked => SettingsData.setLockScreenShowPowerActions(checked)
|
||||
onToggled: checked => SettingsData.set("lockScreenShowPowerActions", checked)
|
||||
}
|
||||
|
||||
StyledText {
|
||||
@@ -84,7 +84,7 @@ Item {
|
||||
enabled: SessionService.loginctlAvailable
|
||||
onToggled: checked => {
|
||||
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")
|
||||
checked: SettingsData.lockBeforeSuspend
|
||||
visible: SessionService.loginctlAvailable && SettingsData.loginctlLockIntegration
|
||||
onToggled: checked => SettingsData.setLockBeforeSuspend(checked)
|
||||
onToggled: checked => SettingsData.set("lockBeforeSuspend", checked)
|
||||
}
|
||||
|
||||
DankToggle {
|
||||
@@ -104,7 +104,7 @@ Item {
|
||||
description: I18n.tr("Use fingerprint reader for lock screen authentication (requires enrolled fingerprints)")
|
||||
checked: SettingsData.enableFprint
|
||||
visible: SettingsData.fprintdAvailable
|
||||
onToggled: checked => SettingsData.setEnableFprint(checked)
|
||||
onToggled: checked => SettingsData.set("enableFprint", checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -186,9 +186,9 @@ Item {
|
||||
if (index >= 0) {
|
||||
const timeout = timeoutValues[index]
|
||||
if (powerCategory.currentIndex === 0) {
|
||||
SettingsData.setAcLockTimeout(timeout)
|
||||
SettingsData.set("acLockTimeout", timeout)
|
||||
} else {
|
||||
SettingsData.setBatteryLockTimeout(timeout)
|
||||
SettingsData.set("batteryLockTimeout", timeout)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -222,9 +222,9 @@ Item {
|
||||
if (index >= 0) {
|
||||
const timeout = timeoutValues[index]
|
||||
if (powerCategory.currentIndex === 0) {
|
||||
SettingsData.setAcMonitorTimeout(timeout)
|
||||
SettingsData.set("acMonitorTimeout", timeout)
|
||||
} else {
|
||||
SettingsData.setBatteryMonitorTimeout(timeout)
|
||||
SettingsData.set("batteryMonitorTimeout", timeout)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -258,9 +258,9 @@ Item {
|
||||
if (index >= 0) {
|
||||
const timeout = timeoutValues[index]
|
||||
if (powerCategory.currentIndex === 0) {
|
||||
SettingsData.setAcSuspendTimeout(timeout)
|
||||
SettingsData.set("acSuspendTimeout", timeout)
|
||||
} else {
|
||||
SettingsData.setBatterySuspendTimeout(timeout)
|
||||
SettingsData.set("batterySuspendTimeout", timeout)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -295,9 +295,9 @@ Item {
|
||||
if (index >= 0) {
|
||||
const timeout = timeoutValues[index]
|
||||
if (powerCategory.currentIndex === 0) {
|
||||
SettingsData.setAcHibernateTimeout(timeout)
|
||||
SettingsData.set("acHibernateTimeout", timeout)
|
||||
} else {
|
||||
SettingsData.setBatteryHibernateTimeout(timeout)
|
||||
SettingsData.set("batteryHibernateTimeout", timeout)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -352,7 +352,7 @@ Item {
|
||||
text: I18n.tr("Show Confirmation on Power Actions")
|
||||
description: I18n.tr("Request confirmation on power off, restart, suspend, hibernate and logout actions")
|
||||
checked: SettingsData.powerActionConfirm
|
||||
onToggled: checked => SettingsData.setPowerActionConfirm(checked)
|
||||
onToggled: checked => SettingsData.set("powerActionConfirm", checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -418,7 +418,7 @@ Item {
|
||||
}
|
||||
|
||||
onTextEdited: {
|
||||
SettingsData.setCustomPowerActionLock(text.trim());
|
||||
SettingsData.set("customPowerActionLock", text.trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -450,7 +450,7 @@ Item {
|
||||
}
|
||||
|
||||
onTextEdited: {
|
||||
SettingsData.setCustomPowerActionLogout(text.trim());
|
||||
SettingsData.set("customPowerActionLogout", text.trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -482,7 +482,7 @@ Item {
|
||||
}
|
||||
|
||||
onTextEdited: {
|
||||
SettingsData.setCustomPowerActionSuspend(text.trim());
|
||||
SettingsData.set("customPowerActionSuspend", text.trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -514,7 +514,7 @@ Item {
|
||||
}
|
||||
|
||||
onTextEdited: {
|
||||
SettingsData.setCustomPowerActionHibernate(text.trim());
|
||||
SettingsData.set("customPowerActionHibernate", text.trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -546,7 +546,7 @@ Item {
|
||||
}
|
||||
|
||||
onTextEdited: {
|
||||
SettingsData.setCustomPowerActionReboot(text.trim());
|
||||
SettingsData.set("customPowerActionReboot", text.trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -578,7 +578,7 @@ Item {
|
||||
}
|
||||
|
||||
onTextEdited: {
|
||||
SettingsData.setCustomPowerActionPowerOff(text.trim());
|
||||
SettingsData.set("customPowerActionPowerOff", text.trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ Item {
|
||||
parentModal.hide()
|
||||
}
|
||||
onViewModeSelected: mode => {
|
||||
SettingsData.setSpotlightModalViewMode(mode)
|
||||
SettingsData.set("spotlightModalViewMode", mode)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ DankPopout {
|
||||
gridColumns: 4
|
||||
onAppLaunched: appDrawerPopout.close()
|
||||
onViewModeSelected: function (mode) {
|
||||
SettingsData.setAppLauncherViewMode(mode)
|
||||
SettingsData.set("appLauncherViewMode", mode)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ Item {
|
||||
}
|
||||
return w
|
||||
})
|
||||
SettingsData.setControlCenterWidgets(newWidgets)
|
||||
SettingsData.set("controlCenterWidgets", newWidgets)
|
||||
if (root.collapseCallback) {
|
||||
root.collapseCallback()
|
||||
}
|
||||
@@ -74,7 +74,7 @@ Item {
|
||||
}
|
||||
return w
|
||||
})
|
||||
SettingsData.setControlCenterWidgets(newWidgets)
|
||||
SettingsData.set("controlCenterWidgets", newWidgets)
|
||||
if (root.collapseCallback) {
|
||||
root.collapseCallback()
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ Item {
|
||||
}
|
||||
return w
|
||||
})
|
||||
SettingsData.setControlCenterWidgets(newWidgets)
|
||||
SettingsData.set("controlCenterWidgets", newWidgets)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ Item {
|
||||
copy[i] = copy[j];
|
||||
copy[j] = tmp;
|
||||
|
||||
SettingsData.setControlCenterWidgets(copy);
|
||||
SettingsData.set("controlCenterWidgets", copy);
|
||||
}
|
||||
|
||||
function snapToGrid() {
|
||||
@@ -244,7 +244,7 @@ Item {
|
||||
var widgets = SettingsData.controlCenterWidgets.slice()
|
||||
if (widgetIndex >= 0 && widgetIndex < widgets.length) {
|
||||
widgets[widgetIndex].width = newSize
|
||||
SettingsData.setControlCenterWidgets(widgets)
|
||||
SettingsData.set("controlCenterWidgets", widgets)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ Rectangle {
|
||||
pins[screenName] = currentDeviceName
|
||||
}
|
||||
|
||||
SettingsData.setBrightnessDevicePins(pins)
|
||||
SettingsData.set("brightnessDevicePins", pins)
|
||||
}
|
||||
|
||||
implicitHeight: brightnessContent.height + Theme.spacingM
|
||||
@@ -314,7 +314,7 @@ Rectangle {
|
||||
const pins = JSON.parse(JSON.stringify(SettingsData.brightnessDevicePins || {}))
|
||||
if (pins[screenName]) {
|
||||
delete pins[screenName]
|
||||
SettingsData.setBrightnessDevicePins(pins)
|
||||
SettingsData.set("brightnessDevicePins", pins)
|
||||
}
|
||||
}
|
||||
currentDeviceName = modelData.name
|
||||
|
||||
@@ -139,7 +139,7 @@ Item {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
if (WeatherService.weather.available) {
|
||||
SettingsData.setTemperatureUnit(!SettingsData.useFahrenheit)
|
||||
SettingsData.set("temperatureUnit", !SettingsData.useFahrenheit)
|
||||
}
|
||||
}
|
||||
enabled: WeatherService.weather.available
|
||||
|
||||
@@ -164,7 +164,7 @@ Rectangle {
|
||||
onValueChanged: value => {
|
||||
for (let i = 0; i < timeoutOptions.length; i++) {
|
||||
if (timeoutOptions[i].text === value) {
|
||||
SettingsData.setNotificationTimeoutLow(timeoutOptions[i].value)
|
||||
SettingsData.set("notificationTimeoutLow", timeoutOptions[i].value)
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -179,7 +179,7 @@ Rectangle {
|
||||
onValueChanged: value => {
|
||||
for (let i = 0; i < timeoutOptions.length; i++) {
|
||||
if (timeoutOptions[i].text === value) {
|
||||
SettingsData.setNotificationTimeoutNormal(timeoutOptions[i].value)
|
||||
SettingsData.set("notificationTimeoutNormal", timeoutOptions[i].value)
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -194,7 +194,7 @@ Rectangle {
|
||||
onValueChanged: value => {
|
||||
for (let i = 0; i < timeoutOptions.length; i++) {
|
||||
if (timeoutOptions[i].text === value) {
|
||||
SettingsData.setNotificationTimeoutCritical(timeoutOptions[i].value)
|
||||
SettingsData.set("notificationTimeoutCritical", timeoutOptions[i].value)
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -245,7 +245,7 @@ Rectangle {
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SettingsData.notificationOverlayEnabled
|
||||
onToggled: toggled => SettingsData.setNotificationOverlayEnabled(toggled)
|
||||
onToggled: toggled => SettingsData.set("notificationOverlayEnabled", toggled)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -502,11 +502,11 @@ Item {
|
||||
function handleControlCenterSettingChanged(sectionId, widgetIndex, settingName, value) {
|
||||
// Control Center settings are global, not per-widget instance
|
||||
if (settingName === "showNetworkIcon") {
|
||||
SettingsData.setControlCenterShowNetworkIcon(value)
|
||||
SettingsData.set("controlCenterShowNetworkIcon", value)
|
||||
} else if (settingName === "showBluetoothIcon") {
|
||||
SettingsData.setControlCenterShowBluetoothIcon(value)
|
||||
SettingsData.set("controlCenterShowBluetoothIcon", value)
|
||||
} else if (settingName === "showAudioIcon") {
|
||||
SettingsData.setControlCenterShowAudioIcon(value)
|
||||
SettingsData.set("controlCenterShowAudioIcon", value)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -786,7 +786,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SettingsData.dankBarAutoHide
|
||||
onToggled: toggled => {
|
||||
return SettingsData.setDankBarAutoHide(
|
||||
return SettingsData.set("dankBarAutoHide",
|
||||
toggled)
|
||||
}
|
||||
}
|
||||
@@ -838,7 +838,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SettingsData.dankBarVisible
|
||||
onToggled: toggled => {
|
||||
return SettingsData.setDankBarVisible(
|
||||
return SettingsData.set("dankBarVisible",
|
||||
toggled)
|
||||
}
|
||||
}
|
||||
@@ -892,7 +892,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SettingsData.dankBarOpenOnOverview
|
||||
onToggled: toggled => {
|
||||
return SettingsData.setDankBarOpenOnOverview(
|
||||
return SettingsData.set("dankBarOpenOnOverview",
|
||||
toggled)
|
||||
}
|
||||
}
|
||||
@@ -1047,7 +1047,7 @@ Item {
|
||||
iconColor: Theme.surfaceText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
onClicked: {
|
||||
SettingsData.setDankBarBottomGap(0)
|
||||
SettingsData.set("dankBarBottomGap", 0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1069,7 +1069,7 @@ Item {
|
||||
wheelEnabled: false
|
||||
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
onSliderValueChanged: newValue => {
|
||||
SettingsData.setDankBarBottomGap(
|
||||
SettingsData.set("dankBarBottomGap",
|
||||
newValue)
|
||||
}
|
||||
|
||||
@@ -1119,7 +1119,7 @@ Item {
|
||||
iconColor: Theme.surfaceText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
onClicked: {
|
||||
SettingsData.setDankBarInnerPadding(4)
|
||||
SettingsData.set("dankBarInnerPadding", 4)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1141,7 +1141,7 @@ Item {
|
||||
wheelEnabled: false
|
||||
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
onSliderValueChanged: newValue => {
|
||||
SettingsData.setDankBarInnerPadding(
|
||||
SettingsData.set("dankBarInnerPadding",
|
||||
newValue)
|
||||
}
|
||||
|
||||
@@ -1164,7 +1164,7 @@ Item {
|
||||
description: I18n.tr("Automatically calculate popup distance from bar edge.")
|
||||
checked: SettingsData.popupGapsAuto
|
||||
onToggled: checked => {
|
||||
SettingsData.setPopupGapsAuto(checked)
|
||||
SettingsData.set("popupGapsAuto", checked)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1218,7 +1218,7 @@ Item {
|
||||
iconColor: Theme.surfaceText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
onClicked: {
|
||||
SettingsData.setPopupGapsManual(4)
|
||||
SettingsData.set("popupGapsManual", 4)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1240,7 +1240,7 @@ Item {
|
||||
wheelEnabled: false
|
||||
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
onSliderValueChanged: newValue => {
|
||||
SettingsData.setPopupGapsManual(newValue)
|
||||
SettingsData.set("popupGapsManual", newValue)
|
||||
}
|
||||
|
||||
Binding {
|
||||
@@ -1260,7 +1260,7 @@ Item {
|
||||
description: "Removes rounded corners from bar container."
|
||||
checked: SettingsData.dankBarSquareCorners
|
||||
onToggled: checked => {
|
||||
SettingsData.setDankBarSquareCorners(
|
||||
SettingsData.set("dankBarSquareCorners",
|
||||
checked)
|
||||
}
|
||||
}
|
||||
@@ -1271,7 +1271,7 @@ Item {
|
||||
description: "Remove widget backgrounds for a minimal look with tighter spacing."
|
||||
checked: SettingsData.dankBarNoBackground
|
||||
onToggled: checked => {
|
||||
SettingsData.setDankBarNoBackground(
|
||||
SettingsData.set("dankBarNoBackground",
|
||||
checked)
|
||||
}
|
||||
}
|
||||
@@ -1282,7 +1282,7 @@ Item {
|
||||
description: "Add curved swooping tips at the bottom of the bar."
|
||||
checked: SettingsData.dankBarGothCornersEnabled
|
||||
onToggled: checked => {
|
||||
SettingsData.setDankBarGothCornersEnabled(
|
||||
SettingsData.set("dankBarGothCornersEnabled",
|
||||
checked)
|
||||
}
|
||||
}
|
||||
@@ -1297,7 +1297,7 @@ Item {
|
||||
description: "Add a 1px border to the bar. Smart edge detection only shows border on exposed sides."
|
||||
checked: SettingsData.dankBarBorderEnabled
|
||||
onToggled: checked => {
|
||||
SettingsData.setDankBarBorderEnabled(checked)
|
||||
SettingsData.set("dankBarBorderEnabled", checked)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1565,7 +1565,7 @@ Item {
|
||||
iconColor: Theme.surfaceText
|
||||
onClicked: {
|
||||
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
|
||||
onClicked: {
|
||||
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) => {
|
||||
if (widgetId === "clock") {
|
||||
SettingsData.setClockCompactMode(
|
||||
SettingsData.set("clockCompactMode",
|
||||
value)
|
||||
} else if (widgetId === "music") {
|
||||
SettingsData.setMediaSize(
|
||||
SettingsData.set("mediaSize",
|
||||
value)
|
||||
} else if (widgetId === "focusedWindow") {
|
||||
SettingsData.setFocusedWindowCompactMode(
|
||||
SettingsData.set("focusedWindowCompactMode",
|
||||
value)
|
||||
} else if (widgetId === "runningApps") {
|
||||
SettingsData.setRunningAppsCompactMode(
|
||||
SettingsData.set("runningAppsCompactMode",
|
||||
value)
|
||||
} else if (widgetId === "keyboard_layout_name") {
|
||||
SettingsData.setKeyboardLayoutNameCompactMode(
|
||||
SettingsData.set("keyboardLayoutNameCompactMode",
|
||||
value)
|
||||
}
|
||||
}
|
||||
@@ -1849,19 +1849,19 @@ Item {
|
||||
}
|
||||
onCompactModeChanged: (widgetId, value) => {
|
||||
if (widgetId === "clock") {
|
||||
SettingsData.setClockCompactMode(
|
||||
SettingsData.set("clockCompactMode",
|
||||
value)
|
||||
} else if (widgetId === "music") {
|
||||
SettingsData.setMediaSize(
|
||||
SettingsData.set("mediaSize",
|
||||
value)
|
||||
} else if (widgetId === "focusedWindow") {
|
||||
SettingsData.setFocusedWindowCompactMode(
|
||||
SettingsData.set("focusedWindowCompactMode",
|
||||
value)
|
||||
} else if (widgetId === "runningApps") {
|
||||
SettingsData.setRunningAppsCompactMode(
|
||||
SettingsData.set("runningAppsCompactMode",
|
||||
value)
|
||||
} else if (widgetId === "keyboard_layout_name") {
|
||||
SettingsData.setKeyboardLayoutNameCompactMode(
|
||||
SettingsData.set("keyboardLayoutNameCompactMode",
|
||||
value)
|
||||
}
|
||||
}
|
||||
@@ -1928,19 +1928,19 @@ Item {
|
||||
}
|
||||
onCompactModeChanged: (widgetId, value) => {
|
||||
if (widgetId === "clock") {
|
||||
SettingsData.setClockCompactMode(
|
||||
SettingsData.set("clockCompactMode",
|
||||
value)
|
||||
} else if (widgetId === "music") {
|
||||
SettingsData.setMediaSize(
|
||||
SettingsData.set("mediaSize",
|
||||
value)
|
||||
} else if (widgetId === "focusedWindow") {
|
||||
SettingsData.setFocusedWindowCompactMode(
|
||||
SettingsData.set("focusedWindowCompactMode",
|
||||
value)
|
||||
} else if (widgetId === "runningApps") {
|
||||
SettingsData.setRunningAppsCompactMode(
|
||||
SettingsData.set("runningAppsCompactMode",
|
||||
value)
|
||||
} else if (widgetId === "keyboard_layout_name") {
|
||||
SettingsData.setKeyboardLayoutNameCompactMode(
|
||||
SettingsData.set("keyboardLayoutNameCompactMode",
|
||||
value)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ Item {
|
||||
var prefs = SettingsData.screenPreferences || {};
|
||||
var newPrefs = Object.assign({}, prefs);
|
||||
newPrefs[componentId] = screenNames;
|
||||
SettingsData.setScreenPreferences(newPrefs);
|
||||
SettingsData.set("screenPreferences", newPrefs);
|
||||
}
|
||||
|
||||
function getShowOnLastDisplay(componentId) {
|
||||
@@ -70,7 +70,7 @@ Item {
|
||||
var prefs = SettingsData.showOnLastDisplay || {};
|
||||
var newPrefs = Object.assign({}, prefs);
|
||||
newPrefs[componentId] = enabled;
|
||||
SettingsData.setShowOnLastDisplay(newPrefs);
|
||||
SettingsData.set("showOnLastDisplay", newPrefs);
|
||||
}
|
||||
|
||||
DankFlickable {
|
||||
|
||||
@@ -146,7 +146,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SettingsData.dockAutoHide
|
||||
onToggled: checked => {
|
||||
SettingsData.setDockAutoHide(checked)
|
||||
SettingsData.set("dockAutoHide", checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -250,7 +250,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SettingsData.dockOpenOnOverview
|
||||
onToggled: checked => {
|
||||
SettingsData.setDockOpenOnOverview(checked)
|
||||
SettingsData.set("dockOpenOnOverview", checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -315,7 +315,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SettingsData.dockGroupByApp
|
||||
onToggled: checked => {
|
||||
SettingsData.setDockGroupByApp(checked)
|
||||
SettingsData.set("dockGroupByApp", checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -380,7 +380,7 @@ Item {
|
||||
currentIndex: SettingsData.dockIndicatorStyle === "circle" ? 0 : 1
|
||||
onSelectionChanged: (index, selected) => {
|
||||
if (selected) {
|
||||
SettingsData.setDockIndicatorStyle(index === 0 ? "circle" : "line")
|
||||
SettingsData.set("dockIndicatorStyle", index === 0 ? "circle" : "line")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -445,7 +445,7 @@ Item {
|
||||
wheelEnabled: false
|
||||
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
onSliderValueChanged: newValue => {
|
||||
SettingsData.setDockIconSize(newValue)
|
||||
SettingsData.set("dockIconSize", newValue)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -519,7 +519,7 @@ Item {
|
||||
wheelEnabled: false
|
||||
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
onSliderValueChanged: newValue => {
|
||||
SettingsData.setDockSpacing(
|
||||
SettingsData.set("dockSpacing",
|
||||
newValue)
|
||||
}
|
||||
}
|
||||
@@ -547,7 +547,7 @@ Item {
|
||||
wheelEnabled: false
|
||||
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
onSliderValueChanged: newValue => {
|
||||
SettingsData.setDockBottomGap(
|
||||
SettingsData.set("dockBottomGap",
|
||||
newValue)
|
||||
}
|
||||
}
|
||||
@@ -612,7 +612,7 @@ Item {
|
||||
wheelEnabled: false
|
||||
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
onSliderValueChanged: newValue => {
|
||||
SettingsData.setDockTransparency(
|
||||
SettingsData.set("dockTransparency",
|
||||
newValue / 100)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ Item {
|
||||
browserType: "generic"
|
||||
filterExtensions: ["*.svg", "*.png", "*.jpg", "*.jpeg", "*.webp"]
|
||||
onFileSelected: path => {
|
||||
SettingsData.setLauncherLogoCustomPath(path.replace("file://", ""))
|
||||
SettingsData.set("launcherLogoCustomPath", path.replace("file://", ""))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,15 +112,15 @@ Item {
|
||||
onSelectionChanged: (index, selected) => {
|
||||
if (!selected) return
|
||||
if (index === 0) {
|
||||
SettingsData.setLauncherLogoMode("apps")
|
||||
SettingsData.set("launcherLogoMode", "apps")
|
||||
} else if (index === 1) {
|
||||
SettingsData.setLauncherLogoMode("os")
|
||||
SettingsData.set("launcherLogoMode", "os")
|
||||
} else if (index === 2) {
|
||||
SettingsData.setLauncherLogoMode("dank")
|
||||
SettingsData.set("launcherLogoMode", "dank")
|
||||
} else if (index === 3) {
|
||||
SettingsData.setLauncherLogoMode("compositor")
|
||||
SettingsData.set("launcherLogoMode", "compositor")
|
||||
} else if (index === 4) {
|
||||
SettingsData.setLauncherLogoMode("custom")
|
||||
SettingsData.set("launcherLogoMode", "custom")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -210,16 +210,16 @@ Item {
|
||||
onSelectionChanged: (index, selected) => {
|
||||
if (!selected) return
|
||||
if (index === 0) {
|
||||
SettingsData.setLauncherLogoColorOverride("")
|
||||
SettingsData.set("launcherLogoColorOverride", "")
|
||||
} else if (index === 1) {
|
||||
SettingsData.setLauncherLogoColorOverride("primary")
|
||||
SettingsData.set("launcherLogoColorOverride", "primary")
|
||||
} else if (index === 2) {
|
||||
SettingsData.setLauncherLogoColorOverride("surface")
|
||||
SettingsData.set("launcherLogoColorOverride", "surface")
|
||||
} else if (index === 3) {
|
||||
const currentOverride = SettingsData.launcherLogoColorOverride
|
||||
const isPreset = currentOverride === "" || currentOverride === "primary" || currentOverride === "surface"
|
||||
if (isPreset) {
|
||||
SettingsData.setLauncherLogoColorOverride("#ffffff")
|
||||
SettingsData.set("launcherLogoColorOverride", "#ffffff")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -252,7 +252,7 @@ Item {
|
||||
PopoutService.colorPickerModal.selectedColor = SettingsData.launcherLogoColorOverride
|
||||
PopoutService.colorPickerModal.pickerTitle = I18n.tr("Choose Launcher Logo Color")
|
||||
PopoutService.colorPickerModal.onColorSelectedCallback = function(selectedColor) {
|
||||
SettingsData.setLauncherLogoColorOverride(selectedColor)
|
||||
SettingsData.set("launcherLogoColorOverride", selectedColor)
|
||||
}
|
||||
PopoutService.colorPickerModal.show()
|
||||
}
|
||||
@@ -291,7 +291,7 @@ Item {
|
||||
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
onSliderValueChanged: newValue => {
|
||||
SettingsData.setLauncherLogoSizeOffset(newValue)
|
||||
SettingsData.set("launcherLogoSizeOffset", newValue)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -342,7 +342,7 @@ Item {
|
||||
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
onSliderValueChanged: newValue => {
|
||||
SettingsData.setLauncherLogoBrightness(newValue / 100)
|
||||
SettingsData.set("launcherLogoBrightness", newValue / 100)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -371,7 +371,7 @@ Item {
|
||||
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
onSliderValueChanged: newValue => {
|
||||
SettingsData.setLauncherLogoContrast(newValue / 100)
|
||||
SettingsData.set("launcherLogoContrast", newValue / 100)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -394,7 +394,7 @@ Item {
|
||||
checked: SettingsData.launcherLogoColorInvertOnMode
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
onToggled: checked => {
|
||||
SettingsData.setLauncherLogoColorInvertOnMode(checked)
|
||||
SettingsData.set("launcherLogoColorInvertOnMode", checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -453,7 +453,7 @@ Item {
|
||||
text: SettingsData.launchPrefix
|
||||
placeholderText: I18n.tr("Enter launch prefix (e.g., 'uwsm-app')")
|
||||
onTextEdited: {
|
||||
SettingsData.setLaunchPrefix(text)
|
||||
SettingsData.set("launchPrefix", text)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -509,7 +509,7 @@ Item {
|
||||
checked: SettingsData.sortAppsAlphabetically
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
onToggled: checked => {
|
||||
SettingsData.setSortAppsAlphabetically(checked)
|
||||
SettingsData.set("sortAppsAlphabetically", checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -413,7 +413,7 @@ Item {
|
||||
onSelectionChanged: (index, selected) => {
|
||||
if (selected) {
|
||||
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
|
||||
checked: SettingsData.blurWallpaperOnOverview
|
||||
onToggled: checked => {
|
||||
SettingsData.setBlurWallpaperOnOverview(checked)
|
||||
SettingsData.set("blurWallpaperOnOverview", checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1461,7 +1461,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SettingsData.blurredWallpaperLayer
|
||||
onToggled: checked => {
|
||||
SettingsData.setBlurredWallpaperLayer(checked)
|
||||
SettingsData.set("blurredWallpaperLayer", checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1573,7 +1573,7 @@ Item {
|
||||
currentIndex: SettingsData.animationSpeed
|
||||
onSelectionChanged: (index, selected) => {
|
||||
if (selected) {
|
||||
SettingsData.setAnimationSpeed(index)
|
||||
SettingsData.set("animationSpeed", index)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1654,8 +1654,8 @@ Item {
|
||||
wheelEnabled: false
|
||||
|
||||
onSliderValueChanged: newValue => {
|
||||
SettingsData.setAnimationSpeed(SettingsData.AnimationSpeed.Custom)
|
||||
SettingsData.setCustomAnimationDuration(newValue)
|
||||
SettingsData.set("animationSpeed", SettingsData.AnimationSpeed.Custom)
|
||||
SettingsData.set("customAnimationDuration", newValue)
|
||||
}
|
||||
|
||||
Connections {
|
||||
@@ -1926,7 +1926,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SettingsData.soundsEnabled
|
||||
onToggled: checked => {
|
||||
SettingsData.setSoundsEnabled(checked)
|
||||
SettingsData.set("soundsEnabled", checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1974,7 +1974,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SettingsData.useSystemSoundTheme
|
||||
onToggled: checked => {
|
||||
SettingsData.setUseSystemSoundTheme(checked)
|
||||
SettingsData.set("useSystemSoundTheme", checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2039,7 +2039,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SettingsData.soundNewNotification
|
||||
onToggled: checked => {
|
||||
SettingsData.setSoundNewNotification(checked)
|
||||
SettingsData.set("soundNewNotification", checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2073,7 +2073,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SettingsData.soundVolumeChanged
|
||||
onToggled: checked => {
|
||||
SettingsData.setSoundVolumeChanged(checked)
|
||||
SettingsData.set("soundVolumeChanged", checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2108,7 +2108,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SettingsData.soundPluggedIn
|
||||
onToggled: checked => {
|
||||
SettingsData.setSoundPluggedIn(checked)
|
||||
SettingsData.set("soundPluggedIn", checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -770,7 +770,7 @@ Item {
|
||||
wheelEnabled: false
|
||||
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
onSliderValueChanged: newValue => {
|
||||
SettingsData.setDankBarTransparency(
|
||||
SettingsData.set("dankBarTransparency",
|
||||
newValue / 100)
|
||||
}
|
||||
}
|
||||
@@ -835,7 +835,7 @@ Item {
|
||||
onSelectionChanged: (index, selected) => {
|
||||
if (!selected) return
|
||||
const colorOptions = ["sth", "s", "sc", "sch"]
|
||||
SettingsData.setWidgetBackgroundColor(colorOptions[index])
|
||||
SettingsData.set("widgetBackgroundColor", colorOptions[index])
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -852,7 +852,7 @@ Item {
|
||||
wheelEnabled: false
|
||||
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
onSliderValueChanged: newValue => {
|
||||
SettingsData.setDankBarWidgetTransparency(
|
||||
SettingsData.set("dankBarWidgetTransparency",
|
||||
newValue / 100)
|
||||
}
|
||||
}
|
||||
@@ -889,7 +889,7 @@ Item {
|
||||
wheelEnabled: false
|
||||
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
onSliderValueChanged: newValue => {
|
||||
SettingsData.setPopupTransparency(
|
||||
SettingsData.set("popupTransparency",
|
||||
newValue / 100)
|
||||
}
|
||||
}
|
||||
@@ -968,7 +968,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SettingsData.modalDarkenBackground
|
||||
onToggled: checked => {
|
||||
SettingsData.setModalDarkenBackground(checked)
|
||||
SettingsData.set("modalDarkenBackground", checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1026,9 +1026,9 @@ Item {
|
||||
options: cachedFontFamilies
|
||||
onValueChanged: value => {
|
||||
if (value.startsWith("Default"))
|
||||
SettingsData.setFontFamily(SettingsData.defaultFontFamily)
|
||||
SettingsData.set("fontFamily", SettingsData.defaultFontFamily)
|
||||
else
|
||||
SettingsData.setFontFamily(value)
|
||||
SettingsData.set("fontFamily", value)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1094,7 +1094,7 @@ Item {
|
||||
weight = Font.Normal
|
||||
break
|
||||
}
|
||||
SettingsData.setFontWeight(weight)
|
||||
SettingsData.set("fontWeight", weight)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1113,9 +1113,9 @@ Item {
|
||||
options: cachedMonoFamilies
|
||||
onValueChanged: value => {
|
||||
if (value === "Default")
|
||||
SettingsData.setMonoFontFamily(SettingsData.defaultMonoFontFamily)
|
||||
SettingsData.set("monoFontFamily", SettingsData.defaultMonoFontFamily)
|
||||
else
|
||||
SettingsData.setMonoFontFamily(value)
|
||||
SettingsData.set("monoFontFamily", value)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1165,7 +1165,7 @@ Item {
|
||||
iconColor: Theme.surfaceText
|
||||
onClicked: {
|
||||
var newScale = Math.max(1.0, SettingsData.fontScale - 0.05)
|
||||
SettingsData.setFontScale(newScale)
|
||||
SettingsData.set("fontScale", newScale)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1199,7 +1199,7 @@ Item {
|
||||
onClicked: {
|
||||
var newScale = Math.min(2.0,
|
||||
SettingsData.fontScale + 0.05)
|
||||
SettingsData.setFontScale(newScale)
|
||||
SettingsData.set("fontScale", newScale)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1258,7 +1258,7 @@ Item {
|
||||
height: 32
|
||||
checked: SettingsData.syncModeWithPortal
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
onToggled: checked => SettingsData.setSyncModeWithPortal(checked)
|
||||
onToggled: checked => SettingsData.set("syncModeWithPortal", checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1499,7 +1499,7 @@ Item {
|
||||
onFileSelected: function(filePath) {
|
||||
// Save the custom theme file path and switch to custom theme
|
||||
if (filePath.endsWith(".json")) {
|
||||
SettingsData.setCustomThemeFile(filePath)
|
||||
SettingsData.set("customThemeFile", filePath)
|
||||
Theme.switchTheme("custom")
|
||||
close()
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SettingsData.use24HourClock
|
||||
onToggled: checked => {
|
||||
return SettingsData.setClockFormat(
|
||||
return SettingsData.set("clockFormat",
|
||||
checked)
|
||||
}
|
||||
}
|
||||
@@ -140,7 +140,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SettingsData.showSeconds
|
||||
onToggled: checked => {
|
||||
return SettingsData.setTimeFormat(
|
||||
return SettingsData.set("timeFormat",
|
||||
checked)
|
||||
}
|
||||
}
|
||||
@@ -240,7 +240,7 @@ Item {
|
||||
customFormatInput.visible = true
|
||||
} else {
|
||||
customFormatInput.visible = false
|
||||
SettingsData.setClockDateFormat(
|
||||
SettingsData.set("clockDateFormat",
|
||||
formatMap[value])
|
||||
}
|
||||
}
|
||||
@@ -302,7 +302,7 @@ Item {
|
||||
customLockFormatInput.visible = true
|
||||
} else {
|
||||
customLockFormatInput.visible = false
|
||||
SettingsData.setLockDateFormat(
|
||||
SettingsData.set("lockDateFormat",
|
||||
formatMap[value])
|
||||
}
|
||||
}
|
||||
@@ -317,7 +317,7 @@ Item {
|
||||
text: SettingsData.clockDateFormat
|
||||
onTextChanged: {
|
||||
if (visible && text)
|
||||
SettingsData.setClockDateFormat(text)
|
||||
SettingsData.set("clockDateFormat", text)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -330,7 +330,7 @@ Item {
|
||||
text: SettingsData.lockDateFormat
|
||||
onTextChanged: {
|
||||
if (visible && text)
|
||||
SettingsData.setLockDateFormat(text)
|
||||
SettingsData.set("lockDateFormat", text)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -491,7 +491,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SettingsData.weatherEnabled
|
||||
onToggled: checked => {
|
||||
return SettingsData.setWeatherEnabled(
|
||||
return SettingsData.set("weatherEnabled",
|
||||
checked)
|
||||
}
|
||||
}
|
||||
@@ -556,7 +556,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SettingsData.useFahrenheit
|
||||
onToggled: checked => {
|
||||
return SettingsData.setTemperatureUnit(
|
||||
return SettingsData.set("temperatureUnit",
|
||||
checked)
|
||||
}
|
||||
}
|
||||
@@ -628,7 +628,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SettingsData.useAutoLocation
|
||||
onToggled: checked => {
|
||||
return SettingsData.setAutoLocation(
|
||||
return SettingsData.set("autoLocation",
|
||||
checked)
|
||||
}
|
||||
}
|
||||
@@ -966,7 +966,7 @@ Item {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
if (WeatherService.weather.available) {
|
||||
SettingsData.setTemperatureUnit(!SettingsData.useFahrenheit)
|
||||
SettingsData.set("temperatureUnit", !SettingsData.useFahrenheit)
|
||||
}
|
||||
}
|
||||
enabled: WeatherService.weather.available
|
||||
|
||||
@@ -61,7 +61,7 @@ Item {
|
||||
description: I18n.tr("Show workspace index numbers in the top bar workspace switcher")
|
||||
checked: SettingsData.showWorkspaceIndex
|
||||
onToggled: checked => {
|
||||
return SettingsData.setShowWorkspaceIndex(
|
||||
return SettingsData.set("showWorkspaceIndex",
|
||||
checked)
|
||||
}
|
||||
}
|
||||
@@ -71,7 +71,7 @@ Item {
|
||||
description: I18n.tr("Always show a minimum of 3 workspaces, even if fewer are available")
|
||||
checked: SettingsData.showWorkspacePadding
|
||||
onToggled: checked => {
|
||||
return SettingsData.setShowWorkspacePadding(
|
||||
return SettingsData.set("showWorkspacePadding",
|
||||
checked)
|
||||
}
|
||||
}
|
||||
@@ -82,7 +82,7 @@ Item {
|
||||
description: I18n.tr("Display application icons in workspace indicators")
|
||||
checked: SettingsData.showWorkspaceApps
|
||||
onToggled: checked => {
|
||||
return SettingsData.setShowWorkspaceApps(
|
||||
return SettingsData.set("showWorkspaceApps",
|
||||
checked)
|
||||
}
|
||||
}
|
||||
@@ -116,7 +116,7 @@ Item {
|
||||
topPadding: Theme.spacingXS
|
||||
bottomPadding: Theme.spacingXS
|
||||
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.")
|
||||
checked: SettingsData.workspacesPerMonitor
|
||||
onToggled: checked => {
|
||||
return SettingsData.setWorkspacesPerMonitor(checked);
|
||||
return SettingsData.set("workspacesPerMonitor", checked);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ Item {
|
||||
checked: SettingsData.dwlShowAllTags
|
||||
visible: CompositorService.isDwl
|
||||
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")
|
||||
checked: SettingsData.waveProgressEnabled
|
||||
onToggled: checked => {
|
||||
return SettingsData.setWaveProgressEnabled(checked);
|
||||
return SettingsData.set("waveProgressEnabled", checked);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -244,10 +244,10 @@ Item {
|
||||
if (!checked) {
|
||||
updaterCustomCommand.text = "";
|
||||
updaterTerminalCustomClass.text = "";
|
||||
SettingsData.setUpdaterCustomCommand("");
|
||||
SettingsData.setUpdaterTerminalAdditionalParams("");
|
||||
SettingsData.set("updaterCustomCommand", "");
|
||||
SettingsData.set("updaterTerminalAdditionalParams", "");
|
||||
}
|
||||
return SettingsData.setUpdaterUseCustomCommandEnabled(checked);
|
||||
return SettingsData.set("updaterUseCustomCommandEnabled", checked);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ Item {
|
||||
}
|
||||
|
||||
onTextEdited: {
|
||||
SettingsData.setUpdaterCustomCommand(text.trim());
|
||||
SettingsData.set("updaterCustomCommand", text.trim());
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
@@ -331,7 +331,7 @@ Item {
|
||||
}
|
||||
|
||||
onTextEdited: {
|
||||
SettingsData.setUpdaterTerminalAdditionalParams(text.trim());
|
||||
SettingsData.set("updaterTerminalAdditionalParams", text.trim());
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
@@ -389,7 +389,7 @@ Item {
|
||||
description: I18n.tr("Show only apps running in current workspace")
|
||||
checked: SettingsData.runningAppsCurrentWorkspace
|
||||
onToggled: checked => {
|
||||
return SettingsData.setRunningAppsCurrentWorkspace(
|
||||
return SettingsData.set("runningAppsCurrentWorkspace",
|
||||
checked)
|
||||
}
|
||||
}
|
||||
@@ -621,19 +621,19 @@ Item {
|
||||
onValueChanged: value => {
|
||||
switch (value) {
|
||||
case "Top Right":
|
||||
SettingsData.setNotificationPopupPosition(SettingsData.Position.Top)
|
||||
SettingsData.set("notificationPopupPosition", SettingsData.Position.Top)
|
||||
break
|
||||
case "Top Left":
|
||||
SettingsData.setNotificationPopupPosition(SettingsData.Position.Left)
|
||||
SettingsData.set("notificationPopupPosition", SettingsData.Position.Left)
|
||||
break
|
||||
case "Top Center":
|
||||
SettingsData.setNotificationPopupPosition(-1)
|
||||
SettingsData.set("notificationPopupPosition", -1)
|
||||
break
|
||||
case "Bottom Right":
|
||||
SettingsData.setNotificationPopupPosition(SettingsData.Position.Right)
|
||||
SettingsData.set("notificationPopupPosition", SettingsData.Position.Right)
|
||||
break
|
||||
case "Bottom Left":
|
||||
SettingsData.setNotificationPopupPosition(SettingsData.Position.Bottom)
|
||||
SettingsData.set("notificationPopupPosition", SettingsData.Position.Bottom)
|
||||
break
|
||||
}
|
||||
SettingsData.sendTestNotifications()
|
||||
@@ -693,7 +693,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SettingsData.osdAlwaysShowValue
|
||||
onToggleCompleted: checked => {
|
||||
SettingsData.setOsdAlwaysShowValue(checked)
|
||||
SettingsData.set("osdAlwaysShowValue", checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -483,7 +483,7 @@ Column {
|
||||
iconSize: 16
|
||||
iconColor: SettingsData.runningAppsGroupByApp ? Theme.primary : Theme.outline
|
||||
onClicked: {
|
||||
SettingsData.setRunningAppsGroupByApp(!SettingsData.runningAppsGroupByApp)
|
||||
SettingsData.set("runningAppsGroupByApp", !SettingsData.runningAppsGroupByApp)
|
||||
}
|
||||
onEntered: {
|
||||
groupByAppTooltipLoader.active = true
|
||||
|
||||
@@ -280,7 +280,7 @@ Singleton {
|
||||
|
||||
if (vpnConnected && activeUuid) {
|
||||
lastConnectedVpnUuid = activeUuid
|
||||
SettingsData.setVpnLastConnected(activeUuid)
|
||||
SettingsData.set("vpnLastConnected", activeUuid)
|
||||
}
|
||||
|
||||
if (vpnIsBusy) {
|
||||
@@ -558,7 +558,7 @@ Singleton {
|
||||
userPreference = preference
|
||||
changingPreference = true
|
||||
targetPreference = preference
|
||||
SettingsData.setNetworkPreference(preference)
|
||||
SettingsData.set("networkPreference", preference)
|
||||
|
||||
DMSService.sendRequest("network.preference.set", { preference: preference }, response => {
|
||||
changingPreference = false
|
||||
|
||||
@@ -764,7 +764,7 @@ Singleton {
|
||||
root.userPreference = preference
|
||||
root.changingPreference = true
|
||||
root.targetPreference = preference
|
||||
SettingsData.setNetworkPreference(preference)
|
||||
SettingsData.set("networkPreference", preference)
|
||||
|
||||
if (preference === "wifi") {
|
||||
setConnectionPriority("wifi")
|
||||
|
||||
Reference in New Issue
Block a user