feat: add wallpaperEnabled option (#1187)
* fix: change background color to none allowing other wallpaper engine and background enabled * feat: add wallpaperEnabled property and toggle in appearance settings * fix background: Make it "black" if wallpaper is enabled, otherwise "transparent" * fix: separate Visualiser from Wallpaper (hope I didn't made more shit buh) * fix: transparency not working & layer position * fix --------- Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
This commit is contained in:
parent
40a2552830
commit
69adb92087
7 changed files with 24 additions and 6 deletions
|
|
@ -2,6 +2,7 @@ import Quickshell.Io
|
||||||
|
|
||||||
JsonObject {
|
JsonObject {
|
||||||
property bool enabled: true
|
property bool enabled: true
|
||||||
|
property bool wallpaperEnabled: true
|
||||||
property DesktopClock desktopClock: DesktopClock {}
|
property DesktopClock desktopClock: DesktopClock {}
|
||||||
property Visualiser visualiser: Visualiser {}
|
property Visualiser visualiser: Visualiser {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -160,6 +160,7 @@ Singleton {
|
||||||
function serializeBackground(): var {
|
function serializeBackground(): var {
|
||||||
return {
|
return {
|
||||||
enabled: background.enabled,
|
enabled: background.enabled,
|
||||||
|
wallpaperEnabled: background.wallpaperEnabled,
|
||||||
desktopClock: {
|
desktopClock: {
|
||||||
enabled: background.desktopClock.enabled,
|
enabled: background.desktopClock.enabled,
|
||||||
scale: background.desktopClock.scale,
|
scale: background.desktopClock.scale,
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,9 @@ Loader {
|
||||||
screen: modelData
|
screen: modelData
|
||||||
name: "background"
|
name: "background"
|
||||||
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
||||||
WlrLayershell.layer: WlrLayer.Background
|
WlrLayershell.layer: Config.background.wallpaperEnabled ? WlrLayer.Background : WlrLayer.Bottom
|
||||||
color: "black"
|
color: Config.background.wallpaperEnabled ? "black" : "transparent"
|
||||||
|
surfaceFormat.opaque: false
|
||||||
|
|
||||||
anchors.top: true
|
anchors.top: true
|
||||||
anchors.bottom: true
|
anchors.bottom: true
|
||||||
|
|
@ -35,8 +36,13 @@ Loader {
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
Wallpaper {
|
Loader {
|
||||||
id: wallpaper
|
id: wallpaper
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
active: Config.background.wallpaperEnabled
|
||||||
|
|
||||||
|
sourceComponent: Wallpaper {}
|
||||||
}
|
}
|
||||||
|
|
||||||
Visualiser {
|
Visualiser {
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property ShellScreen screen
|
required property ShellScreen screen
|
||||||
required property Wallpaper wallpaper
|
required property Item wallpaper
|
||||||
|
|
||||||
readonly property bool shouldBeActive: Config.background.visualiser.enabled && (!Config.background.visualiser.autoHide || (Hypr.monitorFor(screen)?.activeWorkspace?.toplevels?.values.every(t => t.lastIpcObject?.floating) ?? true))
|
readonly property bool shouldBeActive: Config.background.visualiser.enabled && (!Config.background.visualiser.autoHide || (Hypr.monitorFor(screen)?.activeWorkspace?.toplevels?.values.every(t => t.lastIpcObject?.floating) ?? true))
|
||||||
property real offset: shouldBeActive ? 0 : screen.height * 0.2
|
property real offset: shouldBeActive ? 0 : screen.height * 0.2
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,6 @@ Item {
|
||||||
property string source: Wallpapers.current
|
property string source: Wallpapers.current
|
||||||
property Image current: one
|
property Image current: one
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
onSourceChanged: {
|
onSourceChanged: {
|
||||||
if (!source)
|
if (!source)
|
||||||
current = null;
|
current = null;
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ Item {
|
||||||
property bool desktopClockBackgroundBlur: Config.background.desktopClock.background.blur ?? false
|
property bool desktopClockBackgroundBlur: Config.background.desktopClock.background.blur ?? false
|
||||||
property bool desktopClockInvertColors: Config.background.desktopClock.invertColors ?? false
|
property bool desktopClockInvertColors: Config.background.desktopClock.invertColors ?? false
|
||||||
property bool backgroundEnabled: Config.background.enabled ?? true
|
property bool backgroundEnabled: Config.background.enabled ?? true
|
||||||
|
property bool wallpaperEnabled: Config.background.wallpaperEnabled ?? true
|
||||||
property bool visualiserEnabled: Config.background.visualiser.enabled ?? false
|
property bool visualiserEnabled: Config.background.visualiser.enabled ?? false
|
||||||
property bool visualiserAutoHide: Config.background.visualiser.autoHide ?? true
|
property bool visualiserAutoHide: Config.background.visualiser.autoHide ?? true
|
||||||
property real visualiserRounding: Config.background.visualiser.rounding ?? 1
|
property real visualiserRounding: Config.background.visualiser.rounding ?? 1
|
||||||
|
|
@ -83,6 +84,8 @@ Item {
|
||||||
Config.background.desktopClock.background.blur = root.desktopClockBackgroundBlur;
|
Config.background.desktopClock.background.blur = root.desktopClockBackgroundBlur;
|
||||||
Config.background.desktopClock.invertColors = root.desktopClockInvertColors;
|
Config.background.desktopClock.invertColors = root.desktopClockInvertColors;
|
||||||
|
|
||||||
|
Config.background.wallpaperEnabled = root.wallpaperEnabled;
|
||||||
|
|
||||||
Config.background.visualiser.enabled = root.visualiserEnabled;
|
Config.background.visualiser.enabled = root.visualiserEnabled;
|
||||||
Config.background.visualiser.autoHide = root.visualiserAutoHide;
|
Config.background.visualiser.autoHide = root.visualiserAutoHide;
|
||||||
Config.background.visualiser.rounding = root.visualiserRounding;
|
Config.background.visualiser.rounding = root.visualiserRounding;
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,15 @@ CollapsibleSection {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SwitchRow {
|
||||||
|
label: qsTr("Wallpaper enabled")
|
||||||
|
checked: rootPane.wallpaperEnabled
|
||||||
|
onToggled: checked => {
|
||||||
|
rootPane.wallpaperEnabled = checked;
|
||||||
|
rootPane.saveConfig();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
Layout.topMargin: Appearance.spacing.normal
|
Layout.topMargin: Appearance.spacing.normal
|
||||||
text: qsTr("Desktop Clock")
|
text: qsTr("Desktop Clock")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue