mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -05:00
wallpaper: fix per-monitor dankdash tab + allow matugen override
per-monitor fixes #561
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
pragma Singleton
|
pragma Singleton
|
||||||
|
|
||||||
pragma ComponentBehavior: Bound
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
import QtCore
|
import QtCore
|
||||||
@@ -151,7 +152,8 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function saveSettings() {
|
function saveSettings() {
|
||||||
if (isGreeterMode) return
|
if (isGreeterMode)
|
||||||
|
return
|
||||||
settingsFile.setText(JSON.stringify({
|
settingsFile.setText(JSON.stringify({
|
||||||
"isLightMode": isLightMode,
|
"isLightMode": isLightMode,
|
||||||
"wallpaperPath": wallpaperPath,
|
"wallpaperPath": wallpaperPath,
|
||||||
@@ -244,23 +246,12 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cleanupUnusedKeys() {
|
function cleanupUnusedKeys() {
|
||||||
const validKeys = [
|
const validKeys = ["isLightMode", "wallpaperPath", "perMonitorWallpaper", "monitorWallpapers", "perModeWallpaper", "wallpaperPathLight", "wallpaperPathDark", "monitorWallpapersLight", "monitorWallpapersDark", "doNotDisturb", "nightModeEnabled", "nightModeTemperature", "nightModeAutoEnabled", "nightModeAutoMode", "nightModeStartHour", "nightModeStartMinute", "nightModeEndHour", "nightModeEndMinute", "latitude", "longitude", "nightModeUseIPLocation", "nightModeLocationProvider", "pinnedApps", "selectedGpuIndex", "nvidiaGpuTempEnabled", "nonNvidiaGpuTempEnabled", "enabledGpuPciIds", "wallpaperCyclingEnabled", "wallpaperCyclingMode", "wallpaperCyclingInterval", "wallpaperCyclingTime", "monitorCyclingSettings", "lastBrightnessDevice", "launchPrefix", "wallpaperTransition", "includedTransitions", "recentColors", "showThirdPartyPlugins", "configVersion"]
|
||||||
"isLightMode", "wallpaperPath", "perMonitorWallpaper", "monitorWallpapers", "perModeWallpaper",
|
|
||||||
"wallpaperPathLight", "wallpaperPathDark", "monitorWallpapersLight",
|
|
||||||
"monitorWallpapersDark", "doNotDisturb", "nightModeEnabled",
|
|
||||||
"nightModeTemperature", "nightModeAutoEnabled", "nightModeAutoMode",
|
|
||||||
"nightModeStartHour", "nightModeStartMinute", "nightModeEndHour",
|
|
||||||
"nightModeEndMinute", "latitude", "longitude", "nightModeUseIPLocation", "nightModeLocationProvider",
|
|
||||||
"pinnedApps", "selectedGpuIndex", "nvidiaGpuTempEnabled",
|
|
||||||
"nonNvidiaGpuTempEnabled", "enabledGpuPciIds", "wallpaperCyclingEnabled",
|
|
||||||
"wallpaperCyclingMode", "wallpaperCyclingInterval", "wallpaperCyclingTime",
|
|
||||||
"monitorCyclingSettings", "lastBrightnessDevice", "launchPrefix", "wallpaperTransition",
|
|
||||||
"includedTransitions", "recentColors", "showThirdPartyPlugins", "configVersion"
|
|
||||||
]
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const content = settingsFile.text()
|
const content = settingsFile.text()
|
||||||
if (!content || !content.trim()) return
|
if (!content || !content.trim())
|
||||||
|
return
|
||||||
|
|
||||||
const settings = JSON.parse(content)
|
const settings = JSON.parse(content)
|
||||||
let needsSave = false
|
let needsSave = false
|
||||||
@@ -425,10 +416,13 @@ Singleton {
|
|||||||
|
|
||||||
saveSettings()
|
saveSettings()
|
||||||
|
|
||||||
if (typeof Theme !== "undefined" && typeof Quickshell !== "undefined") {
|
if (typeof Theme !== "undefined" && typeof Quickshell !== "undefined" && typeof SettingsData !== "undefined") {
|
||||||
var screens = Quickshell.screens
|
var screens = Quickshell.screens
|
||||||
if (screens.length > 0 && screenName === screens[0].name) {
|
if (screens.length > 0) {
|
||||||
Theme.generateSystemThemesFromCurrentTheme()
|
var targetMonitor = (SettingsData.matugenTargetMonitor && SettingsData.matugenTargetMonitor !== "") ? SettingsData.matugenTargetMonitor : screens[0].name
|
||||||
|
if (screenName === targetMonitor) {
|
||||||
|
Theme.generateSystemThemesFromCurrentTheme()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -461,7 +455,12 @@ Singleton {
|
|||||||
function setMonitorCyclingEnabled(screenName, enabled) {
|
function setMonitorCyclingEnabled(screenName, enabled) {
|
||||||
var newSettings = Object.assign({}, monitorCyclingSettings)
|
var newSettings = Object.assign({}, monitorCyclingSettings)
|
||||||
if (!newSettings[screenName]) {
|
if (!newSettings[screenName]) {
|
||||||
newSettings[screenName] = { enabled: false, mode: "interval", interval: 300, time: "06:00" }
|
newSettings[screenName] = {
|
||||||
|
"enabled": false,
|
||||||
|
"mode": "interval",
|
||||||
|
"interval": 300,
|
||||||
|
"time": "06:00"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
newSettings[screenName].enabled = enabled
|
newSettings[screenName].enabled = enabled
|
||||||
monitorCyclingSettings = newSettings
|
monitorCyclingSettings = newSettings
|
||||||
@@ -471,7 +470,12 @@ Singleton {
|
|||||||
function setMonitorCyclingMode(screenName, mode) {
|
function setMonitorCyclingMode(screenName, mode) {
|
||||||
var newSettings = Object.assign({}, monitorCyclingSettings)
|
var newSettings = Object.assign({}, monitorCyclingSettings)
|
||||||
if (!newSettings[screenName]) {
|
if (!newSettings[screenName]) {
|
||||||
newSettings[screenName] = { enabled: false, mode: "interval", interval: 300, time: "06:00" }
|
newSettings[screenName] = {
|
||||||
|
"enabled": false,
|
||||||
|
"mode": "interval",
|
||||||
|
"interval": 300,
|
||||||
|
"time": "06:00"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
newSettings[screenName].mode = mode
|
newSettings[screenName].mode = mode
|
||||||
monitorCyclingSettings = newSettings
|
monitorCyclingSettings = newSettings
|
||||||
@@ -481,7 +485,12 @@ Singleton {
|
|||||||
function setMonitorCyclingInterval(screenName, interval) {
|
function setMonitorCyclingInterval(screenName, interval) {
|
||||||
var newSettings = Object.assign({}, monitorCyclingSettings)
|
var newSettings = Object.assign({}, monitorCyclingSettings)
|
||||||
if (!newSettings[screenName]) {
|
if (!newSettings[screenName]) {
|
||||||
newSettings[screenName] = { enabled: false, mode: "interval", interval: 300, time: "06:00" }
|
newSettings[screenName] = {
|
||||||
|
"enabled": false,
|
||||||
|
"mode": "interval",
|
||||||
|
"interval": 300,
|
||||||
|
"time": "06:00"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
newSettings[screenName].interval = interval
|
newSettings[screenName].interval = interval
|
||||||
monitorCyclingSettings = newSettings
|
monitorCyclingSettings = newSettings
|
||||||
@@ -491,7 +500,12 @@ Singleton {
|
|||||||
function setMonitorCyclingTime(screenName, time) {
|
function setMonitorCyclingTime(screenName, time) {
|
||||||
var newSettings = Object.assign({}, monitorCyclingSettings)
|
var newSettings = Object.assign({}, monitorCyclingSettings)
|
||||||
if (!newSettings[screenName]) {
|
if (!newSettings[screenName]) {
|
||||||
newSettings[screenName] = { enabled: false, mode: "interval", interval: 300, time: "06:00" }
|
newSettings[screenName] = {
|
||||||
|
"enabled": false,
|
||||||
|
"mode": "interval",
|
||||||
|
"interval": 300,
|
||||||
|
"time": "06:00"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
newSettings[screenName].time = time
|
newSettings[screenName].time = time
|
||||||
monitorCyclingSettings = newSettings
|
monitorCyclingSettings = newSettings
|
||||||
@@ -592,7 +606,8 @@ Singleton {
|
|||||||
let recent = recentColors.slice()
|
let recent = recentColors.slice()
|
||||||
recent = recent.filter(c => c !== colorStr)
|
recent = recent.filter(c => c !== colorStr)
|
||||||
recent.unshift(colorStr)
|
recent.unshift(colorStr)
|
||||||
if (recent.length > 5) recent = recent.slice(0, 5)
|
if (recent.length > 5)
|
||||||
|
recent = recent.slice(0, 5)
|
||||||
recentColors = recent
|
recentColors = recent
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
@@ -633,7 +648,8 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function syncWallpaperForCurrentMode() {
|
function syncWallpaperForCurrentMode() {
|
||||||
if (!perModeWallpaper) return
|
if (!perModeWallpaper)
|
||||||
|
return
|
||||||
|
|
||||||
if (perMonitorWallpaper) {
|
if (perMonitorWallpaper) {
|
||||||
monitorWallpapers = isLightMode ? Object.assign({}, monitorWallpapersLight) : Object.assign({}, monitorWallpapersDark)
|
monitorWallpapers = isLightMode ? Object.assign({}, monitorWallpapersLight) : Object.assign({}, monitorWallpapersDark)
|
||||||
@@ -652,10 +668,10 @@ Singleton {
|
|||||||
|
|
||||||
function getMonitorCyclingSettings(screenName) {
|
function getMonitorCyclingSettings(screenName) {
|
||||||
return monitorCyclingSettings[screenName] || {
|
return monitorCyclingSettings[screenName] || {
|
||||||
enabled: false,
|
"enabled": false,
|
||||||
mode: "interval",
|
"mode": "interval",
|
||||||
interval: 300,
|
"interval": 300,
|
||||||
time: "06:00"
|
"time": "06:00"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ Singleton {
|
|||||||
property string customThemeFile: ""
|
property string customThemeFile: ""
|
||||||
property string matugenScheme: "scheme-tonal-spot"
|
property string matugenScheme: "scheme-tonal-spot"
|
||||||
property bool runUserMatugenTemplates: true
|
property bool runUserMatugenTemplates: true
|
||||||
|
property string matugenTargetMonitor: ""
|
||||||
property real dankBarTransparency: 1.0
|
property real dankBarTransparency: 1.0
|
||||||
property real dankBarWidgetTransparency: 1.0
|
property real dankBarWidgetTransparency: 1.0
|
||||||
property real popupTransparency: 1.0
|
property real popupTransparency: 1.0
|
||||||
@@ -90,16 +91,39 @@ Singleton {
|
|||||||
property bool controlCenterShowNetworkIcon: true
|
property bool controlCenterShowNetworkIcon: true
|
||||||
property bool controlCenterShowBluetoothIcon: true
|
property bool controlCenterShowBluetoothIcon: true
|
||||||
property bool controlCenterShowAudioIcon: true
|
property bool controlCenterShowAudioIcon: true
|
||||||
property var controlCenterWidgets: [
|
property var controlCenterWidgets: [{
|
||||||
{"id": "volumeSlider", "enabled": true, "width": 50},
|
"id": "volumeSlider",
|
||||||
{"id": "brightnessSlider", "enabled": true, "width": 50},
|
"enabled": true,
|
||||||
{"id": "wifi", "enabled": true, "width": 50},
|
"width": 50
|
||||||
{"id": "bluetooth", "enabled": true, "width": 50},
|
}, {
|
||||||
{"id": "audioOutput", "enabled": true, "width": 50},
|
"id": "brightnessSlider",
|
||||||
{"id": "audioInput", "enabled": true, "width": 50},
|
"enabled": true,
|
||||||
{"id": "nightMode", "enabled": true, "width": 50},
|
"width": 50
|
||||||
{"id": "darkMode", "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
|
||||||
|
}]
|
||||||
|
|
||||||
property bool showWorkspaceIndex: false
|
property bool showWorkspaceIndex: false
|
||||||
property bool showWorkspacePadding: false
|
property bool showWorkspacePadding: false
|
||||||
@@ -331,8 +355,14 @@ Singleton {
|
|||||||
customThemeFile = settings.customThemeFile !== undefined ? settings.customThemeFile : ""
|
customThemeFile = settings.customThemeFile !== undefined ? settings.customThemeFile : ""
|
||||||
matugenScheme = settings.matugenScheme !== undefined ? settings.matugenScheme : "scheme-tonal-spot"
|
matugenScheme = settings.matugenScheme !== undefined ? settings.matugenScheme : "scheme-tonal-spot"
|
||||||
runUserMatugenTemplates = settings.runUserMatugenTemplates !== undefined ? settings.runUserMatugenTemplates : true
|
runUserMatugenTemplates = settings.runUserMatugenTemplates !== undefined ? settings.runUserMatugenTemplates : true
|
||||||
dankBarTransparency = settings.dankBarTransparency !== undefined ? (settings.dankBarTransparency > 1 ? settings.dankBarTransparency / 100 : settings.dankBarTransparency) : (settings.topBarTransparency !== undefined ? (settings.topBarTransparency > 1 ? settings.topBarTransparency / 100 : settings.topBarTransparency) : 1.0)
|
matugenTargetMonitor = settings.matugenTargetMonitor !== undefined ? settings.matugenTargetMonitor : ""
|
||||||
dankBarWidgetTransparency = settings.dankBarWidgetTransparency !== undefined ? (settings.dankBarWidgetTransparency > 1 ? settings.dankBarWidgetTransparency / 100 : settings.dankBarWidgetTransparency) : (settings.topBarWidgetTransparency !== undefined ? (settings.topBarWidgetTransparency > 1 ? settings.topBarWidgetTransparency / 100 : settings.topBarWidgetTransparency) : 1.0)
|
dankBarTransparency = settings.dankBarTransparency
|
||||||
|
!== undefined ? (settings.dankBarTransparency > 1 ? settings.dankBarTransparency
|
||||||
|
/ 100 : settings.dankBarTransparency) : (settings.topBarTransparency !== undefined ? (settings.topBarTransparency > 1 ? settings.topBarTransparency / 100 : settings.topBarTransparency) : 1.0)
|
||||||
|
dankBarWidgetTransparency = settings.dankBarWidgetTransparency
|
||||||
|
!== undefined ? (settings.dankBarWidgetTransparency
|
||||||
|
> 1 ? settings.dankBarWidgetTransparency
|
||||||
|
/ 100 : settings.dankBarWidgetTransparency) : (settings.topBarWidgetTransparency !== undefined ? (settings.topBarWidgetTransparency > 1 ? settings.topBarWidgetTransparency / 100 : settings.topBarWidgetTransparency) : 1.0)
|
||||||
popupTransparency = settings.popupTransparency !== undefined ? (settings.popupTransparency > 1 ? settings.popupTransparency / 100 : settings.popupTransparency) : 1.0
|
popupTransparency = settings.popupTransparency !== undefined ? (settings.popupTransparency > 1 ? settings.popupTransparency / 100 : settings.popupTransparency) : 1.0
|
||||||
dockTransparency = settings.dockTransparency !== undefined ? (settings.dockTransparency > 1 ? settings.dockTransparency / 100 : settings.dockTransparency) : 1
|
dockTransparency = settings.dockTransparency !== undefined ? (settings.dockTransparency > 1 ? settings.dockTransparency / 100 : settings.dockTransparency) : 1
|
||||||
use24HourClock = settings.use24HourClock !== undefined ? settings.use24HourClock : true
|
use24HourClock = settings.use24HourClock !== undefined ? settings.use24HourClock : true
|
||||||
@@ -363,16 +393,39 @@ Singleton {
|
|||||||
controlCenterShowNetworkIcon = settings.controlCenterShowNetworkIcon !== undefined ? settings.controlCenterShowNetworkIcon : true
|
controlCenterShowNetworkIcon = settings.controlCenterShowNetworkIcon !== undefined ? settings.controlCenterShowNetworkIcon : true
|
||||||
controlCenterShowBluetoothIcon = settings.controlCenterShowBluetoothIcon !== undefined ? settings.controlCenterShowBluetoothIcon : true
|
controlCenterShowBluetoothIcon = settings.controlCenterShowBluetoothIcon !== undefined ? settings.controlCenterShowBluetoothIcon : true
|
||||||
controlCenterShowAudioIcon = settings.controlCenterShowAudioIcon !== undefined ? settings.controlCenterShowAudioIcon : true
|
controlCenterShowAudioIcon = settings.controlCenterShowAudioIcon !== undefined ? settings.controlCenterShowAudioIcon : true
|
||||||
controlCenterWidgets = settings.controlCenterWidgets !== undefined ? settings.controlCenterWidgets : [
|
controlCenterWidgets = settings.controlCenterWidgets !== undefined ? settings.controlCenterWidgets : [{
|
||||||
{"id": "volumeSlider", "enabled": true, "width": 50},
|
"id": "volumeSlider",
|
||||||
{"id": "brightnessSlider", "enabled": true, "width": 50},
|
"enabled": true,
|
||||||
{"id": "wifi", "enabled": true, "width": 50},
|
"width": 50
|
||||||
{"id": "bluetooth", "enabled": true, "width": 50},
|
}, {
|
||||||
{"id": "audioOutput", "enabled": true, "width": 50},
|
"id": "brightnessSlider",
|
||||||
{"id": "audioInput", "enabled": true, "width": 50},
|
"enabled": true,
|
||||||
{"id": "nightMode", "enabled": true, "width": 50},
|
"width": 50
|
||||||
{"id": "darkMode", "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 = settings.showWorkspaceIndex !== undefined ? settings.showWorkspaceIndex : false
|
showWorkspaceIndex = settings.showWorkspaceIndex !== undefined ? settings.showWorkspaceIndex : false
|
||||||
showWorkspacePadding = settings.showWorkspacePadding !== undefined ? settings.showWorkspacePadding : false
|
showWorkspacePadding = settings.showWorkspacePadding !== undefined ? settings.showWorkspacePadding : false
|
||||||
workspaceScrolling = settings.workspaceScrolling !== undefined ? settings.workspaceScrolling : false
|
workspaceScrolling = settings.workspaceScrolling !== undefined ? settings.workspaceScrolling : false
|
||||||
@@ -393,18 +446,19 @@ Singleton {
|
|||||||
if (settings.dankBarWidgetOrder || settings.topBarWidgetOrder) {
|
if (settings.dankBarWidgetOrder || settings.topBarWidgetOrder) {
|
||||||
var widgetOrder = settings.dankBarWidgetOrder || settings.topBarWidgetOrder
|
var widgetOrder = settings.dankBarWidgetOrder || settings.topBarWidgetOrder
|
||||||
dankBarLeftWidgets = widgetOrder.filter(w => {
|
dankBarLeftWidgets = widgetOrder.filter(w => {
|
||||||
return ["launcherButton", "workspaceSwitcher", "focusedWindow"].includes(w)
|
return ["launcherButton", "workspaceSwitcher", "focusedWindow"].includes(w)
|
||||||
})
|
})
|
||||||
dankBarCenterWidgets = widgetOrder.filter(w => {
|
dankBarCenterWidgets = widgetOrder.filter(w => {
|
||||||
return ["clock", "music", "weather"].includes(w)
|
return ["clock", "music", "weather"].includes(w)
|
||||||
})
|
})
|
||||||
dankBarRightWidgets = widgetOrder.filter(w => {
|
dankBarRightWidgets = widgetOrder.filter(w => {
|
||||||
return ["systemTray", "clipboard", "systemResources", "notificationButton", "battery", "controlCenterButton"].includes(w)
|
return ["systemTray", "clipboard", "systemResources", "notificationButton", "battery", "controlCenterButton"].includes(w)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
var leftWidgets = settings.dankBarLeftWidgets !== undefined ? settings.dankBarLeftWidgets : (settings.topBarLeftWidgets !== undefined ? settings.topBarLeftWidgets : ["launcherButton", "workspaceSwitcher", "focusedWindow"])
|
var leftWidgets = settings.dankBarLeftWidgets !== undefined ? settings.dankBarLeftWidgets : (settings.topBarLeftWidgets !== undefined ? settings.topBarLeftWidgets : ["launcherButton", "workspaceSwitcher", "focusedWindow"])
|
||||||
var centerWidgets = settings.dankBarCenterWidgets !== undefined ? settings.dankBarCenterWidgets : (settings.topBarCenterWidgets !== undefined ? settings.topBarCenterWidgets : ["music", "clock", "weather"])
|
var centerWidgets = settings.dankBarCenterWidgets !== undefined ? settings.dankBarCenterWidgets : (settings.topBarCenterWidgets !== undefined ? settings.topBarCenterWidgets : ["music", "clock", "weather"])
|
||||||
var rightWidgets = settings.dankBarRightWidgets !== undefined ? settings.dankBarRightWidgets : (settings.topBarRightWidgets !== undefined ? settings.topBarRightWidgets : ["systemTray", "clipboard", "cpuUsage", "memUsage", "notificationButton", "battery", "controlCenterButton"])
|
var rightWidgets = settings.dankBarRightWidgets
|
||||||
|
!== undefined ? settings.dankBarRightWidgets : (settings.topBarRightWidgets !== undefined ? settings.topBarRightWidgets : ["systemTray", "clipboard", "cpuUsage", "memUsage", "notificationButton", "battery", "controlCenterButton"])
|
||||||
dankBarLeftWidgets = leftWidgets
|
dankBarLeftWidgets = leftWidgets
|
||||||
dankBarCenterWidgets = centerWidgets
|
dankBarCenterWidgets = centerWidgets
|
||||||
dankBarRightWidgets = rightWidgets
|
dankBarRightWidgets = rightWidgets
|
||||||
@@ -476,9 +530,9 @@ Singleton {
|
|||||||
customPowerActionHibernate = settings.customPowerActionHibernate != undefined ? settings.customPowerActionHibernate : ""
|
customPowerActionHibernate = settings.customPowerActionHibernate != undefined ? settings.customPowerActionHibernate : ""
|
||||||
customPowerActionReboot = settings.customPowerActionReboot != undefined ? settings.customPowerActionReboot : ""
|
customPowerActionReboot = settings.customPowerActionReboot != undefined ? settings.customPowerActionReboot : ""
|
||||||
customPowerActionPowerOff = settings.customPowerActionPowerOff != undefined ? settings.customPowerActionPowerOff : ""
|
customPowerActionPowerOff = settings.customPowerActionPowerOff != undefined ? settings.customPowerActionPowerOff : ""
|
||||||
updaterUseCustomCommand = settings.updaterUseCustomCommand !== undefined ? settings.updaterUseCustomCommand : false;
|
updaterUseCustomCommand = settings.updaterUseCustomCommand !== undefined ? settings.updaterUseCustomCommand : false
|
||||||
updaterCustomCommand = settings.updaterCustomCommand !== undefined ? settings.updaterCustomCommand : "";
|
updaterCustomCommand = settings.updaterCustomCommand !== undefined ? settings.updaterCustomCommand : ""
|
||||||
updaterTerminalAdditionalParams = settings.updaterTerminalAdditionalParams !== undefined ? settings.updaterTerminalAdditionalParams : "";
|
updaterTerminalAdditionalParams = settings.updaterTerminalAdditionalParams !== undefined ? settings.updaterTerminalAdditionalParams : ""
|
||||||
dankBarSpacing = settings.dankBarSpacing !== undefined ? settings.dankBarSpacing : (settings.topBarSpacing !== undefined ? settings.topBarSpacing : 4)
|
dankBarSpacing = settings.dankBarSpacing !== undefined ? settings.dankBarSpacing : (settings.topBarSpacing !== undefined ? settings.topBarSpacing : 4)
|
||||||
dankBarBottomGap = settings.dankBarBottomGap !== undefined ? settings.dankBarBottomGap : (settings.topBarBottomGap !== undefined ? settings.topBarBottomGap : 0)
|
dankBarBottomGap = settings.dankBarBottomGap !== undefined ? settings.dankBarBottomGap : (settings.topBarBottomGap !== undefined ? settings.topBarBottomGap : 0)
|
||||||
dankBarInnerPadding = settings.dankBarInnerPadding !== undefined ? settings.dankBarInnerPadding : (settings.topBarInnerPadding !== undefined ? settings.topBarInnerPadding : 4)
|
dankBarInnerPadding = settings.dankBarInnerPadding !== undefined ? settings.dankBarInnerPadding : (settings.topBarInnerPadding !== undefined ? settings.topBarInnerPadding : 4)
|
||||||
@@ -491,7 +545,8 @@ Singleton {
|
|||||||
dankBarBorderThickness = settings.dankBarBorderThickness !== undefined ? settings.dankBarBorderThickness : 1
|
dankBarBorderThickness = settings.dankBarBorderThickness !== undefined ? settings.dankBarBorderThickness : 1
|
||||||
popupGapsAuto = settings.popupGapsAuto !== undefined ? settings.popupGapsAuto : true
|
popupGapsAuto = settings.popupGapsAuto !== undefined ? settings.popupGapsAuto : true
|
||||||
popupGapsManual = settings.popupGapsManual !== undefined ? settings.popupGapsManual : 4
|
popupGapsManual = settings.popupGapsManual !== undefined ? settings.popupGapsManual : 4
|
||||||
dankBarPosition = settings.dankBarPosition !== undefined ? settings.dankBarPosition : (settings.dankBarAtBottom !== undefined ? (settings.dankBarAtBottom ? SettingsData.Position.Bottom : SettingsData.Position.Top) : (settings.topBarAtBottom !== undefined ? (settings.topBarAtBottom ? SettingsData.Position.Bottom : SettingsData.Position.Top) : SettingsData.Position.Top))
|
dankBarPosition = settings.dankBarPosition
|
||||||
|
!== undefined ? settings.dankBarPosition : (settings.dankBarAtBottom !== undefined ? (settings.dankBarAtBottom ? SettingsData.Position.Bottom : SettingsData.Position.Top) : (settings.topBarAtBottom !== undefined ? (settings.topBarAtBottom ? SettingsData.Position.Bottom : SettingsData.Position.Top) : SettingsData.Position.Top))
|
||||||
lockScreenShowPowerActions = settings.lockScreenShowPowerActions !== undefined ? settings.lockScreenShowPowerActions : true
|
lockScreenShowPowerActions = settings.lockScreenShowPowerActions !== undefined ? settings.lockScreenShowPowerActions : true
|
||||||
enableFprint = settings.enableFprint !== undefined ? settings.enableFprint : false
|
enableFprint = settings.enableFprint !== undefined ? settings.enableFprint : false
|
||||||
maxFprintTries = settings.maxFprintTries !== undefined ? settings.maxFprintTries : 3
|
maxFprintTries = settings.maxFprintTries !== undefined ? settings.maxFprintTries : 3
|
||||||
@@ -552,6 +607,7 @@ Singleton {
|
|||||||
"customThemeFile": customThemeFile,
|
"customThemeFile": customThemeFile,
|
||||||
"matugenScheme": matugenScheme,
|
"matugenScheme": matugenScheme,
|
||||||
"runUserMatugenTemplates": runUserMatugenTemplates,
|
"runUserMatugenTemplates": runUserMatugenTemplates,
|
||||||
|
"matugenTargetMonitor": matugenTargetMonitor,
|
||||||
"dankBarTransparency": dankBarTransparency,
|
"dankBarTransparency": dankBarTransparency,
|
||||||
"dankBarWidgetTransparency": dankBarWidgetTransparency,
|
"dankBarWidgetTransparency": dankBarWidgetTransparency,
|
||||||
"popupTransparency": popupTransparency,
|
"popupTransparency": popupTransparency,
|
||||||
@@ -718,52 +774,12 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cleanupUnusedKeys() {
|
function cleanupUnusedKeys() {
|
||||||
const validKeys = [
|
const validKeys = ["currentThemeName", "customThemeFile", "matugenScheme", "runUserMatugenTemplates", "matugenTargetMonitor", "dankBarTransparency", "dankBarWidgetTransparency", "popupTransparency", "dockTransparency", "use24HourClock", "showSeconds", "useFahrenheit", "nightModeEnabled", "weatherLocation", "weatherCoordinates", "useAutoLocation", "weatherEnabled", "showLauncherButton", "showWorkspaceSwitcher", "showFocusedWindow", "showWeather", "showMusic", "showClipboard", "showCpuUsage", "showMemUsage", "showCpuTemp", "showGpuTemp", "selectedGpuIndex", "enabledGpuPciIds", "showSystemTray", "showClock", "showNotificationButton", "showBattery", "showControlCenterButton", "controlCenterShowNetworkIcon", "controlCenterShowBluetoothIcon", "controlCenterShowAudioIcon", "controlCenterWidgets", "showWorkspaceIndex", "workspaceScrolling", "showWorkspacePadding", "showWorkspaceApps", "maxWorkspaceIcons", "workspacesPerMonitor", "workspaceNameIcons", "waveProgressEnabled", "clockCompactMode", "focusedWindowCompactMode", "runningAppsCompactMode", "keyboardLayoutNameCompactMode", "runningAppsCurrentWorkspace", "runningAppsGroupByApp", "clockDateFormat", "lockDateFormat", "mediaSize", "dankBarLeftWidgets", "dankBarCenterWidgets", "dankBarRightWidgets", "appLauncherViewMode", "spotlightModalViewMode", "sortAppsAlphabetically", "networkPreference", "iconTheme", "launcherLogoMode", "launcherLogoCustomPath", "launcherLogoColorOverride", "launcherLogoColorInvertOnMode", "launcherLogoBrightness", "launcherLogoContrast", "launcherLogoSizeOffset", "fontFamily", "monoFontFamily", "fontWeight", "fontScale", "dankBarFontScale", "notepadUseMonospace", "notepadFontFamily", "notepadFontSize", "notepadShowLineNumbers", "notepadTransparencyOverride", "notepadLastCustomTransparency", "soundsEnabled", "useSystemSoundTheme", "soundNewNotification", "soundVolumeChanged", "soundPluggedIn", "gtkThemingEnabled", "qtThemingEnabled", "syncModeWithPortal", "showDock", "dockAutoHide", "dockGroupByApp", "dockOpenOnOverview", "dockPosition", "dockSpacing", "dockBottomGap", "dockIconSize", "dockIndicatorStyle", "cornerRadius", "notificationOverlayEnabled", "dankBarAutoHide", "dankBarOpenOnOverview", "dankBarVisible", "dankBarSpacing", "dankBarBottomGap", "dankBarInnerPadding", "dankBarSquareCorners", "dankBarNoBackground", "dankBarGothCornersEnabled", "dankBarBorderEnabled", "dankBarBorderColor", "dankBarBorderOpacity", "dankBarBorderThickness", "popupGapsAuto", "popupGapsManual", "dankBarPosition", "lockScreenShowPowerActions", "enableFprint", "maxFprintTries", "hideBrightnessSlider", "widgetBackgroundColor", "surfaceBase", "wallpaperFillMode", "blurredWallpaperLayer", "blurWallpaperOnOverview", "notificationTimeoutLow", "notificationTimeoutNormal", "notificationTimeoutCritical", "notificationPopupPosition", "osdAlwaysShowValue", "powerActionConfirm", "customPowerActionLock", "customPowerActionLogout", "customPowerActionSuspend", "customPowerActionHibernate", "customPowerActionReboot", "customPowerActionPowerOff", "updaterUseCustomCommand", "updaterCustomCommand", "updaterTerminalAdditionalParams", "screenPreferences", "showOnLastDisplay", "animationSpeed", "customAnimationDuration", "acMonitorTimeout", "acLockTimeout", "acSuspendTimeout", "acHibernateTimeout", "batteryMonitorTimeout", "batteryLockTimeout", "batterySuspendTimeout", "batteryHibernateTimeout", "lockBeforeSuspend", "loginctlLockIntegration", "launchPrefix", "brightnessDevicePins", "configVersion"]
|
||||||
"currentThemeName", "customThemeFile", "matugenScheme", "runUserMatugenTemplates",
|
|
||||||
"dankBarTransparency", "dankBarWidgetTransparency", "popupTransparency", "dockTransparency",
|
|
||||||
"use24HourClock", "showSeconds", "useFahrenheit", "nightModeEnabled", "weatherLocation",
|
|
||||||
"weatherCoordinates", "useAutoLocation", "weatherEnabled", "showLauncherButton",
|
|
||||||
"showWorkspaceSwitcher", "showFocusedWindow", "showWeather", "showMusic",
|
|
||||||
"showClipboard", "showCpuUsage", "showMemUsage", "showCpuTemp", "showGpuTemp",
|
|
||||||
"selectedGpuIndex", "enabledGpuPciIds", "showSystemTray", "showClock",
|
|
||||||
"showNotificationButton", "showBattery", "showControlCenterButton",
|
|
||||||
"controlCenterShowNetworkIcon", "controlCenterShowBluetoothIcon", "controlCenterShowAudioIcon",
|
|
||||||
"controlCenterWidgets", "showWorkspaceIndex", "workspaceScrolling", "showWorkspacePadding", "showWorkspaceApps",
|
|
||||||
"maxWorkspaceIcons", "workspacesPerMonitor", "workspaceNameIcons", "waveProgressEnabled",
|
|
||||||
"clockCompactMode", "focusedWindowCompactMode", "runningAppsCompactMode", "keyboardLayoutNameCompactMode",
|
|
||||||
"runningAppsCurrentWorkspace", "runningAppsGroupByApp", "clockDateFormat", "lockDateFormat", "mediaSize",
|
|
||||||
"dankBarLeftWidgets", "dankBarCenterWidgets", "dankBarRightWidgets",
|
|
||||||
"appLauncherViewMode", "spotlightModalViewMode", "sortAppsAlphabetically",
|
|
||||||
"networkPreference", "iconTheme", "launcherLogoMode", "launcherLogoCustomPath",
|
|
||||||
"launcherLogoColorOverride", "launcherLogoColorInvertOnMode", "launcherLogoBrightness",
|
|
||||||
"launcherLogoContrast", "launcherLogoSizeOffset", "fontFamily", "monoFontFamily",
|
|
||||||
"fontWeight", "fontScale", "dankBarFontScale", "notepadUseMonospace",
|
|
||||||
"notepadFontFamily", "notepadFontSize", "notepadShowLineNumbers",
|
|
||||||
"notepadTransparencyOverride", "notepadLastCustomTransparency", "soundsEnabled",
|
|
||||||
"useSystemSoundTheme", "soundNewNotification", "soundVolumeChanged", "soundPluggedIn", "gtkThemingEnabled",
|
|
||||||
"qtThemingEnabled", "syncModeWithPortal", "showDock", "dockAutoHide", "dockGroupByApp",
|
|
||||||
"dockOpenOnOverview", "dockPosition", "dockSpacing", "dockBottomGap", "dockIconSize", "dockIndicatorStyle",
|
|
||||||
"cornerRadius", "notificationOverlayEnabled", "dankBarAutoHide",
|
|
||||||
"dankBarOpenOnOverview", "dankBarVisible", "dankBarSpacing", "dankBarBottomGap",
|
|
||||||
"dankBarInnerPadding", "dankBarSquareCorners", "dankBarNoBackground",
|
|
||||||
"dankBarGothCornersEnabled", "dankBarBorderEnabled", "dankBarBorderColor",
|
|
||||||
"dankBarBorderOpacity", "dankBarBorderThickness", "popupGapsAuto", "popupGapsManual",
|
|
||||||
"dankBarPosition", "lockScreenShowPowerActions", "enableFprint", "maxFprintTries",
|
|
||||||
"hideBrightnessSlider", "widgetBackgroundColor", "surfaceBase", "wallpaperFillMode",
|
|
||||||
"blurredWallpaperLayer", "blurWallpaperOnOverview", "notificationTimeoutLow", "notificationTimeoutNormal", "notificationTimeoutCritical",
|
|
||||||
"notificationPopupPosition", "osdAlwaysShowValue", "powerActionConfirm",
|
|
||||||
"customPowerActionLock", "customPowerActionLogout", "customPowerActionSuspend",
|
|
||||||
"customPowerActionHibernate", "customPowerActionReboot", "customPowerActionPowerOff",
|
|
||||||
"updaterUseCustomCommand", "updaterCustomCommand", "updaterTerminalAdditionalParams",
|
|
||||||
"screenPreferences", "showOnLastDisplay", "animationSpeed", "customAnimationDuration", "acMonitorTimeout", "acLockTimeout",
|
|
||||||
"acSuspendTimeout", "acHibernateTimeout", "batteryMonitorTimeout", "batteryLockTimeout",
|
|
||||||
"batterySuspendTimeout", "batteryHibernateTimeout", "lockBeforeSuspend",
|
|
||||||
"loginctlLockIntegration", "launchPrefix", "brightnessDevicePins", "configVersion"
|
|
||||||
]
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const content = settingsFile.text()
|
const content = settingsFile.text()
|
||||||
if (!content || !content.trim()) return
|
if (!content || !content.trim())
|
||||||
|
return
|
||||||
|
|
||||||
const settings = JSON.parse(content)
|
const settings = JSON.parse(content)
|
||||||
let needsSave = false
|
let needsSave = false
|
||||||
@@ -788,7 +804,7 @@ Singleton {
|
|||||||
if (use24HourClock) {
|
if (use24HourClock) {
|
||||||
return showSeconds ? "hh:mm:ss" : "hh:mm"
|
return showSeconds ? "hh:mm:ss" : "hh:mm"
|
||||||
} else {
|
} else {
|
||||||
return showSeconds ? "h:mm:ss AP": "h:mm AP"
|
return showSeconds ? "h:mm:ss AP" : "h:mm AP"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -899,10 +915,12 @@ Singleton {
|
|||||||
PortalService.setSystemIconTheme(gtkThemeName)
|
PortalService.setSystemIconTheme(gtkThemeName)
|
||||||
}
|
}
|
||||||
|
|
||||||
var configScript = "mkdir -p " + _configDir + "/gtk-3.0 " + _configDir + "/gtk-4.0\n" + "\n" + "for config_dir in " + _configDir + "/gtk-3.0 " + _configDir + "/gtk-4.0; do\n"
|
var configScript = "mkdir -p " + _configDir + "/gtk-3.0 " + _configDir + "/gtk-4.0\n" + "\n" + "for config_dir in " + _configDir + "/gtk-3.0 "
|
||||||
+ " settings_file=\"$config_dir/settings.ini\"\n" + " if [ -f \"$settings_file\" ]; then\n" + " if grep -q '^gtk-icon-theme-name=' \"$settings_file\"; then\n" + " sed -i 's/^gtk-icon-theme-name=.*/gtk-icon-theme-name=" + gtkThemeName + "/' \"$settings_file\"\n" + " else\n"
|
+ _configDir + "/gtk-4.0; do\n" + " settings_file=\"$config_dir/settings.ini\"\n" + " if [ -f \"$settings_file\" ]; then\n"
|
||||||
+ " if grep -q '\\[Settings\\]' \"$settings_file\"; then\n" + " sed -i '/\\[Settings\\]/a gtk-icon-theme-name=" + gtkThemeName + "' \"$settings_file\"\n" + " else\n" + " echo -e '\\n[Settings]\\ngtk-icon-theme-name=" + gtkThemeName + "' >> \"$settings_file\"\n" + " fi\n"
|
+ " if grep -q '^gtk-icon-theme-name=' \"$settings_file\"; then\n" + " sed -i 's/^gtk-icon-theme-name=.*/gtk-icon-theme-name=" + gtkThemeName + "/' \"$settings_file\"\n"
|
||||||
+ " fi\n" + " else\n" + " echo -e '[Settings]\\ngtk-icon-theme-name=" + gtkThemeName + "' > \"$settings_file\"\n" + " fi\n" + "done\n" + "\n" + "rm -rf ~/.cache/icon-cache ~/.cache/thumbnails 2>/dev/null || true\n" + "pkill -HUP -f 'gtk' 2>/dev/null || true\n"
|
+ " else\n" + " if grep -q '\\[Settings\\]' \"$settings_file\"; then\n" + " sed -i '/\\[Settings\\]/a gtk-icon-theme-name=" + gtkThemeName
|
||||||
|
+ "' \"$settings_file\"\n" + " else\n" + " echo -e '\\n[Settings]\\ngtk-icon-theme-name=" + gtkThemeName + "' >> \"$settings_file\"\n" + " fi\n" + " fi\n" + " else\n"
|
||||||
|
+ " echo -e '[Settings]\\ngtk-icon-theme-name=" + gtkThemeName + "' > \"$settings_file\"\n" + " fi\n" + "done\n" + "\n" + "rm -rf ~/.cache/icon-cache ~/.cache/thumbnails 2>/dev/null || true\n" + "pkill -HUP -f 'gtk' 2>/dev/null || true\n"
|
||||||
Quickshell.execDetached(["sh", "-lc", configScript])
|
Quickshell.execDetached(["sh", "-lc", configScript])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -914,9 +932,11 @@ Singleton {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
var script = "mkdir -p " + _configDir + "/qt5ct " + _configDir + "/qt6ct " + _configDir + "/environment.d 2>/dev/null || true\n" + "update_qt_icon_theme() {\n" + " local config_file=\"$1\"\n"
|
var script = "mkdir -p " + _configDir + "/qt5ct " + _configDir + "/qt6ct " + _configDir + "/environment.d 2>/dev/null || true\n" + "update_qt_icon_theme() {\n" + " local config_file=\"$1\"\n"
|
||||||
+ " local theme_name=\"$2\"\n" + " if [ -f \"$config_file\" ]; then\n" + " if grep -q '^\\[Appearance\\]' \"$config_file\"; then\n" + " if grep -q '^icon_theme=' \"$config_file\"; then\n" + " sed -i \"s/^icon_theme=.*/icon_theme=$theme_name/\" \"$config_file\"\n" + " else\n" + " sed -i \"/^\\[Appearance\\]/a icon_theme=$theme_name\" \"$config_file\"\n" + " fi\n"
|
+ " local theme_name=\"$2\"\n" + " if [ -f \"$config_file\" ]; then\n" + " if grep -q '^\\[Appearance\\]' \"$config_file\"; then\n" + " if grep -q '^icon_theme=' \"$config_file\"; then\n"
|
||||||
+ " else\n" + " printf '\\n[Appearance]\\nicon_theme=%s\\n' \"$theme_name\" >> \"$config_file\"\n" + " fi\n" + " else\n" + " printf '[Appearance]\\nicon_theme=%s\\n' \"$theme_name\" > \"$config_file\"\n" + " fi\n" + "}\n" + "update_qt_icon_theme " + _configDir + "/qt5ct/qt5ct.conf " + _shq(
|
+ " sed -i \"s/^icon_theme=.*/icon_theme=$theme_name/\" \"$config_file\"\n" + " else\n" + " sed -i \"/^\\[Appearance\\]/a icon_theme=$theme_name\" \"$config_file\"\n" + " fi\n"
|
||||||
qtThemeName) + "\n" + "update_qt_icon_theme " + _configDir + "/qt6ct/qt6ct.conf " + _shq(qtThemeName) + "\n" + "rm -rf " + home + "/.cache/icon-cache " + home + "/.cache/thumbnails 2>/dev/null || true\n"
|
+ " else\n" + " printf '\\n[Appearance]\\nicon_theme=%s\\n' \"$theme_name\" >> \"$config_file\"\n" + " fi\n" + " else\n"
|
||||||
|
+ " printf '[Appearance]\\nicon_theme=%s\\n' \"$theme_name\" > \"$config_file\"\n" + " fi\n" + "}\n" + "update_qt_icon_theme " + _configDir + "/qt5ct/qt5ct.conf " + _shq(qtThemeName)
|
||||||
|
+ "\n" + "update_qt_icon_theme " + _configDir + "/qt6ct/qt6ct.conf " + _shq(qtThemeName) + "\n" + "rm -rf " + home + "/.cache/icon-cache " + home + "/.cache/thumbnails 2>/dev/null || true\n"
|
||||||
Quickshell.execDetached(["sh", "-lc", script])
|
Quickshell.execDetached(["sh", "-lc", script])
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -938,15 +958,15 @@ Singleton {
|
|||||||
|
|
||||||
if (dankBarPosition === SettingsData.Position.Left || dankBarPosition === SettingsData.Position.Right) {
|
if (dankBarPosition === SettingsData.Position.Left || dankBarPosition === SettingsData.Position.Right) {
|
||||||
return {
|
return {
|
||||||
x: relativeY,
|
"x": relativeY,
|
||||||
y: barThickness + dankBarSpacing + Theme.popupDistance,
|
"y": barThickness + dankBarSpacing + Theme.popupDistance,
|
||||||
width: widgetWidth
|
"width": widgetWidth
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
x: relativeX,
|
"x": relativeX,
|
||||||
y: barThickness + dankBarSpacing + dankBarBottomGap + Theme.popupDistance,
|
"y": barThickness + dankBarSpacing + dankBarBottomGap + Theme.popupDistance,
|
||||||
width: widgetWidth
|
"width": widgetWidth
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -969,11 +989,7 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function sendTestNotification(index) {
|
function sendTestNotification(index) {
|
||||||
const notifications = [
|
const notifications = [["Notification Position Test", "DMS test notification 1 of 3 ~ Hi there!", "preferences-system"], ["Second Test", "DMS Notification 2 of 3 ~ Check it out!", "applications-graphics"], ["Third Test", "DMS notification 3 of 3 ~ Enjoy!", "face-smile"]]
|
||||||
["Notification Position Test", "DMS test notification 1 of 3 ~ Hi there!", "preferences-system"],
|
|
||||||
["Second Test", "DMS Notification 2 of 3 ~ Check it out!", "applications-graphics"],
|
|
||||||
["Third Test", "DMS notification 3 of 3 ~ Enjoy!", "face-smile"]
|
|
||||||
]
|
|
||||||
|
|
||||||
if (index < 0 || index >= notifications.length) {
|
if (index < 0 || index >= notifications.length) {
|
||||||
return
|
return
|
||||||
@@ -1023,6 +1039,18 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setMatugenTargetMonitor(monitorName) {
|
||||||
|
if (matugenTargetMonitor === monitorName)
|
||||||
|
return
|
||||||
|
|
||||||
|
matugenTargetMonitor = monitorName
|
||||||
|
saveSettings()
|
||||||
|
|
||||||
|
if (typeof Theme !== "undefined") {
|
||||||
|
Theme.generateSystemThemesFromCurrentTheme()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function setDankBarTransparency(transparency) {
|
function setDankBarTransparency(transparency) {
|
||||||
dankBarTransparency = transparency
|
dankBarTransparency = transparency
|
||||||
saveSettings()
|
saveSettings()
|
||||||
@@ -1795,53 +1823,53 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setPowerActionConfirm(confirm) {
|
function setPowerActionConfirm(confirm) {
|
||||||
powerActionConfirm = confirm;
|
powerActionConfirm = confirm
|
||||||
saveSettings();
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setCustomPowerActionLock(command) {
|
function setCustomPowerActionLock(command) {
|
||||||
customPowerActionLock = command;
|
customPowerActionLock = command
|
||||||
saveSettings();
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setCustomPowerActionLogout(command) {
|
function setCustomPowerActionLogout(command) {
|
||||||
customPowerActionLogout = command;
|
customPowerActionLogout = command
|
||||||
saveSettings();
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setCustomPowerActionSuspend(command) {
|
function setCustomPowerActionSuspend(command) {
|
||||||
customPowerActionSuspend = command;
|
customPowerActionSuspend = command
|
||||||
saveSettings();
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setCustomPowerActionHibernate(command) {
|
function setCustomPowerActionHibernate(command) {
|
||||||
customPowerActionHibernate = command;
|
customPowerActionHibernate = command
|
||||||
saveSettings();
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setCustomPowerActionReboot(command) {
|
function setCustomPowerActionReboot(command) {
|
||||||
customPowerActionReboot = command;
|
customPowerActionReboot = command
|
||||||
saveSettings();
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setCustomPowerActionPowerOff(command) {
|
function setCustomPowerActionPowerOff(command) {
|
||||||
customPowerActionPowerOff = command;
|
customPowerActionPowerOff = command
|
||||||
saveSettings();
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setUpdaterUseCustomCommandEnabled(enabled) {
|
function setUpdaterUseCustomCommandEnabled(enabled) {
|
||||||
updaterUseCustomCommand = enabled;
|
updaterUseCustomCommand = enabled
|
||||||
saveSettings();
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setUpdaterCustomCommand(command) {
|
function setUpdaterCustomCommand(command) {
|
||||||
updaterCustomCommand = command;
|
updaterCustomCommand = command
|
||||||
saveSettings();
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setUpdaterTerminalAdditionalParams(customArgs) {
|
function setUpdaterTerminalAdditionalParams(customArgs) {
|
||||||
updaterTerminalAdditionalParams = customArgs;
|
updaterTerminalAdditionalParams = customArgs
|
||||||
saveSettings();
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setScreenPreferences(prefs) {
|
function setScreenPreferences(prefs) {
|
||||||
|
|||||||
422
Common/Theme.qml
422
Common/Theme.qml
@@ -19,7 +19,8 @@ Singleton {
|
|||||||
readonly property bool envDisableMatugen: Quickshell.env("DMS_DISABLE_MATUGEN") === "1" || Quickshell.env("DMS_DISABLE_MATUGEN") === "true"
|
readonly property bool envDisableMatugen: Quickshell.env("DMS_DISABLE_MATUGEN") === "1" || Quickshell.env("DMS_DISABLE_MATUGEN") === "true"
|
||||||
|
|
||||||
readonly property real popupDistance: {
|
readonly property real popupDistance: {
|
||||||
if (typeof SettingsData === "undefined") return 4
|
if (typeof SettingsData === "undefined")
|
||||||
|
return 4
|
||||||
return SettingsData.popupGapsAuto ? Math.max(4, SettingsData.dankBarSpacing) : SettingsData.popupGapsManual
|
return SettingsData.popupGapsAuto ? Math.max(4, SettingsData.dankBarSpacing) : SettingsData.popupGapsManual
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,13 +30,14 @@ Singleton {
|
|||||||
property bool colorsFileLoadFailed: false
|
property bool colorsFileLoadFailed: false
|
||||||
|
|
||||||
readonly property string dynamic: "dynamic"
|
readonly property string dynamic: "dynamic"
|
||||||
readonly property string custom : "custom"
|
readonly property string custom: "custom"
|
||||||
|
|
||||||
readonly property string homeDir: Paths.strip(StandardPaths.writableLocation(StandardPaths.HomeLocation))
|
readonly property string homeDir: Paths.strip(StandardPaths.writableLocation(StandardPaths.HomeLocation))
|
||||||
readonly property string configDir: Paths.strip(StandardPaths.writableLocation(StandardPaths.ConfigLocation))
|
readonly property string configDir: Paths.strip(StandardPaths.writableLocation(StandardPaths.ConfigLocation))
|
||||||
readonly property string shellDir: Paths.strip(Qt.resolvedUrl(".").toString()).replace("/Common/", "")
|
readonly property string shellDir: Paths.strip(Qt.resolvedUrl(".").toString()).replace("/Common/", "")
|
||||||
readonly property string wallpaperPath: {
|
readonly property string wallpaperPath: {
|
||||||
if (typeof SessionData === "undefined") return ""
|
if (typeof SessionData === "undefined")
|
||||||
|
return ""
|
||||||
|
|
||||||
if (SessionData.perMonitorWallpaper) {
|
if (SessionData.perMonitorWallpaper) {
|
||||||
var screens = Quickshell.screens
|
var screens = Quickshell.screens
|
||||||
@@ -60,14 +62,28 @@ Singleton {
|
|||||||
return wallpaperPath
|
return wallpaperPath
|
||||||
}
|
}
|
||||||
readonly property string rawWallpaperPath: {
|
readonly property string rawWallpaperPath: {
|
||||||
if (typeof SessionData === "undefined") return ""
|
if (typeof SessionData === "undefined")
|
||||||
|
return ""
|
||||||
|
|
||||||
if (SessionData.perMonitorWallpaper) {
|
if (SessionData.perMonitorWallpaper) {
|
||||||
// Use first monitor's wallpaper for dynamic theming
|
|
||||||
var screens = Quickshell.screens
|
var screens = Quickshell.screens
|
||||||
if (screens.length > 0) {
|
if (screens.length > 0) {
|
||||||
var firstMonitorWallpaper = SessionData.getMonitorWallpaper(screens[0].name)
|
var targetMonitor = (typeof SettingsData !== "undefined" && SettingsData.matugenTargetMonitor && SettingsData.matugenTargetMonitor !== "") ? SettingsData.matugenTargetMonitor : screens[0].name
|
||||||
return firstMonitorWallpaper || SessionData.wallpaperPath
|
|
||||||
|
var targetMonitorExists = false
|
||||||
|
for (var i = 0; i < screens.length; i++) {
|
||||||
|
if (screens[i].name === targetMonitor) {
|
||||||
|
targetMonitorExists = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!targetMonitorExists) {
|
||||||
|
targetMonitor = screens[0].name
|
||||||
|
}
|
||||||
|
|
||||||
|
var targetMonitorWallpaper = SessionData.getMonitorWallpaper(targetMonitor)
|
||||||
|
return targetMonitorWallpaper || SessionData.wallpaperPath
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,59 +100,59 @@ Singleton {
|
|||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
Quickshell.execDetached(["mkdir", "-p", stateDir])
|
Quickshell.execDetached(["mkdir", "-p", stateDir])
|
||||||
Proc.runCommand("matugenCheck", ["which", "matugen"], (output, code) => {
|
Proc.runCommand("matugenCheck", ["which", "matugen"], (output, code) => {
|
||||||
matugenAvailable = (code === 0) && !envDisableMatugen
|
matugenAvailable = (code === 0) && !envDisableMatugen
|
||||||
const isGreeterMode = (typeof SessionData !== "undefined" && SessionData.isGreeterMode)
|
const isGreeterMode = (typeof SessionData !== "undefined" && SessionData.isGreeterMode)
|
||||||
|
|
||||||
if (!matugenAvailable || isGreeterMode) {
|
if (!matugenAvailable || isGreeterMode) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (colorsFileLoadFailed && currentTheme === dynamic && wallpaperPath) {
|
if (colorsFileLoadFailed && currentTheme === dynamic && rawWallpaperPath) {
|
||||||
console.info("Theme: Matugen now available, regenerating colors for dynamic theme")
|
console.info("Theme: Matugen now available, regenerating colors for dynamic theme")
|
||||||
const isLight = (typeof SessionData !== "undefined" && SessionData.isLightMode)
|
const isLight = (typeof SessionData !== "undefined" && SessionData.isLightMode)
|
||||||
const iconTheme = (typeof SettingsData !== "undefined" && SettingsData.iconTheme) ? SettingsData.iconTheme : "System Default"
|
const iconTheme = (typeof SettingsData !== "undefined" && SettingsData.iconTheme) ? SettingsData.iconTheme : "System Default"
|
||||||
Quickshell.execDetached(["rm", "-f", stateDir + "/matugen.key"])
|
Quickshell.execDetached(["rm", "-f", stateDir + "/matugen.key"])
|
||||||
const selectedMatugenType = (typeof SettingsData !== "undefined" && SettingsData.matugenScheme) ? SettingsData.matugenScheme : "scheme-tonal-spot"
|
const selectedMatugenType = (typeof SettingsData !== "undefined" && SettingsData.matugenScheme) ? SettingsData.matugenScheme : "scheme-tonal-spot"
|
||||||
if (wallpaperPath.startsWith("#")) {
|
if (rawWallpaperPath.startsWith("#")) {
|
||||||
setDesiredTheme("hex", wallpaperPath, isLight, iconTheme, selectedMatugenType)
|
setDesiredTheme("hex", rawWallpaperPath, isLight, iconTheme, selectedMatugenType)
|
||||||
} else {
|
} else {
|
||||||
setDesiredTheme("image", wallpaperPath, isLight, iconTheme, selectedMatugenType)
|
setDesiredTheme("image", rawWallpaperPath, isLight, iconTheme, selectedMatugenType)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const isLight = (typeof SessionData !== "undefined" && SessionData.isLightMode)
|
const isLight = (typeof SessionData !== "undefined" && SessionData.isLightMode)
|
||||||
const iconTheme = (typeof SettingsData !== "undefined" && SettingsData.iconTheme) ? SettingsData.iconTheme : "System Default"
|
const iconTheme = (typeof SettingsData !== "undefined" && SettingsData.iconTheme) ? SettingsData.iconTheme : "System Default"
|
||||||
|
|
||||||
if (currentTheme === dynamic) {
|
if (currentTheme === dynamic) {
|
||||||
if (wallpaperPath) {
|
if (rawWallpaperPath) {
|
||||||
Quickshell.execDetached(["rm", "-f", stateDir + "/matugen.key"])
|
Quickshell.execDetached(["rm", "-f", stateDir + "/matugen.key"])
|
||||||
const selectedMatugenType = (typeof SettingsData !== "undefined" && SettingsData.matugenScheme) ? SettingsData.matugenScheme : "scheme-tonal-spot"
|
const selectedMatugenType = (typeof SettingsData !== "undefined" && SettingsData.matugenScheme) ? SettingsData.matugenScheme : "scheme-tonal-spot"
|
||||||
if (wallpaperPath.startsWith("#")) {
|
if (rawWallpaperPath.startsWith("#")) {
|
||||||
setDesiredTheme("hex", wallpaperPath, isLight, iconTheme, selectedMatugenType)
|
setDesiredTheme("hex", rawWallpaperPath, isLight, iconTheme, selectedMatugenType)
|
||||||
} else {
|
} else {
|
||||||
setDesiredTheme("image", wallpaperPath, isLight, iconTheme, selectedMatugenType)
|
setDesiredTheme("image", rawWallpaperPath, isLight, iconTheme, selectedMatugenType)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let primaryColor
|
let primaryColor
|
||||||
let matugenType
|
let matugenType
|
||||||
if (currentTheme === "custom") {
|
if (currentTheme === "custom") {
|
||||||
if (customThemeData && customThemeData.primary) {
|
if (customThemeData && customThemeData.primary) {
|
||||||
primaryColor = customThemeData.primary
|
primaryColor = customThemeData.primary
|
||||||
matugenType = customThemeData.matugen_type
|
matugenType = customThemeData.matugen_type
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
primaryColor = currentThemeData.primary
|
primaryColor = currentThemeData.primary
|
||||||
matugenType = currentThemeData.matugen_type
|
matugenType = currentThemeData.matugen_type
|
||||||
}
|
}
|
||||||
|
|
||||||
if (primaryColor) {
|
if (primaryColor) {
|
||||||
Quickshell.execDetached(["rm", "-f", stateDir + "/matugen.key"])
|
Quickshell.execDetached(["rm", "-f", stateDir + "/matugen.key"])
|
||||||
setDesiredTheme("hex", primaryColor, isLight, iconTheme, matugenType)
|
setDesiredTheme("hex", primaryColor, isLight, iconTheme, matugenType)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 0)
|
}, 0)
|
||||||
if (typeof SessionData !== "undefined") {
|
if (typeof SessionData !== "undefined") {
|
||||||
SessionData.isLightModeChanged.connect(root.onLightModeChanged)
|
SessionData.isLightModeChanged.connect(root.onLightModeChanged)
|
||||||
}
|
}
|
||||||
@@ -194,22 +210,51 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly property var availableMatugenSchemes: [
|
readonly property var availableMatugenSchemes: [({
|
||||||
({ "value": "scheme-tonal-spot", "label": "Tonal Spot", "description": I18n.tr("Balanced palette with focused accents (default).") }),
|
"value": "scheme-tonal-spot",
|
||||||
({ "value": "scheme-vibrant-spot", "label": "Vibrant Spot", "description": I18n.tr("Lively palette with saturated accents.") }),
|
"label": "Tonal Spot",
|
||||||
({ "value": "scheme-dynamic-contrast", "label": "Dynamic Contrast", "description": I18n.tr("High-contrast palette for strong visual distinction.") }),
|
"description": I18n.tr("Balanced palette with focused accents (default).")
|
||||||
({ "value": "scheme-content", "label": "Content", "description": I18n.tr("Derives colors that closely match the underlying image.") }),
|
}), ({
|
||||||
({ "value": "scheme-expressive", "label": "Expressive", "description": I18n.tr("Vibrant palette with playful saturation.") }),
|
"value": "scheme-vibrant-spot",
|
||||||
({ "value": "scheme-fidelity", "label": "Fidelity", "description": I18n.tr("High-fidelity palette that preserves source hues.") }),
|
"label": "Vibrant Spot",
|
||||||
({ "value": "scheme-fruit-salad", "label": "Fruit Salad", "description": I18n.tr("Colorful mix of bright contrasting accents.") }),
|
"description": I18n.tr("Lively palette with saturated accents.")
|
||||||
({ "value": "scheme-monochrome", "label": "Monochrome", "description": I18n.tr("Minimal palette built around a single hue.") }),
|
}), ({
|
||||||
({ "value": "scheme-neutral", "label": "Neutral", "description": I18n.tr("Muted palette with subdued, calming tones.") }),
|
"value": "scheme-dynamic-contrast",
|
||||||
({ "value": "scheme-rainbow", "label": "Rainbow", "description": I18n.tr("Diverse palette spanning the full spectrum.") })
|
"label": "Dynamic Contrast",
|
||||||
]
|
"description": I18n.tr("High-contrast palette for strong visual distinction.")
|
||||||
|
}), ({
|
||||||
|
"value": "scheme-content",
|
||||||
|
"label": "Content",
|
||||||
|
"description": I18n.tr("Derives colors that closely match the underlying image.")
|
||||||
|
}), ({
|
||||||
|
"value": "scheme-expressive",
|
||||||
|
"label": "Expressive",
|
||||||
|
"description": I18n.tr("Vibrant palette with playful saturation.")
|
||||||
|
}), ({
|
||||||
|
"value": "scheme-fidelity",
|
||||||
|
"label": "Fidelity",
|
||||||
|
"description": I18n.tr("High-fidelity palette that preserves source hues.")
|
||||||
|
}), ({
|
||||||
|
"value": "scheme-fruit-salad",
|
||||||
|
"label": "Fruit Salad",
|
||||||
|
"description": I18n.tr("Colorful mix of bright contrasting accents.")
|
||||||
|
}), ({
|
||||||
|
"value": "scheme-monochrome",
|
||||||
|
"label": "Monochrome",
|
||||||
|
"description": I18n.tr("Minimal palette built around a single hue.")
|
||||||
|
}), ({
|
||||||
|
"value": "scheme-neutral",
|
||||||
|
"label": "Neutral",
|
||||||
|
"description": I18n.tr("Muted palette with subdued, calming tones.")
|
||||||
|
}), ({
|
||||||
|
"value": "scheme-rainbow",
|
||||||
|
"label": "Rainbow",
|
||||||
|
"description": I18n.tr("Diverse palette spanning the full spectrum.")
|
||||||
|
})]
|
||||||
|
|
||||||
function getMatugenScheme(value) {
|
function getMatugenScheme(value) {
|
||||||
const schemes = availableMatugenSchemes
|
const schemes = availableMatugenSchemes
|
||||||
for (let i = 0; i < schemes.length; i++) {
|
for (var i = 0; i < schemes.length; i++) {
|
||||||
if (schemes[i].value === value)
|
if (schemes[i].value === value)
|
||||||
return schemes[i]
|
return schemes[i]
|
||||||
}
|
}
|
||||||
@@ -296,13 +341,37 @@ Singleton {
|
|||||||
property color shadowMedium: Qt.rgba(0, 0, 0, 0.08)
|
property color shadowMedium: Qt.rgba(0, 0, 0, 0.08)
|
||||||
property color shadowStrong: Qt.rgba(0, 0, 0, 0.3)
|
property color shadowStrong: Qt.rgba(0, 0, 0, 0.3)
|
||||||
|
|
||||||
readonly property var animationDurations: [
|
readonly property var animationDurations: [{
|
||||||
{ shorter: 0, short: 0, medium: 0, long: 0, extraLong: 0 },
|
"shorter": 0,
|
||||||
{ shorter: 50, short: 75, medium: 150, long: 250, extraLong: 500 },
|
"short": 0,
|
||||||
{ shorter: 100, short: 150, medium: 300, long: 500, extraLong: 1000 },
|
"medium": 0,
|
||||||
{ shorter: 150, short: 225, medium: 450, long: 750, extraLong: 1500 },
|
"long": 0,
|
||||||
{ shorter: 200, short: 300, medium: 600, long: 1000, extraLong: 2000 }
|
"extraLong": 0
|
||||||
]
|
}, {
|
||||||
|
"shorter": 50,
|
||||||
|
"short": 75,
|
||||||
|
"medium": 150,
|
||||||
|
"long": 250,
|
||||||
|
"extraLong": 500
|
||||||
|
}, {
|
||||||
|
"shorter": 100,
|
||||||
|
"short": 150,
|
||||||
|
"medium": 300,
|
||||||
|
"long": 500,
|
||||||
|
"extraLong": 1000
|
||||||
|
}, {
|
||||||
|
"shorter": 150,
|
||||||
|
"short": 225,
|
||||||
|
"medium": 450,
|
||||||
|
"long": 750,
|
||||||
|
"extraLong": 1500
|
||||||
|
}, {
|
||||||
|
"shorter": 200,
|
||||||
|
"short": 300,
|
||||||
|
"medium": 600,
|
||||||
|
"long": 1000,
|
||||||
|
"extraLong": 2000
|
||||||
|
}]
|
||||||
|
|
||||||
readonly property int currentAnimationSpeed: typeof SettingsData !== "undefined" ? SettingsData.animationSpeed : SettingsData.AnimationSpeed.Short
|
readonly property int currentAnimationSpeed: typeof SettingsData !== "undefined" ? SettingsData.animationSpeed : SettingsData.AnimationSpeed.Short
|
||||||
readonly property var currentDurations: animationDurations[currentAnimationSpeed] || animationDurations[SettingsData.AnimationSpeed.Short]
|
readonly property var currentDurations: animationDurations[currentAnimationSpeed] || animationDurations[SettingsData.AnimationSpeed.Short]
|
||||||
@@ -335,12 +404,13 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
readonly property int currentAnimationBaseDuration: {
|
readonly property int currentAnimationBaseDuration: {
|
||||||
if (typeof SettingsData === "undefined") return 500
|
if (typeof SettingsData === "undefined")
|
||||||
|
return 500
|
||||||
|
|
||||||
if (SettingsData.animationSpeed === SettingsData.AnimationSpeed.Custom) {
|
if (SettingsData.animationSpeed === SettingsData.AnimationSpeed.Custom) {
|
||||||
return SettingsData.customAnimationDuration
|
return SettingsData.customAnimationDuration
|
||||||
}
|
}
|
||||||
|
|
||||||
const presetMap = [0, 250, 500, 750]
|
const presetMap = [0, 250, 500, 750]
|
||||||
return presetMap[SettingsData.animationSpeed] !== undefined ? presetMap[SettingsData.animationSpeed] : 500
|
return presetMap[SettingsData.animationSpeed] !== undefined ? presetMap[SettingsData.animationSpeed] : 500
|
||||||
}
|
}
|
||||||
@@ -485,20 +555,40 @@ Singleton {
|
|||||||
|
|
||||||
function getCatppuccinColor(variantName) {
|
function getCatppuccinColor(variantName) {
|
||||||
const catColors = {
|
const catColors = {
|
||||||
"cat-rosewater": "#f5e0dc", "cat-flamingo": "#f2cdcd", "cat-pink": "#f5c2e7", "cat-mauve": "#cba6f7",
|
"cat-rosewater": "#f5e0dc",
|
||||||
"cat-red": "#f38ba8", "cat-maroon": "#eba0ac", "cat-peach": "#fab387", "cat-yellow": "#f9e2af",
|
"cat-flamingo": "#f2cdcd",
|
||||||
"cat-green": "#a6e3a1", "cat-teal": "#94e2d5", "cat-sky": "#89dceb", "cat-sapphire": "#74c7ec",
|
"cat-pink": "#f5c2e7",
|
||||||
"cat-blue": "#89b4fa", "cat-lavender": "#b4befe"
|
"cat-mauve": "#cba6f7",
|
||||||
|
"cat-red": "#f38ba8",
|
||||||
|
"cat-maroon": "#eba0ac",
|
||||||
|
"cat-peach": "#fab387",
|
||||||
|
"cat-yellow": "#f9e2af",
|
||||||
|
"cat-green": "#a6e3a1",
|
||||||
|
"cat-teal": "#94e2d5",
|
||||||
|
"cat-sky": "#89dceb",
|
||||||
|
"cat-sapphire": "#74c7ec",
|
||||||
|
"cat-blue": "#89b4fa",
|
||||||
|
"cat-lavender": "#b4befe"
|
||||||
}
|
}
|
||||||
return catColors[variantName] || "#cba6f7"
|
return catColors[variantName] || "#cba6f7"
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCatppuccinVariantName(variantName) {
|
function getCatppuccinVariantName(variantName) {
|
||||||
const catNames = {
|
const catNames = {
|
||||||
"cat-rosewater": "Rosewater", "cat-flamingo": "Flamingo", "cat-pink": "Pink", "cat-mauve": "Mauve",
|
"cat-rosewater": "Rosewater",
|
||||||
"cat-red": "Red", "cat-maroon": "Maroon", "cat-peach": "Peach", "cat-yellow": "Yellow",
|
"cat-flamingo": "Flamingo",
|
||||||
"cat-green": "Green", "cat-teal": "Teal", "cat-sky": "Sky", "cat-sapphire": "Sapphire",
|
"cat-pink": "Pink",
|
||||||
"cat-blue": "Blue", "cat-lavender": "Lavender"
|
"cat-mauve": "Mauve",
|
||||||
|
"cat-red": "Red",
|
||||||
|
"cat-maroon": "Maroon",
|
||||||
|
"cat-peach": "Peach",
|
||||||
|
"cat-yellow": "Yellow",
|
||||||
|
"cat-green": "Green",
|
||||||
|
"cat-teal": "Teal",
|
||||||
|
"cat-sky": "Sky",
|
||||||
|
"cat-sapphire": "Sapphire",
|
||||||
|
"cat-blue": "Blue",
|
||||||
|
"cat-lavender": "Lavender"
|
||||||
}
|
}
|
||||||
return catNames[variantName] || "Unknown"
|
return catNames[variantName] || "Unknown"
|
||||||
}
|
}
|
||||||
@@ -541,14 +631,14 @@ Singleton {
|
|||||||
const colorMode = typeof SettingsData !== "undefined" ? SettingsData.widgetBackgroundColor : "sch"
|
const colorMode = typeof SettingsData !== "undefined" ? SettingsData.widgetBackgroundColor : "sch"
|
||||||
switch (colorMode) {
|
switch (colorMode) {
|
||||||
case "s":
|
case "s":
|
||||||
return surface
|
return surface
|
||||||
case "sc":
|
case "sc":
|
||||||
return surfaceContainer
|
return surfaceContainer
|
||||||
case "sch":
|
case "sch":
|
||||||
return surfaceContainerHigh
|
return surfaceContainerHigh
|
||||||
case "sth":
|
case "sth":
|
||||||
default:
|
default:
|
||||||
return surfaceTextHover
|
return surfaceTextHover
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -562,14 +652,14 @@ Singleton {
|
|||||||
const colorMode = typeof SettingsData !== "undefined" ? SettingsData.widgetBackgroundColor : "sch"
|
const colorMode = typeof SettingsData !== "undefined" ? SettingsData.widgetBackgroundColor : "sch"
|
||||||
switch (colorMode) {
|
switch (colorMode) {
|
||||||
case "s":
|
case "s":
|
||||||
return Qt.rgba(surface.r, surface.g, surface.b, widgetTransparency)
|
return Qt.rgba(surface.r, surface.g, surface.b, widgetTransparency)
|
||||||
case "sc":
|
case "sc":
|
||||||
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b, widgetTransparency)
|
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b, widgetTransparency)
|
||||||
case "sch":
|
case "sch":
|
||||||
return Qt.rgba(surfaceContainerHigh.r, surfaceContainerHigh.g, surfaceContainerHigh.b, widgetTransparency)
|
return Qt.rgba(surfaceContainerHigh.r, surfaceContainerHigh.g, surfaceContainerHigh.b, widgetTransparency)
|
||||||
case "sth":
|
case "sth":
|
||||||
default:
|
default:
|
||||||
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b, widgetTransparency)
|
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b, widgetTransparency)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -593,8 +683,10 @@ Singleton {
|
|||||||
function barTextSize(barThickness) {
|
function barTextSize(barThickness) {
|
||||||
const scale = barThickness / 48
|
const scale = barThickness / 48
|
||||||
const dankBarScale = (typeof SettingsData !== "undefined" ? SettingsData.dankBarFontScale : 1.0)
|
const dankBarScale = (typeof SettingsData !== "undefined" ? SettingsData.dankBarFontScale : 1.0)
|
||||||
if (scale <= 0.75) return fontSizeSmall * 0.9 * dankBarScale
|
if (scale <= 0.75)
|
||||||
if (scale >= 1.25) return fontSizeMedium * dankBarScale
|
return fontSizeSmall * 0.9 * dankBarScale
|
||||||
|
if (scale >= 1.25)
|
||||||
|
return fontSizeMedium * dankBarScale
|
||||||
return fontSizeSmall * dankBarScale
|
return fontSizeSmall * dankBarScale
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -688,7 +780,6 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function onLightModeChanged() {
|
function onLightModeChanged() {
|
||||||
if (currentTheme === "custom" && customThemeFileView.path) {
|
if (currentTheme === "custom" && customThemeFileView.path) {
|
||||||
customThemeFileView.reload()
|
customThemeFileView.reload()
|
||||||
@@ -725,10 +816,7 @@ Singleton {
|
|||||||
const syncModeWithPortal = (typeof SettingsData !== "undefined" && SettingsData.syncModeWithPortal) ? "true" : "false"
|
const syncModeWithPortal = (typeof SettingsData !== "undefined" && SettingsData.syncModeWithPortal) ? "true" : "false"
|
||||||
if (rawWallpaperPath.startsWith("we:")) {
|
if (rawWallpaperPath.startsWith("we:")) {
|
||||||
console.log("Theme: Starting matugen worker (WE wallpaper)")
|
console.log("Theme: Starting matugen worker (WE wallpaper)")
|
||||||
systemThemeGenerator.command = [
|
systemThemeGenerator.command = ["sh", "-c", `sleep 1 && ${shellDir}/scripts/matugen-worker.sh '${stateDir}' '${shellDir}' '${configDir}' '${syncModeWithPortal}' --run`]
|
||||||
"sh", "-c",
|
|
||||||
`sleep 1 && ${shellDir}/scripts/matugen-worker.sh '${stateDir}' '${shellDir}' '${configDir}' '${syncModeWithPortal}' --run`
|
|
||||||
]
|
|
||||||
} else {
|
} else {
|
||||||
console.log("Theme: Starting matugen worker")
|
console.log("Theme: Starting matugen worker")
|
||||||
systemThemeGenerator.command = [shellDir + "/scripts/matugen-worker.sh", stateDir, shellDir, configDir, syncModeWithPortal, "--run"]
|
systemThemeGenerator.command = [shellDir + "/scripts/matugen-worker.sh", stateDir, shellDir, configDir, syncModeWithPortal, "--run"]
|
||||||
@@ -745,14 +833,14 @@ Singleton {
|
|||||||
const iconTheme = (typeof SettingsData !== "undefined" && SettingsData.iconTheme) ? SettingsData.iconTheme : "System Default"
|
const iconTheme = (typeof SettingsData !== "undefined" && SettingsData.iconTheme) ? SettingsData.iconTheme : "System Default"
|
||||||
|
|
||||||
if (currentTheme === dynamic) {
|
if (currentTheme === dynamic) {
|
||||||
if (!wallpaperPath) {
|
if (!rawWallpaperPath) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const selectedMatugenType = (typeof SettingsData !== "undefined" && SettingsData.matugenScheme) ? SettingsData.matugenScheme : "scheme-tonal-spot"
|
const selectedMatugenType = (typeof SettingsData !== "undefined" && SettingsData.matugenScheme) ? SettingsData.matugenScheme : "scheme-tonal-spot"
|
||||||
if (wallpaperPath.startsWith("#")) {
|
if (rawWallpaperPath.startsWith("#")) {
|
||||||
setDesiredTheme("hex", wallpaperPath, isLight, iconTheme, selectedMatugenType)
|
setDesiredTheme("hex", rawWallpaperPath, isLight, iconTheme, selectedMatugenType)
|
||||||
} else {
|
} else {
|
||||||
setDesiredTheme("image", wallpaperPath, isLight, iconTheme, selectedMatugenType)
|
setDesiredTheme("image", rawWallpaperPath, isLight, iconTheme, selectedMatugenType)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let primaryColor
|
let primaryColor
|
||||||
@@ -787,16 +875,16 @@ Singleton {
|
|||||||
|
|
||||||
const isLight = (typeof SessionData !== "undefined" && SessionData.isLightMode) ? "true" : "false"
|
const isLight = (typeof SessionData !== "undefined" && SessionData.isLightMode) ? "true" : "false"
|
||||||
Proc.runCommand("gtkApplier", [shellDir + "/scripts/gtk.sh", configDir, isLight, shellDir], (output, exitCode) => {
|
Proc.runCommand("gtkApplier", [shellDir + "/scripts/gtk.sh", configDir, isLight, shellDir], (output, exitCode) => {
|
||||||
if (exitCode === 0) {
|
if (exitCode === 0) {
|
||||||
if (typeof ToastService !== "undefined" && typeof NiriService !== "undefined" && !NiriService.matugenSuppression) {
|
if (typeof ToastService !== "undefined" && typeof NiriService !== "undefined" && !NiriService.matugenSuppression) {
|
||||||
ToastService.showInfo("GTK colors applied successfully")
|
ToastService.showInfo("GTK colors applied successfully")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (typeof ToastService !== "undefined") {
|
if (typeof ToastService !== "undefined") {
|
||||||
ToastService.showError("Failed to apply GTK colors")
|
ToastService.showError("Failed to apply GTK colors")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyQtColors() {
|
function applyQtColors() {
|
||||||
@@ -808,32 +896,42 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Proc.runCommand("qtApplier", [shellDir + "/scripts/qt.sh", configDir], (output, exitCode) => {
|
Proc.runCommand("qtApplier", [shellDir + "/scripts/qt.sh", configDir], (output, exitCode) => {
|
||||||
if (exitCode === 0) {
|
if (exitCode === 0) {
|
||||||
if (typeof ToastService !== "undefined") {
|
if (typeof ToastService !== "undefined") {
|
||||||
ToastService.showInfo("Qt colors applied successfully")
|
ToastService.showInfo("Qt colors applied successfully")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (typeof ToastService !== "undefined") {
|
if (typeof ToastService !== "undefined") {
|
||||||
ToastService.showError("Failed to apply Qt colors")
|
ToastService.showError("Failed to apply Qt colors")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function withAlpha(c, a) { return Qt.rgba(c.r, c.g, c.b, a); }
|
function withAlpha(c, a) {
|
||||||
|
return Qt.rgba(c.r, c.g, c.b, a)
|
||||||
|
}
|
||||||
|
|
||||||
function getFillMode(modeName) {
|
function getFillMode(modeName) {
|
||||||
switch(modeName) {
|
switch (modeName) {
|
||||||
case "Stretch": return Image.Stretch
|
case "Stretch":
|
||||||
case "Fit":
|
return Image.Stretch
|
||||||
case "PreserveAspectFit": return Image.PreserveAspectFit
|
case "Fit":
|
||||||
case "Fill":
|
case "PreserveAspectFit":
|
||||||
case "PreserveAspectCrop": return Image.PreserveAspectCrop
|
return Image.PreserveAspectFit
|
||||||
case "Tile": return Image.Tile
|
case "Fill":
|
||||||
case "TileVertically": return Image.TileVertically
|
case "PreserveAspectCrop":
|
||||||
case "TileHorizontally": return Image.TileHorizontally
|
return Image.PreserveAspectCrop
|
||||||
case "Pad": return Image.Pad
|
case "Tile":
|
||||||
default: return Image.PreserveAspectCrop
|
return Image.Tile
|
||||||
|
case "TileVertically":
|
||||||
|
return Image.TileVertically
|
||||||
|
case "TileHorizontally":
|
||||||
|
return Image.TileHorizontally
|
||||||
|
case "Pad":
|
||||||
|
return Image.Pad
|
||||||
|
default:
|
||||||
|
return Image.PreserveAspectCrop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -852,40 +950,48 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function invertHex(hex) {
|
function invertHex(hex) {
|
||||||
hex = hex.replace('#', '');
|
hex = hex.replace('#', '')
|
||||||
|
|
||||||
if (!/^[0-9A-Fa-f]{6}$/.test(hex)) {
|
if (!/^[0-9A-Fa-f]{6}$/.test(hex)) {
|
||||||
return hex;
|
return hex
|
||||||
}
|
}
|
||||||
|
|
||||||
const r = parseInt(hex.substr(0, 2), 16);
|
const r = parseInt(hex.substr(0, 2), 16)
|
||||||
const g = parseInt(hex.substr(2, 2), 16);
|
const g = parseInt(hex.substr(2, 2), 16)
|
||||||
const b = parseInt(hex.substr(4, 2), 16);
|
const b = parseInt(hex.substr(4, 2), 16)
|
||||||
|
|
||||||
const invR = (255 - r).toString(16).padStart(2, '0');
|
const invR = (255 - r).toString(16).padStart(2, '0')
|
||||||
const invG = (255 - g).toString(16).padStart(2, '0');
|
const invG = (255 - g).toString(16).padStart(2, '0')
|
||||||
const invB = (255 - b).toString(16).padStart(2, '0');
|
const invB = (255 - b).toString(16).padStart(2, '0')
|
||||||
|
|
||||||
return `#${invR}${invG}${invB}`;
|
return `#${invR}${invG}${invB}`
|
||||||
}
|
}
|
||||||
|
|
||||||
property string baseLogoColor: {
|
property string baseLogoColor: {
|
||||||
if (typeof SettingsData === "undefined") return ""
|
if (typeof SettingsData === "undefined")
|
||||||
|
return ""
|
||||||
const colorOverride = SettingsData.launcherLogoColorOverride
|
const colorOverride = SettingsData.launcherLogoColorOverride
|
||||||
if (!colorOverride || colorOverride === "") return ""
|
if (!colorOverride || colorOverride === "")
|
||||||
if (colorOverride === "primary") return primary
|
return ""
|
||||||
if (colorOverride === "surface") return surfaceText
|
if (colorOverride === "primary")
|
||||||
|
return primary
|
||||||
|
if (colorOverride === "surface")
|
||||||
|
return surfaceText
|
||||||
return colorOverride
|
return colorOverride
|
||||||
}
|
}
|
||||||
|
|
||||||
property string effectiveLogoColor: {
|
property string effectiveLogoColor: {
|
||||||
if (typeof SettingsData === "undefined") return ""
|
if (typeof SettingsData === "undefined")
|
||||||
|
return ""
|
||||||
|
|
||||||
const colorOverride = SettingsData.launcherLogoColorOverride
|
const colorOverride = SettingsData.launcherLogoColorOverride
|
||||||
if (!colorOverride || colorOverride === "") return ""
|
if (!colorOverride || colorOverride === "")
|
||||||
|
return ""
|
||||||
|
|
||||||
if (colorOverride === "primary") return primary
|
if (colorOverride === "primary")
|
||||||
if (colorOverride === "surface") return surfaceText
|
return primary
|
||||||
|
if (colorOverride === "surface")
|
||||||
|
return surfaceText
|
||||||
|
|
||||||
if (!SettingsData.launcherLogoColorInvertOnMode) {
|
if (!SettingsData.launcherLogoColorInvertOnMode) {
|
||||||
return colorOverride
|
return colorOverride
|
||||||
@@ -898,8 +1004,6 @@ Singleton {
|
|||||||
return colorOverride
|
return colorOverride
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: systemThemeGenerator
|
id: systemThemeGenerator
|
||||||
running: false
|
running: false
|
||||||
@@ -956,9 +1060,7 @@ Singleton {
|
|||||||
id: dynamicColorsFileView
|
id: dynamicColorsFileView
|
||||||
path: {
|
path: {
|
||||||
const greetCfgDir = Quickshell.env("DMS_GREET_CFG_DIR") || "/etc/greetd/.dms"
|
const greetCfgDir = Quickshell.env("DMS_GREET_CFG_DIR") || "/etc/greetd/.dms"
|
||||||
const colorsPath = SessionData.isGreeterMode
|
const colorsPath = SessionData.isGreeterMode ? greetCfgDir + "/colors.json" : stateDir + "/dms-colors.json"
|
||||||
? greetCfgDir + "/colors.json"
|
|
||||||
: stateDir + "/dms-colors.json"
|
|
||||||
return colorsPath
|
return colorsPath
|
||||||
}
|
}
|
||||||
watchChanges: currentTheme === dynamic && !SessionData.isGreeterMode
|
watchChanges: currentTheme === dynamic && !SessionData.isGreeterMode
|
||||||
@@ -1000,7 +1102,7 @@ Singleton {
|
|||||||
console.warn("Theme: Dynamic colors file load failed, marking for regeneration")
|
console.warn("Theme: Dynamic colors file load failed, marking for regeneration")
|
||||||
colorsFileLoadFailed = true
|
colorsFileLoadFailed = true
|
||||||
const isGreeterMode = (typeof SessionData !== "undefined" && SessionData.isGreeterMode)
|
const isGreeterMode = (typeof SessionData !== "undefined" && SessionData.isGreeterMode)
|
||||||
if (!isGreeterMode && matugenAvailable && wallpaperPath) {
|
if (!isGreeterMode && matugenAvailable && rawWallpaperPath) {
|
||||||
console.log("Theme: Matugen available, triggering immediate regeneration")
|
console.log("Theme: Matugen available, triggering immediate regeneration")
|
||||||
generateSystemThemesFromCurrentTheme()
|
generateSystemThemesFromCurrentTheme()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,12 +49,16 @@ DankPopout {
|
|||||||
property bool __contentReady: false
|
property bool __contentReady: false
|
||||||
|
|
||||||
function __tryFocusOnce() {
|
function __tryFocusOnce() {
|
||||||
if (!__focusArmed) return
|
if (!__focusArmed)
|
||||||
|
return
|
||||||
const win = root.window
|
const win = root.window
|
||||||
if (!win || !win.visible) return
|
if (!win || !win.visible)
|
||||||
if (!contentLoader.item) return
|
return
|
||||||
|
if (!contentLoader.item)
|
||||||
|
return
|
||||||
|
|
||||||
if (win.requestActivate) win.requestActivate()
|
if (win.requestActivate)
|
||||||
|
win.requestActivate()
|
||||||
contentLoader.item.forceActiveFocus(Qt.TabFocusReason)
|
contentLoader.item.forceActiveFocus(Qt.TabFocusReason)
|
||||||
|
|
||||||
if (contentLoader.item.activeFocus)
|
if (contentLoader.item.activeFocus)
|
||||||
@@ -78,14 +82,18 @@ DankPopout {
|
|||||||
target: contentLoader
|
target: contentLoader
|
||||||
function onLoaded() {
|
function onLoaded() {
|
||||||
__contentReady = true
|
__contentReady = true
|
||||||
if (__focusArmed) __tryFocusOnce()
|
if (__focusArmed)
|
||||||
|
__tryFocusOnce()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root.window ? root.window : null
|
target: root.window ? root.window : null
|
||||||
enabled: !!root.window
|
enabled: !!root.window
|
||||||
function onVisibleChanged() { if (__focusArmed) __tryFocusOnce() }
|
function onVisibleChanged() {
|
||||||
|
if (__focusArmed)
|
||||||
|
__tryFocusOnce()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onBackgroundClicked: {
|
onBackgroundClicked: {
|
||||||
@@ -111,14 +119,14 @@ DankPopout {
|
|||||||
target: root
|
target: root
|
||||||
function onShouldBeVisibleChanged() {
|
function onShouldBeVisibleChanged() {
|
||||||
if (root.shouldBeVisible) {
|
if (root.shouldBeVisible) {
|
||||||
Qt.callLater(function() {
|
Qt.callLater(function () {
|
||||||
mainContainer.forceActiveFocus()
|
mainContainer.forceActiveFocus()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Keys.onPressed: function(event) {
|
Keys.onPressed: function (event) {
|
||||||
if (event.key === Qt.Key_Escape) {
|
if (event.key === Qt.Key_Escape) {
|
||||||
root.dashVisible = false
|
root.dashVisible = false
|
||||||
event.accepted = true
|
event.accepted = true
|
||||||
@@ -216,32 +224,43 @@ DankPopout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
model: {
|
model: {
|
||||||
let tabs = [
|
let tabs = [{
|
||||||
{ icon: "dashboard", text: I18n.tr("Overview") },
|
"icon": "dashboard",
|
||||||
{ icon: "music_note", text: I18n.tr("Media") },
|
"text": I18n.tr("Overview")
|
||||||
{ icon: "wallpaper", text: I18n.tr("Wallpapers") }
|
}, {
|
||||||
]
|
"icon": "music_note",
|
||||||
|
"text": I18n.tr("Media")
|
||||||
|
}, {
|
||||||
|
"icon": "wallpaper",
|
||||||
|
"text": I18n.tr("Wallpapers")
|
||||||
|
}]
|
||||||
|
|
||||||
if (SettingsData.weatherEnabled) {
|
if (SettingsData.weatherEnabled) {
|
||||||
tabs.push({ icon: "wb_sunny", text: I18n.tr("Weather") })
|
tabs.push({
|
||||||
|
"icon": "wb_sunny",
|
||||||
|
"text": I18n.tr("Weather")
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
tabs.push({ icon: "settings", text: I18n.tr("Settings"), isAction: true })
|
tabs.push({
|
||||||
|
"icon": "settings",
|
||||||
|
"text": I18n.tr("Settings"),
|
||||||
|
"isAction": true
|
||||||
|
})
|
||||||
return tabs
|
return tabs
|
||||||
}
|
}
|
||||||
|
|
||||||
onTabClicked: function(index) {
|
onTabClicked: function (index) {
|
||||||
root.currentTabIndex = index
|
root.currentTabIndex = index
|
||||||
}
|
}
|
||||||
|
|
||||||
onActionTriggered: function(index) {
|
onActionTriggered: function (index) {
|
||||||
let settingsIndex = SettingsData.weatherEnabled ? 4 : 3
|
let settingsIndex = SettingsData.weatherEnabled ? 4 : 3
|
||||||
if (index === settingsIndex) {
|
if (index === settingsIndex) {
|
||||||
dashVisible = false
|
dashVisible = false
|
||||||
settingsModal.show()
|
settingsModal.show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
@@ -253,10 +272,14 @@ DankPopout {
|
|||||||
id: pages
|
id: pages
|
||||||
width: parent.width
|
width: parent.width
|
||||||
implicitHeight: {
|
implicitHeight: {
|
||||||
if (currentIndex === 0) return overviewTab.implicitHeight
|
if (currentIndex === 0)
|
||||||
if (currentIndex === 1) return mediaTab.implicitHeight
|
return overviewTab.implicitHeight
|
||||||
if (currentIndex === 2) return wallpaperTab.implicitHeight
|
if (currentIndex === 1)
|
||||||
if (SettingsData.weatherEnabled && currentIndex === 3) return weatherTab.implicitHeight
|
return mediaTab.implicitHeight
|
||||||
|
if (currentIndex === 2)
|
||||||
|
return wallpaperTab.implicitHeight
|
||||||
|
if (SettingsData.weatherEnabled && currentIndex === 3)
|
||||||
|
return weatherTab.implicitHeight
|
||||||
return overviewTab.implicitHeight
|
return overviewTab.implicitHeight
|
||||||
}
|
}
|
||||||
currentIndex: root.currentTabIndex
|
currentIndex: root.currentTabIndex
|
||||||
@@ -286,6 +309,7 @@ DankPopout {
|
|||||||
active: root.currentTabIndex === 2
|
active: root.currentTabIndex === 2
|
||||||
tabBarItem: tabBar
|
tabBarItem: tabBar
|
||||||
keyForwardTarget: mainContainer
|
keyForwardTarget: mainContainer
|
||||||
|
targetScreen: root.triggerScreen
|
||||||
}
|
}
|
||||||
|
|
||||||
WeatherTab {
|
WeatherTab {
|
||||||
@@ -296,4 +320,4 @@ DankPopout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,9 +29,26 @@ Item {
|
|||||||
property bool enableAnimation: false
|
property bool enableAnimation: false
|
||||||
property string homeDir: StandardPaths.writableLocation(StandardPaths.HomeLocation)
|
property string homeDir: StandardPaths.writableLocation(StandardPaths.HomeLocation)
|
||||||
property string selectedFileName: ""
|
property string selectedFileName: ""
|
||||||
|
property var targetScreen: null
|
||||||
|
property string targetScreenName: targetScreen ? targetScreen.name : ""
|
||||||
|
|
||||||
signal requestTabChange(int newIndex)
|
signal requestTabChange(int newIndex)
|
||||||
|
|
||||||
|
function getCurrentWallpaper() {
|
||||||
|
if (SessionData.perMonitorWallpaper && targetScreenName) {
|
||||||
|
return SessionData.getMonitorWallpaper(targetScreenName)
|
||||||
|
}
|
||||||
|
return SessionData.wallpaperPath
|
||||||
|
}
|
||||||
|
|
||||||
|
function setCurrentWallpaper(path) {
|
||||||
|
if (SessionData.perMonitorWallpaper && targetScreenName) {
|
||||||
|
SessionData.setMonitorWallpaper(targetScreenName, path)
|
||||||
|
} else {
|
||||||
|
SessionData.setWallpaper(path)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onCurrentPageChanged: {
|
onCurrentPageChanged: {
|
||||||
if (currentPage !== lastPage) {
|
if (currentPage !== lastPage) {
|
||||||
enableAnimation = false
|
enableAnimation = false
|
||||||
@@ -71,7 +88,7 @@ Item {
|
|||||||
if (absoluteIndex < wallpaperFolderModel.count) {
|
if (absoluteIndex < wallpaperFolderModel.count) {
|
||||||
const filePath = wallpaperFolderModel.get(absoluteIndex, "filePath")
|
const filePath = wallpaperFolderModel.get(absoluteIndex, "filePath")
|
||||||
if (filePath) {
|
if (filePath) {
|
||||||
SessionData.setWallpaper(filePath.toString().replace(/^file:\/\//, ''))
|
setCurrentWallpaper(filePath.toString().replace(/^file:\/\//, ''))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -151,32 +168,39 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setInitialSelection() {
|
function setInitialSelection() {
|
||||||
if (!SessionData.wallpaperPath || wallpaperFolderModel.count === 0) {
|
const currentWallpaper = getCurrentWallpaper()
|
||||||
|
if (!currentWallpaper || wallpaperFolderModel.count === 0) {
|
||||||
gridIndex = 0
|
gridIndex = 0
|
||||||
updateSelectedFileName()
|
updateSelectedFileName()
|
||||||
Qt.callLater(() => { enableAnimation = true })
|
Qt.callLater(() => {
|
||||||
|
enableAnimation = true
|
||||||
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < wallpaperFolderModel.count; i++) {
|
for (var i = 0; i < wallpaperFolderModel.count; i++) {
|
||||||
const filePath = wallpaperFolderModel.get(i, "filePath")
|
const filePath = wallpaperFolderModel.get(i, "filePath")
|
||||||
if (filePath && filePath.toString().replace(/^file:\/\//, '') === SessionData.wallpaperPath) {
|
if (filePath && filePath.toString().replace(/^file:\/\//, '') === currentWallpaper) {
|
||||||
const targetPage = Math.floor(i / itemsPerPage)
|
const targetPage = Math.floor(i / itemsPerPage)
|
||||||
const targetIndex = i % itemsPerPage
|
const targetIndex = i % itemsPerPage
|
||||||
currentPage = targetPage
|
currentPage = targetPage
|
||||||
gridIndex = targetIndex
|
gridIndex = targetIndex
|
||||||
updateSelectedFileName()
|
updateSelectedFileName()
|
||||||
Qt.callLater(() => { enableAnimation = true })
|
Qt.callLater(() => {
|
||||||
|
enableAnimation = true
|
||||||
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gridIndex = 0
|
gridIndex = 0
|
||||||
updateSelectedFileName()
|
updateSelectedFileName()
|
||||||
Qt.callLater(() => { enableAnimation = true })
|
Qt.callLater(() => {
|
||||||
|
enableAnimation = true
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadWallpaperDirectory() {
|
function loadWallpaperDirectory() {
|
||||||
const currentWallpaper = SessionData.wallpaperPath
|
const currentWallpaper = getCurrentWallpaper()
|
||||||
|
|
||||||
if (!currentWallpaper || currentWallpaper.startsWith("#") || currentWallpaper.startsWith("we:")) {
|
if (!currentWallpaper || currentWallpaper.startsWith("#") || currentWallpaper.startsWith("we:")) {
|
||||||
if (CacheData.wallpaperLastPath && CacheData.wallpaperLastPath !== "") {
|
if (CacheData.wallpaperLastPath && CacheData.wallpaperLastPath !== "") {
|
||||||
@@ -216,6 +240,19 @@ Item {
|
|||||||
setInitialSelection()
|
setInitialSelection()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function onMonitorWallpapersChanged() {
|
||||||
|
loadWallpaperDirectory()
|
||||||
|
if (visible && active) {
|
||||||
|
setInitialSelection()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onTargetScreenNameChanged: {
|
||||||
|
loadWallpaperDirectory()
|
||||||
|
if (visible && active) {
|
||||||
|
setInitialSelection()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
@@ -267,18 +304,18 @@ Item {
|
|||||||
fileExtensions: ["*.jpg", "*.jpeg", "*.png", "*.bmp", "*.gif", "*.webp"]
|
fileExtensions: ["*.jpg", "*.jpeg", "*.png", "*.bmp", "*.gif", "*.webp"]
|
||||||
allowStacking: true
|
allowStacking: true
|
||||||
|
|
||||||
onFileSelected: (path) => {
|
onFileSelected: path => {
|
||||||
const cleanPath = path.replace(/^file:\/\//, '')
|
const cleanPath = path.replace(/^file:\/\//, '')
|
||||||
SessionData.setWallpaper(cleanPath)
|
setCurrentWallpaper(cleanPath)
|
||||||
|
|
||||||
const dirPath = cleanPath.substring(0, cleanPath.lastIndexOf('/'))
|
const dirPath = cleanPath.substring(0, cleanPath.lastIndexOf('/'))
|
||||||
if (dirPath) {
|
if (dirPath) {
|
||||||
wallpaperDir = dirPath
|
wallpaperDir = dirPath
|
||||||
CacheData.wallpaperLastPath = dirPath
|
CacheData.wallpaperLastPath = dirPath
|
||||||
CacheData.saveCache()
|
CacheData.saveCache()
|
||||||
}
|
}
|
||||||
close()
|
close()
|
||||||
}
|
}
|
||||||
|
|
||||||
onDialogClosed: {
|
onDialogClosed: {
|
||||||
Qt.callLater(() => wallpaperBrowserLoader.active = false)
|
Qt.callLater(() => wallpaperBrowserLoader.active = false)
|
||||||
@@ -327,7 +364,7 @@ Item {
|
|||||||
const startIndex = currentPage * itemsPerPage
|
const startIndex = currentPage * itemsPerPage
|
||||||
const endIndex = Math.min(startIndex + itemsPerPage, wallpaperFolderModel.count)
|
const endIndex = Math.min(startIndex + itemsPerPage, wallpaperFolderModel.count)
|
||||||
const items = []
|
const items = []
|
||||||
for (let i = startIndex; i < endIndex; i++) {
|
for (var i = startIndex; i < endIndex; i++) {
|
||||||
const filePath = wallpaperFolderModel.get(i, "filePath")
|
const filePath = wallpaperFolderModel.get(i, "filePath")
|
||||||
if (filePath) {
|
if (filePath) {
|
||||||
items.push(filePath.toString().replace(/^file:\/\//, ''))
|
items.push(filePath.toString().replace(/^file:\/\//, ''))
|
||||||
@@ -369,7 +406,7 @@ Item {
|
|||||||
height: wallpaperGrid.cellHeight
|
height: wallpaperGrid.cellHeight
|
||||||
|
|
||||||
property string wallpaperPath: modelData || ""
|
property string wallpaperPath: modelData || ""
|
||||||
property bool isSelected: SessionData.wallpaperPath === modelData
|
property bool isSelected: getCurrentWallpaper() === modelData
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: wallpaperCard
|
id: wallpaperCard
|
||||||
@@ -437,7 +474,7 @@ Item {
|
|||||||
onClicked: {
|
onClicked: {
|
||||||
gridIndex = index
|
gridIndex = index
|
||||||
if (modelData) {
|
if (modelData) {
|
||||||
SessionData.setWallpaper(modelData)
|
setCurrentWallpaper(modelData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,9 +136,7 @@ Item {
|
|||||||
var currentWallpaper = SessionData.perMonitorWallpaper ? SessionData.getMonitorWallpaper(selectedMonitorName) : SessionData.wallpaperPath
|
var currentWallpaper = SessionData.perMonitorWallpaper ? SessionData.getMonitorWallpaper(selectedMonitorName) : SessionData.wallpaperPath
|
||||||
if (currentWallpaper && currentWallpaper.startsWith("we:")) {
|
if (currentWallpaper && currentWallpaper.startsWith("we:")) {
|
||||||
var sceneId = currentWallpaper.substring(3)
|
var sceneId = currentWallpaper.substring(3)
|
||||||
return StandardPaths.writableLocation(StandardPaths.HomeLocation)
|
return StandardPaths.writableLocation(StandardPaths.HomeLocation) + "/.local/share/Steam/steamapps/workshop/content/431960/" + sceneId + "/preview" + weExtensions[weExtIndex]
|
||||||
+ "/.local/share/Steam/steamapps/workshop/content/431960/"
|
|
||||||
+ sceneId + "/preview" + weExtensions[weExtIndex]
|
|
||||||
}
|
}
|
||||||
return (currentWallpaper !== "" && !currentWallpaper.startsWith("#")) ? "file://" + currentWallpaper : ""
|
return (currentWallpaper !== "" && !currentWallpaper.startsWith("#")) ? "file://" + currentWallpaper : ""
|
||||||
}
|
}
|
||||||
@@ -147,10 +145,7 @@ Item {
|
|||||||
if (currentWallpaper && currentWallpaper.startsWith("we:") && status === Image.Error) {
|
if (currentWallpaper && currentWallpaper.startsWith("we:") && status === Image.Error) {
|
||||||
if (weExtIndex < weExtensions.length - 1) {
|
if (weExtIndex < weExtensions.length - 1) {
|
||||||
weExtIndex++
|
weExtIndex++
|
||||||
source = StandardPaths.writableLocation(StandardPaths.HomeLocation)
|
source = StandardPaths.writableLocation(StandardPaths.HomeLocation) + "/.local/share/Steam/steamapps/workshop/content/431960/" + currentWallpaper.substring(3) + "/preview" + weExtensions[weExtIndex]
|
||||||
+ "/.local/share/Steam/steamapps/workshop/content/431960/"
|
|
||||||
+ currentWallpaper.substring(3)
|
|
||||||
+ "/preview" + weExtensions[weExtIndex]
|
|
||||||
} else {
|
} else {
|
||||||
visible = false
|
visible = false
|
||||||
}
|
}
|
||||||
@@ -241,7 +236,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: 32
|
width: 32
|
||||||
height: 32
|
height: 32
|
||||||
@@ -263,7 +257,7 @@ Item {
|
|||||||
var currentWallpaper = SessionData.perMonitorWallpaper ? SessionData.getMonitorWallpaper(selectedMonitorName) : SessionData.wallpaperPath
|
var currentWallpaper = SessionData.perMonitorWallpaper ? SessionData.getMonitorWallpaper(selectedMonitorName) : SessionData.wallpaperPath
|
||||||
PopoutService.colorPickerModal.selectedColor = currentWallpaper.startsWith("#") ? currentWallpaper : Theme.primary
|
PopoutService.colorPickerModal.selectedColor = currentWallpaper.startsWith("#") ? currentWallpaper : Theme.primary
|
||||||
PopoutService.colorPickerModal.pickerTitle = "Choose Wallpaper Color"
|
PopoutService.colorPickerModal.pickerTitle = "Choose Wallpaper Color"
|
||||||
PopoutService.colorPickerModal.onColorSelectedCallback = function(selectedColor) {
|
PopoutService.colorPickerModal.onColorSelectedCallback = function (selectedColor) {
|
||||||
if (SessionData.perMonitorWallpaper) {
|
if (SessionData.perMonitorWallpaper) {
|
||||||
SessionData.setMonitorWallpaper(selectedMonitorName, selectedColor)
|
SessionData.setMonitorWallpaper(selectedMonitorName, selectedColor)
|
||||||
} else {
|
} else {
|
||||||
@@ -434,11 +428,11 @@ Item {
|
|||||||
return modes.indexOf(SettingsData.wallpaperFillMode)
|
return modes.indexOf(SettingsData.wallpaperFillMode)
|
||||||
}
|
}
|
||||||
onSelectionChanged: (index, selected) => {
|
onSelectionChanged: (index, selected) => {
|
||||||
if (selected) {
|
if (selected) {
|
||||||
const modes = ["Stretch", "Fit", "Fill", "Tile", "TileVertically", "TileHorizontally", "Pad"]
|
const modes = ["Stretch", "Fit", "Fill", "Tile", "TileVertically", "TileHorizontally", "Pad"]
|
||||||
SettingsData.setWallpaperFillMode(modes[index])
|
SettingsData.setWallpaperFillMode(modes[index])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: SettingsData
|
target: SettingsData
|
||||||
@@ -452,9 +446,9 @@ Item {
|
|||||||
target: personalizationTab
|
target: personalizationTab
|
||||||
function onSelectedMonitorNameChanged() {
|
function onSelectedMonitorNameChanged() {
|
||||||
Qt.callLater(() => {
|
Qt.callLater(() => {
|
||||||
const modes = ["Stretch", "Fit", "Fill", "Tile", "TileVertically", "TileHorizontally", "Pad"]
|
const modes = ["Stretch", "Fit", "Fill", "Tile", "TileVertically", "TileHorizontally", "Pad"]
|
||||||
fillModeGroup.currentIndex = modes.indexOf(SettingsData.wallpaperFillMode)
|
fillModeGroup.currentIndex = modes.indexOf(SettingsData.wallpaperFillMode)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -507,8 +501,8 @@ Item {
|
|||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
checked: SettingsData.blurWallpaperOnOverview
|
checked: SettingsData.blurWallpaperOnOverview
|
||||||
onToggled: checked => {
|
onToggled: checked => {
|
||||||
SettingsData.setBlurWallpaperOnOverview(checked)
|
SettingsData.setBlurWallpaperOnOverview(checked)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -641,7 +635,7 @@ Item {
|
|||||||
DankDropdown {
|
DankDropdown {
|
||||||
id: monitorDropdown
|
id: monitorDropdown
|
||||||
|
|
||||||
text: I18n.tr("Monitor")
|
text: I18n.tr("Wallpaper Monitor")
|
||||||
description: I18n.tr("Select monitor to configure wallpaper")
|
description: I18n.tr("Select monitor to configure wallpaper")
|
||||||
currentValue: selectedMonitorName || "No monitors"
|
currentValue: selectedMonitorName || "No monitors"
|
||||||
options: {
|
options: {
|
||||||
@@ -656,6 +650,36 @@ Item {
|
|||||||
selectedMonitorName = value
|
selectedMonitorName = value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DankDropdown {
|
||||||
|
id: matugenTargetDropdown
|
||||||
|
|
||||||
|
text: I18n.tr("Matugen Target Monitor")
|
||||||
|
description: I18n.tr("Monitor whose wallpaper drives dynamic theming colors")
|
||||||
|
currentValue: {
|
||||||
|
if (!SettingsData.matugenTargetMonitor || SettingsData.matugenTargetMonitor === "") {
|
||||||
|
var screens = Quickshell.screens
|
||||||
|
return screens.length > 0 ? screens[0].name + " (Default)" : "No monitors"
|
||||||
|
}
|
||||||
|
return SettingsData.matugenTargetMonitor
|
||||||
|
}
|
||||||
|
options: {
|
||||||
|
var screenNames = []
|
||||||
|
var screens = Quickshell.screens
|
||||||
|
for (var i = 0; i < screens.length; i++) {
|
||||||
|
var label = screens[i].name
|
||||||
|
if (i === 0 && (!SettingsData.matugenTargetMonitor || SettingsData.matugenTargetMonitor === "")) {
|
||||||
|
label += " (Default)"
|
||||||
|
}
|
||||||
|
screenNames.push(label)
|
||||||
|
}
|
||||||
|
return screenNames
|
||||||
|
}
|
||||||
|
onValueChanged: value => {
|
||||||
|
var cleanValue = value.replace(" (Default)", "")
|
||||||
|
SettingsData.setMatugenTargetMonitor(cleanValue)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -720,8 +744,8 @@ Item {
|
|||||||
target: personalizationTab
|
target: personalizationTab
|
||||||
function onSelectedMonitorNameChanged() {
|
function onSelectedMonitorNameChanged() {
|
||||||
cyclingToggle.checked = Qt.binding(() => {
|
cyclingToggle.checked = Qt.binding(() => {
|
||||||
return SessionData.perMonitorWallpaper ? SessionData.getMonitorCyclingSettings(selectedMonitorName).enabled : SessionData.wallpaperCyclingEnabled
|
return SessionData.perMonitorWallpaper ? SessionData.getMonitorCyclingSettings(selectedMonitorName).enabled : SessionData.wallpaperCyclingEnabled
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -779,12 +803,12 @@ Item {
|
|||||||
target: personalizationTab
|
target: personalizationTab
|
||||||
function onSelectedMonitorNameChanged() {
|
function onSelectedMonitorNameChanged() {
|
||||||
modeTabBar.currentIndex = Qt.binding(() => {
|
modeTabBar.currentIndex = Qt.binding(() => {
|
||||||
if (SessionData.perMonitorWallpaper) {
|
if (SessionData.perMonitorWallpaper) {
|
||||||
return SessionData.getMonitorCyclingSettings(selectedMonitorName).mode === "time" ? 1 : 0
|
return SessionData.getMonitorCyclingSettings(selectedMonitorName).mode === "time" ? 1 : 0
|
||||||
} else {
|
} else {
|
||||||
return SessionData.wallpaperCyclingMode === "time" ? 1 : 0
|
return SessionData.wallpaperCyclingMode === "time" ? 1 : 0
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
Qt.callLater(modeTabBar.updateIndicator)
|
Qt.callLater(modeTabBar.updateIndicator)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -835,15 +859,15 @@ Item {
|
|||||||
function onSelectedMonitorNameChanged() {
|
function onSelectedMonitorNameChanged() {
|
||||||
// Force dropdown to refresh its currentValue
|
// Force dropdown to refresh its currentValue
|
||||||
Qt.callLater(() => {
|
Qt.callLater(() => {
|
||||||
var currentSeconds
|
var currentSeconds
|
||||||
if (SessionData.perMonitorWallpaper) {
|
if (SessionData.perMonitorWallpaper) {
|
||||||
currentSeconds = SessionData.getMonitorCyclingSettings(selectedMonitorName).interval
|
currentSeconds = SessionData.getMonitorCyclingSettings(selectedMonitorName).interval
|
||||||
} else {
|
} else {
|
||||||
currentSeconds = SessionData.wallpaperCyclingInterval
|
currentSeconds = SessionData.wallpaperCyclingInterval
|
||||||
}
|
}
|
||||||
const index = intervalDropdown.intervalValues.indexOf(currentSeconds)
|
const index = intervalDropdown.intervalValues.indexOf(currentSeconds)
|
||||||
intervalDropdown.currentValue = index >= 0 ? intervalDropdown.intervalOptions[index] : "5 minutes"
|
intervalDropdown.currentValue = index >= 0 ? intervalDropdown.intervalOptions[index] : "5 minutes"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -925,12 +949,12 @@ Item {
|
|||||||
function onSelectedMonitorNameChanged() {
|
function onSelectedMonitorNameChanged() {
|
||||||
// Force text field to refresh its value
|
// Force text field to refresh its value
|
||||||
Qt.callLater(() => {
|
Qt.callLater(() => {
|
||||||
if (SessionData.perMonitorWallpaper) {
|
if (SessionData.perMonitorWallpaper) {
|
||||||
timeTextField.text = SessionData.getMonitorCyclingSettings(selectedMonitorName).time
|
timeTextField.text = SessionData.getMonitorCyclingSettings(selectedMonitorName).time
|
||||||
} else {
|
} else {
|
||||||
timeTextField.text = SessionData.wallpaperCyclingTime
|
timeTextField.text = SessionData.wallpaperCyclingTime
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -956,14 +980,15 @@ Item {
|
|||||||
text: I18n.tr("Transition Effect")
|
text: I18n.tr("Transition Effect")
|
||||||
description: I18n.tr("Visual effect used when wallpaper changes")
|
description: I18n.tr("Visual effect used when wallpaper changes")
|
||||||
currentValue: {
|
currentValue: {
|
||||||
if (SessionData.wallpaperTransition === "random") return "Random"
|
if (SessionData.wallpaperTransition === "random")
|
||||||
|
return "Random"
|
||||||
return SessionData.wallpaperTransition.charAt(0).toUpperCase() + SessionData.wallpaperTransition.slice(1)
|
return SessionData.wallpaperTransition.charAt(0).toUpperCase() + SessionData.wallpaperTransition.slice(1)
|
||||||
}
|
}
|
||||||
options: ["Random"].concat(SessionData.availableWallpaperTransitions.map(t => t.charAt(0).toUpperCase() + t.slice(1)))
|
options: ["Random"].concat(SessionData.availableWallpaperTransitions.map(t => t.charAt(0).toUpperCase() + t.slice(1)))
|
||||||
onValueChanged: value => {
|
onValueChanged: value => {
|
||||||
var transition = value.toLowerCase()
|
var transition = value.toLowerCase()
|
||||||
SessionData.setWallpaperTransition(transition)
|
SessionData.setWallpaperTransition(transition)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
@@ -995,17 +1020,17 @@ Item {
|
|||||||
currentSelection: SessionData.includedTransitions
|
currentSelection: SessionData.includedTransitions
|
||||||
|
|
||||||
onSelectionChanged: (index, selected) => {
|
onSelectionChanged: (index, selected) => {
|
||||||
const transition = model[index]
|
const transition = model[index]
|
||||||
let newIncluded = [...SessionData.includedTransitions]
|
let newIncluded = [...SessionData.includedTransitions]
|
||||||
|
|
||||||
if (selected && !newIncluded.includes(transition)) {
|
if (selected && !newIncluded.includes(transition)) {
|
||||||
newIncluded.push(transition)
|
newIncluded.push(transition)
|
||||||
} else if (!selected && newIncluded.includes(transition)) {
|
} else if (!selected && newIncluded.includes(transition)) {
|
||||||
newIncluded = newIncluded.filter(t => t !== transition)
|
newIncluded = newIncluded.filter(t => t !== transition)
|
||||||
}
|
}
|
||||||
|
|
||||||
SessionData.includedTransitions = newIncluded
|
SessionData.includedTransitions = newIncluded
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1065,8 +1090,8 @@ Item {
|
|||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
checked: SettingsData.blurredWallpaperLayer
|
checked: SettingsData.blurredWallpaperLayer
|
||||||
onToggled: checked => {
|
onToggled: checked => {
|
||||||
SettingsData.setBlurredWallpaperLayer(checked)
|
SettingsData.setBlurredWallpaperLayer(checked)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1122,9 +1147,9 @@ Item {
|
|||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
checked: SessionData.isLightMode
|
checked: SessionData.isLightMode
|
||||||
onToggleCompleted: checked => {
|
onToggleCompleted: checked => {
|
||||||
Theme.screenTransition()
|
Theme.screenTransition()
|
||||||
Theme.setLightMode(checked)
|
Theme.setLightMode(checked)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1176,10 +1201,10 @@ Item {
|
|||||||
selectionMode: "single"
|
selectionMode: "single"
|
||||||
currentIndex: SettingsData.animationSpeed
|
currentIndex: SettingsData.animationSpeed
|
||||||
onSelectionChanged: (index, selected) => {
|
onSelectionChanged: (index, selected) => {
|
||||||
if (selected) {
|
if (selected) {
|
||||||
SettingsData.setAnimationSpeed(index)
|
SettingsData.setAnimationSpeed(index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: SettingsData
|
target: SettingsData
|
||||||
@@ -1257,10 +1282,10 @@ Item {
|
|||||||
showValue: false
|
showValue: false
|
||||||
wheelEnabled: false
|
wheelEnabled: false
|
||||||
|
|
||||||
onSliderValueChanged: (newValue) => {
|
onSliderValueChanged: newValue => {
|
||||||
SettingsData.setAnimationSpeed(SettingsData.AnimationSpeed.Custom)
|
SettingsData.setAnimationSpeed(SettingsData.AnimationSpeed.Custom)
|
||||||
SettingsData.setCustomAnimationDuration(newValue)
|
SettingsData.setCustomAnimationDuration(newValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: SettingsData
|
target: SettingsData
|
||||||
@@ -1388,19 +1413,21 @@ Item {
|
|||||||
id: personalizationMatugenPaletteDropdown
|
id: personalizationMatugenPaletteDropdown
|
||||||
text: I18n.tr("Matugen Palette")
|
text: I18n.tr("Matugen Palette")
|
||||||
description: I18n.tr("Select the palette algorithm used for wallpaper-based colors")
|
description: I18n.tr("Select the palette algorithm used for wallpaper-based colors")
|
||||||
options: Theme.availableMatugenSchemes.map(function (option) { return option.label })
|
options: Theme.availableMatugenSchemes.map(function (option) {
|
||||||
|
return option.label
|
||||||
|
})
|
||||||
currentValue: Theme.getMatugenScheme(SettingsData.matugenScheme).label
|
currentValue: Theme.getMatugenScheme(SettingsData.matugenScheme).label
|
||||||
enabled: Theme.matugenAvailable
|
enabled: Theme.matugenAvailable
|
||||||
opacity: enabled ? 1 : 0.4
|
opacity: enabled ? 1 : 0.4
|
||||||
onValueChanged: value => {
|
onValueChanged: value => {
|
||||||
for (var i = 0; i < Theme.availableMatugenSchemes.length; i++) {
|
for (var i = 0; i < Theme.availableMatugenSchemes.length; i++) {
|
||||||
var option = Theme.availableMatugenSchemes[i]
|
var option = Theme.availableMatugenSchemes[i]
|
||||||
if (option.label === value) {
|
if (option.label === value) {
|
||||||
SettingsData.setMatugenScheme(option.value)
|
SettingsData.setMatugenScheme(option.value)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
@@ -1459,8 +1486,8 @@ Item {
|
|||||||
checked: SettingsData.runUserMatugenTemplates
|
checked: SettingsData.runUserMatugenTemplates
|
||||||
enabled: Theme.matugenAvailable
|
enabled: Theme.matugenAvailable
|
||||||
onToggled: checked => {
|
onToggled: checked => {
|
||||||
SettingsData.setRunUserMatugenTemplates(checked)
|
SettingsData.setRunUserMatugenTemplates(checked)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1528,8 +1555,8 @@ Item {
|
|||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
checked: SettingsData.soundsEnabled
|
checked: SettingsData.soundsEnabled
|
||||||
onToggled: checked => {
|
onToggled: checked => {
|
||||||
SettingsData.setSoundsEnabled(checked)
|
SettingsData.setSoundsEnabled(checked)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1576,8 +1603,8 @@ Item {
|
|||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
checked: SettingsData.useSystemSoundTheme
|
checked: SettingsData.useSystemSoundTheme
|
||||||
onToggled: checked => {
|
onToggled: checked => {
|
||||||
SettingsData.setUseSystemSoundTheme(checked)
|
SettingsData.setUseSystemSoundTheme(checked)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1598,10 +1625,10 @@ Item {
|
|||||||
return AudioService.availableSoundThemes.length > 0 ? AudioService.availableSoundThemes[0] : ""
|
return AudioService.availableSoundThemes.length > 0 ? AudioService.availableSoundThemes[0] : ""
|
||||||
}
|
}
|
||||||
onValueChanged: value => {
|
onValueChanged: value => {
|
||||||
if (value && value !== AudioService.currentSoundTheme) {
|
if (value && value !== AudioService.currentSoundTheme) {
|
||||||
AudioService.setSoundTheme(value)
|
AudioService.setSoundTheme(value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
@@ -1641,8 +1668,8 @@ Item {
|
|||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
checked: SettingsData.soundNewNotification
|
checked: SettingsData.soundNewNotification
|
||||||
onToggled: checked => {
|
onToggled: checked => {
|
||||||
SettingsData.setSoundNewNotification(checked)
|
SettingsData.setSoundNewNotification(checked)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1675,8 +1702,8 @@ Item {
|
|||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
checked: SettingsData.soundVolumeChanged
|
checked: SettingsData.soundVolumeChanged
|
||||||
onToggled: checked => {
|
onToggled: checked => {
|
||||||
SettingsData.setSoundVolumeChanged(checked)
|
SettingsData.setSoundVolumeChanged(checked)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1710,8 +1737,8 @@ Item {
|
|||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
checked: SettingsData.soundPluggedIn
|
checked: SettingsData.soundPluggedIn
|
||||||
onToggled: checked => {
|
onToggled: checked => {
|
||||||
SettingsData.setSoundPluggedIn(checked)
|
SettingsData.setSoundPluggedIn(checked)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user