noctalia-shell/Components/Avatar.qml
Quadbyte de94d94265
Wallpaper refining (#81)
* Wallpaper refining

- Swww: allow all images formats supported by Swww but only show the one
we can render in the panel
- Fix: timer should be restarted when selecting a wallpaper
- Fix: avoid recomputing selected thumbnail by altering the border width
- Removed LazyLoader as it was not helping

* Wallpapers changes

- revert: maintaining a single list all wallpapers, support only basic
images format.
- settings: reordered wallpapers settings and made the Swww settings
conditionals to activating the useSWWW toggle

* Fix broken avatar display in Panel, Settings and LockScreen

---------

Co-authored-by: Sébastien Atoch <sebastien@atracktiv.com>
2025-08-03 20:37:13 +01:00

54 lines
1.2 KiB
QML

import QtQuick
import Quickshell
import Quickshell.Widgets
import qs.Settings
import QtQuick.Effects
Item {
anchors.fill: parent
anchors.leftMargin: 2
anchors.rightMargin: 2
anchors.topMargin: 2
anchors.bottomMargin: 2
IconImage {
id: avatarImage
anchors.fill: parent
anchors.margins: 2
source: "file://" + Settings.settings.profileImage
visible: false
asynchronous: true
backer.fillMode: Image.PreserveAspectCrop
}
MultiEffect {
anchors.fill: parent
source: avatarImage
maskEnabled: true
maskSource: mask
visible: Settings.settings.profileImage !== ""
}
Item {
id: mask
anchors.fill: parent
layer.enabled: true
visible: false
Rectangle {
anchors.fill: parent
radius: avatarImage.width / 2
}
}
// 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
}
}