mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Wallpapers: added thumbnail caching. Had to drop the rounded borders for it to work.
NImageCached relies on the image being visible to work properly. MultiEffect relies on the image being invisible to apply effects. That's why we don't have rounded corners here, as we don't want to bring back qt5compat.
This commit is contained in:
@@ -135,27 +135,32 @@ Item {
|
||||
|
||||
delegate: Rectangle {
|
||||
id: wallpaperItem
|
||||
|
||||
property string wallpaperPath: modelData
|
||||
property bool isSelected: wallpaperPath === WallpaperService.currentWallpaper
|
||||
|
||||
width: wallpaperGridView.itemSize
|
||||
height: Math.floor(wallpaperGridView.itemSize * 0.67)
|
||||
radius: Style.radiusMedium * scaling
|
||||
color: isSelected ? Color.mPrimary : Color.mSurface
|
||||
border.color: isSelected ? Color.mSecondary : Color.mOutline
|
||||
border.width: Math.max(1, Style.borderThin * scaling)
|
||||
clip: true
|
||||
color: Color.transparent
|
||||
|
||||
NImageRounded {
|
||||
anchors.fill: parent
|
||||
anchors.margins: Style.marginTiny * scaling
|
||||
// NImageCached relies on the image being visible to work properly.
|
||||
// MultiEffect relies on the image being invisible to apply effects.
|
||||
// That's why we don't have rounded corners here, as we don't want to bring back qt5compat.
|
||||
NImageCached {
|
||||
id: img
|
||||
imagePath: wallpaperPath
|
||||
fallbackIcon: "image"
|
||||
|
||||
imageRadius: Style.radiusMedium * scaling
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
// Selection indicator
|
||||
// Borders on top
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: Color.transparent
|
||||
border.color: isSelected ? Color.mPrimary : Color.mOutline
|
||||
border.width: Math.max(1, Style.borderThick * scaling)
|
||||
}
|
||||
|
||||
// Selection tick-mark
|
||||
Rectangle {
|
||||
anchors.top: parent.top
|
||||
anchors.right: parent.right
|
||||
|
||||
Reference in New Issue
Block a user