Launcher: improved clipboard images look

This commit is contained in:
LemmyCook 2025-09-03 10:43:00 -04:00
parent 7b2d490ba7
commit 24620210fe
3 changed files with 12 additions and 14 deletions

View file

@ -295,30 +295,24 @@ NPanel {
color: Color.mSurfaceVariant
clip: true
// Image preview for clipboard images
Image {
NImageRounded {
id: imagePreview
anchors.fill: parent
anchors.margins: 2 * scaling
visible: modelData.isImage
imageRadius: Style.radiusM * scaling
// This property creates a dependency on the service's revision counter
readonly property int _rev: ClipboardService.revision
// Fetches from the service's cache.
// The dependency on `_rev` ensures this binding is re-evaluated
// when the cache is updated by the service.
source: {
// The dependency on `_rev` ensures this binding is re-evaluated when the cache is updated.
imagePath: {
_rev
return ClipboardService.getImageData(modelData.clipboardId) || ""
}
fillMode: Image.PreserveAspectFit
smooth: true
mipmap: true
asynchronous: true
cache: true
// Loading indicator
Rectangle {
anchors.fill: parent
@ -379,8 +373,8 @@ NPanel {
anchors.margins: 2 * scaling
width: formatLabel.width + 6 * scaling
height: formatLabel.height + 2 * scaling
radius: 2 * scaling
color: Qt.rgba(0, 0, 0, 0.7)
radius: Style.radiusM * scaling
color: Color.mSurfaceVariant
NText {
id: formatLabel

View file

@ -22,7 +22,7 @@ Item {
Connections {
target: ClipboardService
function onListCompleted() {
if (gotResults) {
if (gotResults && (lastSearchText === searchText)) {
// Do not update results after the first fetch.
// This will avoid the list resetting every 2seconds when the service updates.
return

View file

@ -16,6 +16,8 @@ Rectangle {
property real scaledRadius: imageRadius * Settings.data.general.radiusRatio
signal statusChanged(int status)
color: Color.transparent
radius: scaledRadius
anchors.margins: Style.marginXXS * scaling
@ -34,6 +36,8 @@ Rectangle {
asynchronous: true
antialiasing: true
fillMode: Image.PreserveAspectCrop
onStatusChanged: root.statusChanged(status)
}
ShaderEffect {