NImageRounded/Circled: removed shaders and used a simpler ClippingWrapperRectangle

This commit is contained in:
ItsLemmy
2025-11-25 19:38:23 -05:00
parent 12fe6c5559
commit b7d4e74012
15 changed files with 69 additions and 258 deletions
+5 -3
View File
@@ -409,16 +409,17 @@ Item {
anchors.fill: parent
anchors.margins: showProgressRing ? (3 * scaling) : 0.5 // Adjusted to align with progress circle better
NImageCircled {
NImageRounded {
id: trackArt
anchors.fill: parent
anchors.margins: showProgressRing ? 0 : -1 * scaling // Add negative margin to make album art larger when no progress ring
radius: width * 0.5
visible: showAlbumArt && hasActivePlayer
imagePath: MediaService.trackArtUrl
fallbackIcon: MediaService.isPlaying ? "media-pause" : "media-play"
fallbackIconSize: showProgressRing ? 10 : 12 // Larger fallback icon when no progress ring
borderWidth: 0
border.color: Color.transparent
borderColor: Color.transparent
z: 1 // In front of the progress circle
}
@@ -649,9 +650,10 @@ Item {
z: 1 // Above the visualizer and progress ring
// Album Art
NImageCircled {
NImageRounded {
anchors.fill: parent
visible: showAlbumArt && hasActivePlayer
radius: width * 0.5
imagePath: MediaService.trackArtUrl
fallbackIcon: MediaService.isPlaying ? "media-pause" : "media-play"
fallbackIconSize: 12
+4 -2
View File
@@ -301,10 +301,11 @@ Loader {
}
}
NImageCircled {
NImageRounded {
anchors.centerIn: parent
width: 66
height: 66
radius: width * 0.5
imagePath: Settings.preprocessPath(Settings.data.general.avatarImage)
fallbackIcon: "person"
@@ -631,9 +632,10 @@ Loader {
color: Color.transparent
clip: true
NImageCircled {
NImageRounded {
anchors.fill: parent
anchors.margins: 2
radius: width * 0.5
imagePath: MediaService.trackArtUrl
fallbackIcon: "disc"
fallbackIconSize: Style.fontSizeM
+10 -11
View File
@@ -398,17 +398,16 @@ Variants {
Layout.topMargin: Style.marginM
Layout.bottomMargin: Style.marginM
ColumnLayout {
NImageCircled {
Layout.preferredWidth: Math.round(40 * Style.uiScaleRatio)
Layout.preferredHeight: Math.round(40 * Style.uiScaleRatio)
Layout.alignment: Qt.AlignVCenter
imagePath: model.originalImage || ""
borderColor: Color.transparent
borderWidth: 0
fallbackIcon: "bell"
fallbackIconSize: 24
}
NImageRounded {
Layout.preferredWidth: Math.round(40 * Style.uiScaleRatio)
Layout.preferredHeight: Math.round(40 * Style.uiScaleRatio)
Layout.alignment: Qt.AlignVCenter
radius: width * 0.5
imagePath: model.originalImage || ""
borderColor: Color.transparent
borderWidth: 0
fallbackIcon: "bell"
fallbackIconSize: 24
}
ColumnLayout {
@@ -25,9 +25,10 @@ NBox {
anchors.margins: Style.marginM
spacing: Style.marginM
NImageCircled {
NImageRounded {
Layout.preferredWidth: Math.round(Style.baseWidgetSize * 1.25 * Style.uiScaleRatio)
Layout.preferredHeight: Math.round(Style.baseWidgetSize * 1.25 * Style.uiScaleRatio)
radius: width * 0.5
imagePath: Settings.preprocessPath(Settings.data.general.avatarImage)
fallbackIcon: "person"
borderColor: Color.mPrimary
+2 -2
View File
@@ -689,7 +689,7 @@ SmartPanel {
id: imagePreview
anchors.fill: parent
visible: modelData.isImage && !modelData.emojiChar
imageRadius: Style.radiusM
radius: Style.radiusM
// This property creates a dependency on the service's revision counter
readonly property int _rev: ClipboardService.revision
@@ -934,7 +934,7 @@ SmartPanel {
id: gridImagePreview
anchors.fill: parent
visible: modelData.isImage && !modelData.emojiChar
imageRadius: Style.radiusM
radius: Style.radiusM
readonly property int _rev: ClipboardService.revision
@@ -197,10 +197,11 @@ SmartPanel {
spacing: Style.marginM
// Icon
NImageCircled {
NImageRounded {
anchors.verticalCenter: parent.verticalCenter
width: Math.round(40 * Style.uiScaleRatio)
height: Math.round(40 * Style.uiScaleRatio)
anchors.verticalCenter: parent.verticalCenter
radius: width * 0.5
imagePath: model.cachedImage || model.originalImage || ""
borderColor: Color.transparent
borderWidth: 0
@@ -59,10 +59,11 @@ ColumnLayout {
description: I18n.tr("bar.widget-settings.control-center.icon.description")
}
NImageCircled {
NImageRounded {
Layout.preferredWidth: Style.fontSizeXL * 2
Layout.preferredHeight: Style.fontSizeXL * 2
Layout.alignment: Qt.AlignVCenter
radius: width * 0.5
imagePath: valueCustomIconPath
visible: valueCustomIconPath !== ""
}
+3 -2
View File
@@ -189,10 +189,11 @@ ColumnLayout {
Layout.preferredWidth: Style.baseWidgetSize * 2 * Style.uiScaleRatio
Layout.preferredHeight: Style.baseWidgetSize * 2 * Style.uiScaleRatio
NImageCircled {
imagePath: modelData.avatar_url || ""
NImageRounded {
anchors.fill: parent
anchors.margins: Style.marginXS
radius: width * 0.5
imagePath: modelData.avatar_url || ""
fallbackIcon: "person"
borderColor: contributorArea.containsMouse ? Color.mOnHover : Color.mPrimary
borderWidth: Style.borderM
+2 -1
View File
@@ -21,9 +21,10 @@ ColumnLayout {
spacing: Style.marginL
// Avatar preview
NImageCircled {
NImageRounded {
Layout.preferredWidth: 88 * Style.uiScaleRatio
Layout.preferredHeight: width
radius: width * 0.5
imagePath: Settings.preprocessPath(Settings.data.general.avatarImage)
fallbackIcon: "person"
borderColor: Color.mPrimary