mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-25 05:52:50 -05:00
Per light-mode/dark-mode wallpaper option
This commit is contained in:
@@ -391,6 +391,63 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
// Per-Mode Wallpaper Section - Full Width
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: 1
|
||||
color: Theme.outline
|
||||
opacity: 0.2
|
||||
visible: SessionData.wallpaperPath !== ""
|
||||
}
|
||||
|
||||
Column {
|
||||
width: parent.width
|
||||
spacing: Theme.spacingM
|
||||
visible: SessionData.wallpaperPath !== ""
|
||||
|
||||
Row {
|
||||
width: parent.width
|
||||
spacing: Theme.spacingM
|
||||
|
||||
DankIcon {
|
||||
name: "brightness_6"
|
||||
size: Theme.iconSize
|
||||
color: SessionData.perModeWallpaper ? Theme.primary : Theme.surfaceVariantText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Column {
|
||||
width: parent.width - Theme.iconSize - Theme.spacingM - perModeToggle.width - Theme.spacingM
|
||||
spacing: Theme.spacingXS
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
StyledText {
|
||||
text: "Per-Mode Wallpapers"
|
||||
font.pixelSize: Theme.fontSizeLarge
|
||||
font.weight: Font.Medium
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: "Set different wallpapers for light and dark mode"
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
width: parent.width
|
||||
}
|
||||
}
|
||||
|
||||
DankToggle {
|
||||
id: perModeToggle
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SessionData.perModeWallpaper
|
||||
onToggled: toggled => {
|
||||
return SessionData.setPerModeWallpaper(toggled)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Per-Monitor Wallpaper Section - Full Width
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
@@ -482,19 +539,18 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
// Wallpaper Cycling Section - Full Width
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: 1
|
||||
color: Theme.outline
|
||||
opacity: 0.2
|
||||
visible: SessionData.wallpaperPath !== "" || SessionData.perMonitorWallpaper
|
||||
visible: (SessionData.wallpaperPath !== "" || SessionData.perMonitorWallpaper) && !SessionData.perModeWallpaper
|
||||
}
|
||||
|
||||
Column {
|
||||
width: parent.width
|
||||
spacing: Theme.spacingM
|
||||
visible: SessionData.wallpaperPath !== "" || SessionData.perMonitorWallpaper
|
||||
visible: (SessionData.wallpaperPath !== "" || SessionData.perMonitorWallpaper) && !SessionData.perModeWallpaper
|
||||
|
||||
Row {
|
||||
width: parent.width
|
||||
@@ -551,7 +607,6 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
// Cycling mode and settings
|
||||
Column {
|
||||
width: parent.width
|
||||
spacing: Theme.spacingS
|
||||
|
||||
@@ -38,6 +38,18 @@ LazyLoader {
|
||||
property bool isColorSource: source.startsWith("#")
|
||||
property string transitionType: SessionData.wallpaperTransition
|
||||
property string actualTransitionType: transitionType
|
||||
|
||||
Connections {
|
||||
target: SessionData
|
||||
function onIsLightModeChanged() {
|
||||
if (SessionData.perModeWallpaper) {
|
||||
var newSource = SessionData.getMonitorWallpaper(modelData.name) || ""
|
||||
if (newSource !== root.source) {
|
||||
root.source = newSource
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
onTransitionTypeChanged: {
|
||||
if (transitionType === "random") {
|
||||
if (SessionData.includedTransitions.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user