mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-29 16:02:51 -05:00
replace qmlformat with a better tool
still not perfect, but well - what can ya do
This commit is contained in:
@@ -6,132 +6,132 @@ import qs.Common
|
||||
import qs.Widgets
|
||||
|
||||
LazyLoader {
|
||||
active: SessionData.wallpaperPath !== ""
|
||||
active: SessionData.wallpaperPath !== ""
|
||||
|
||||
Variants {
|
||||
model: Quickshell.screens
|
||||
Variants {
|
||||
model: Quickshell.screens
|
||||
|
||||
PanelWindow {
|
||||
id: wallpaperWindow
|
||||
PanelWindow {
|
||||
id: wallpaperWindow
|
||||
|
||||
required property var modelData
|
||||
required property var modelData
|
||||
|
||||
screen: modelData
|
||||
screen: modelData
|
||||
|
||||
WlrLayershell.layer: WlrLayer.Background
|
||||
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
||||
WlrLayershell.layer: WlrLayer.Background
|
||||
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
||||
|
||||
anchors.top: true
|
||||
anchors.bottom: true
|
||||
anchors.left: true
|
||||
anchors.right: true
|
||||
anchors.top: true
|
||||
anchors.bottom: true
|
||||
anchors.left: true
|
||||
anchors.right: true
|
||||
|
||||
color: "black"
|
||||
color: "black"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
anchors.fill: parent
|
||||
Item {
|
||||
id: root
|
||||
anchors.fill: parent
|
||||
|
||||
property string source: SessionData.wallpaperPath || ""
|
||||
property Image current: one
|
||||
property string source: SessionData.wallpaperPath || ""
|
||||
property Image current: one
|
||||
|
||||
onSourceChanged: {
|
||||
if (!source)
|
||||
current = null;
|
||||
else if (current === one)
|
||||
two.update();
|
||||
else
|
||||
one.update();
|
||||
}
|
||||
|
||||
Loader {
|
||||
anchors.fill: parent
|
||||
active: !root.source
|
||||
asynchronous: true
|
||||
|
||||
sourceComponent: Rectangle {
|
||||
color: Theme.surface
|
||||
|
||||
Row {
|
||||
anchors.centerIn: parent
|
||||
spacing: Theme.spacingL
|
||||
|
||||
DankIcon {
|
||||
name: "sentiment_stressed"
|
||||
color: Theme.surfaceVariantText
|
||||
size: Theme.iconSize * 5
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Theme.spacingS
|
||||
|
||||
StyledText {
|
||||
text: "Wallpaper missing?"
|
||||
color: Theme.surfaceVariantText
|
||||
font.pixelSize: Theme.fontSizeXLarge * 2
|
||||
font.weight: Font.Bold
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: "Set wallpaper in Settings"
|
||||
color: Theme.primary
|
||||
font.pixelSize: Theme.fontSizeLarge
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Img {
|
||||
id: one
|
||||
}
|
||||
|
||||
Img {
|
||||
id: two
|
||||
}
|
||||
|
||||
component Img: Image {
|
||||
id: img
|
||||
|
||||
function update(): void {
|
||||
source = "";
|
||||
source = root.source;
|
||||
}
|
||||
|
||||
anchors.fill: parent
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
smooth: true
|
||||
asynchronous: true
|
||||
cache: true
|
||||
|
||||
opacity: 0
|
||||
|
||||
onStatusChanged: {
|
||||
if (status === Image.Ready)
|
||||
root.current = this;
|
||||
}
|
||||
|
||||
states: State {
|
||||
name: "visible"
|
||||
when: root.current === img
|
||||
|
||||
PropertyChanges {
|
||||
img.opacity: 1
|
||||
}
|
||||
}
|
||||
|
||||
transitions: Transition {
|
||||
NumberAnimation {
|
||||
target: img
|
||||
properties: "opacity"
|
||||
duration: Theme.mediumDuration
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
onSourceChanged: {
|
||||
if (!source)
|
||||
current = null
|
||||
else if (current === one)
|
||||
two.update()
|
||||
else
|
||||
one.update()
|
||||
}
|
||||
|
||||
Loader {
|
||||
anchors.fill: parent
|
||||
active: !root.source
|
||||
asynchronous: true
|
||||
|
||||
sourceComponent: Rectangle {
|
||||
color: Theme.surface
|
||||
|
||||
Row {
|
||||
anchors.centerIn: parent
|
||||
spacing: Theme.spacingL
|
||||
|
||||
DankIcon {
|
||||
name: "sentiment_stressed"
|
||||
color: Theme.surfaceVariantText
|
||||
size: Theme.iconSize * 5
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Theme.spacingS
|
||||
|
||||
StyledText {
|
||||
text: "Wallpaper missing?"
|
||||
color: Theme.surfaceVariantText
|
||||
font.pixelSize: Theme.fontSizeXLarge * 2
|
||||
font.weight: Font.Bold
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: "Set wallpaper in Settings"
|
||||
color: Theme.primary
|
||||
font.pixelSize: Theme.fontSizeLarge
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Img {
|
||||
id: one
|
||||
}
|
||||
|
||||
Img {
|
||||
id: two
|
||||
}
|
||||
|
||||
component Img: Image {
|
||||
id: img
|
||||
|
||||
function update(): void {
|
||||
source = ""
|
||||
source = root.source
|
||||
}
|
||||
|
||||
anchors.fill: parent
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
smooth: true
|
||||
asynchronous: true
|
||||
cache: true
|
||||
|
||||
opacity: 0
|
||||
|
||||
onStatusChanged: {
|
||||
if (status === Image.Ready)
|
||||
root.current = this
|
||||
}
|
||||
|
||||
states: State {
|
||||
name: "visible"
|
||||
when: root.current === img
|
||||
|
||||
PropertyChanges {
|
||||
img.opacity: 1
|
||||
}
|
||||
}
|
||||
|
||||
transitions: Transition {
|
||||
NumberAnimation {
|
||||
target: img
|
||||
properties: "opacity"
|
||||
duration: Theme.mediumDuration
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user