mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-28 07:22:50 -05:00
settings: refactor for maintainability
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user