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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user