Make wallpapers rounded in WallpaperSelector
This commit is contained in:
parent
bd056cc981
commit
4ebc4cd299
2 changed files with 16 additions and 41 deletions
|
|
@ -53,42 +53,15 @@ Item {
|
||||||
border.width: Math.max(1, Style.borderThin * scaling)
|
border.width: Math.max(1, Style.borderThin * scaling)
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
Image {
|
NImageRounded {
|
||||||
id: currentWallpaperImage
|
id: currentWallpaperImage
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: Style.marginSmall * scaling
|
anchors.margins: Style.marginSmall * scaling
|
||||||
source: Wallpapers.currentWallpaper
|
imagePath: Wallpapers.currentWallpaper
|
||||||
fillMode: Image.PreserveAspectCrop
|
fallbackIcon: "image"
|
||||||
asynchronous: true
|
borderColor: Colors.outline
|
||||||
cache: true
|
borderWidth: Math.max(1, Style.borderThin * scaling)
|
||||||
}
|
imageRadius: Style.radiusMedium * scaling
|
||||||
|
|
||||||
// Fallback if no image
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Style.marginSmall * scaling
|
|
||||||
color: Colors.backgroundTertiary
|
|
||||||
radius: Style.radiusSmall * scaling
|
|
||||||
visible: currentWallpaperImage.status !== Image.Ready
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
spacing: Style.marginSmall * scaling
|
|
||||||
|
|
||||||
NText {
|
|
||||||
text: "image"
|
|
||||||
font.family: "Material Symbols Outlined"
|
|
||||||
font.pointSize: Style.fontSizeLarge * scaling
|
|
||||||
color: Colors.textSecondary
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
NText {
|
|
||||||
text: "No wallpaper selected"
|
|
||||||
color: Colors.textSecondary
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -180,14 +153,14 @@ Item {
|
||||||
border.width: Math.max(1, Style.borderThin * scaling)
|
border.width: Math.max(1, Style.borderThin * scaling)
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
Image {
|
NImageRounded {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: Style.marginTiny * scaling
|
anchors.margins: Style.marginTiny * scaling
|
||||||
source: wallpaperPath
|
imagePath: wallpaperPath
|
||||||
fillMode: Image.PreserveAspectCrop
|
fallbackIcon: "image"
|
||||||
asynchronous: true
|
borderColor: "transparent"
|
||||||
cache: true
|
borderWidth: 0
|
||||||
smooth: true
|
imageRadius: Style.radiusMedium * scaling
|
||||||
}
|
}
|
||||||
|
|
||||||
// Selection indicator
|
// Selection indicator
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,10 @@ import Quickshell.Widgets
|
||||||
import qs.Services
|
import qs.Services
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
id: root
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
radius: width * 0.5
|
property real imageRadius: width * 0.5
|
||||||
|
radius: imageRadius
|
||||||
|
|
||||||
readonly property real scaling: Scaling.scale(screen)
|
readonly property real scaling: Scaling.scale(screen)
|
||||||
property string imagePath: ""
|
property string imagePath: ""
|
||||||
|
|
@ -52,7 +54,7 @@ Rectangle {
|
||||||
visible: false
|
visible: false
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
radius: img.width * 0.5
|
radius: root.imageRadius
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue