Replaced Image {} per IconImage {} where applicable

This commit is contained in:
Sébastien Atoch 2025-08-03 08:49:03 -04:00
parent e2d02afc9a
commit 2f14dba144
13 changed files with 69 additions and 127 deletions

View file

@ -2,6 +2,8 @@ import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import Qt5Compat.GraphicalEffects
import Quickshell.Widgets
import qs.Components
import qs.Settings
Rectangle {
@ -61,39 +63,7 @@ Rectangle {
border.color: profileImageInput.activeFocus ? Theme.accentPrimary : Theme.outline
border.width: 1
Image {
id: avatarImage
anchors.fill: parent
anchors.margins: 2
source: Settings.settings.profileImage
fillMode: Image.PreserveAspectCrop
visible: false
asynchronous: true
cache: false
smooth: true
mipmap: true
}
OpacityMask {
anchors.fill: avatarImage
source: avatarImage
maskSource: Rectangle {
width: avatarImage.width
height: avatarImage.height
radius: avatarImage.width / 2
visible: false
}
visible: Settings.settings.profileImage !== ""
}
Text {
anchors.centerIn: parent
text: "person"
font.family: "Material Symbols Outlined"
font.pixelSize: 20
color: Theme.accentPrimary
visible: Settings.settings.profileImage === ""
}
Avatar {}
}
Rectangle {

View file

@ -4,6 +4,7 @@ import QtQuick.Controls
import Qt5Compat.GraphicalEffects
import Quickshell
import Quickshell.Io
import Quickshell.Widgets
import qs.Settings
import qs.Widgets
import qs.Widgets.LockScreen
@ -51,38 +52,7 @@ Rectangle {
z: 2
}
OpacityMask {
anchors.fill: parent
source: Image {
id: avatarImage
anchors.fill: parent
source: Settings.settings.profileImage !== undefined ? Settings.settings.profileImage : ""
fillMode: Image.PreserveAspectCrop
asynchronous: true
cache: false
smooth: true
mipmap: true
}
maskSource: Rectangle {
width: 44
height: 44
radius: 22
visible: false
}
visible: Settings.settings.profileImage !== undefined && Settings.settings.profileImage !== ""
z: 1
}
// Fallback icon
Text {
anchors.centerIn: parent
text: "person"
font.family: "Material Symbols Outlined"
font.pixelSize: 24
color: Theme.onAccent
visible: Settings.settings.profileImage === undefined || Settings.settings.profileImage === ""
z: 0
}
Avatar {}
}
// User info text

View file

@ -136,12 +136,9 @@ PanelWindow {
source: modelData
fillMode: Image.PreserveAspectCrop
asynchronous: true
cache: false
cache: true
smooth: true
mipmap: true
// Limit memory usage
sourceSize.width: Math.min(width, 480)
sourceSize.height: Math.min(height, 270)
}
MouseArea {
anchors.fill: parent