aerothemeplasma/plasma/look-and-feel/authui7/contents/components/PFPContainer.qml

65 lines
1.6 KiB
QML
Raw Normal View History

2024-01-20 02:08:06 +00:00
/*
SPDX-FileCopyrightText: 2014 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
import QtQuick 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents3
2024-08-09 01:20:25 +00:00
import org.kde.kirigami 2.20 as Kirigami
import Qt5Compat.GraphicalEffects
2024-01-20 02:08:06 +00:00
Item {
id: root
property string avatarPath
property string iconSource: "user-symbolic"
implicitWidth: 190
implicitHeight: 190
Item {
id: imageSource
anchors.centerIn: root
width: 126
height: 126
Image {
id: face
source: avatarPath
fillMode: Image.PreserveAspectCrop
anchors.fill: parent
}
2024-08-09 01:20:25 +00:00
LinearGradient {
id: gradient
anchors.fill: parent
z: -1
start: Qt.point(0,0)
end: Qt.point(gradient.width, gradient.height)
gradient: Gradient {
GradientStop { position: 0.0; color: "#eeecee" }
GradientStop { position: 1.0; color: "#a39ea3" }
}
}
Kirigami.Icon {
2024-01-20 02:08:06 +00:00
id: faceIcon
source: iconSource
visible: (face.status == Image.Error || face.status == Image.Null)
anchors.fill: parent
2024-08-09 01:20:25 +00:00
anchors.margins: Kirigami.Units.gridUnit * 0.5 // because mockup says so...
//colorGroup: PlasmaCore.ColorScope.colorGroup
2024-01-20 02:08:06 +00:00
}
}
Image {
id: imageFrame
anchors.fill: root
source: "../images/pfpframe.png"
}
}