feat: add pfp selector back
This commit is contained in:
parent
28299c0845
commit
9af39b6aa9
1 changed files with 62 additions and 4 deletions
|
|
@ -40,17 +40,75 @@ Item {
|
||||||
Behavior on color {
|
Behavior on color {
|
||||||
CAnim {}
|
CAnim {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: mouse
|
||||||
|
|
||||||
|
containmentMask: QtObject {
|
||||||
|
function contains(pt: point): bool {
|
||||||
|
return shape.contains(pt) && !logoShape.contains(mouse.mapToItem(logoShape, pt)) && !uptimeShape.contains(mouse.mapToItem(uptimeShape, pt));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
onClicked: {
|
||||||
|
root.visibilities.dashboard = false;
|
||||||
|
root.facePicker.open();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CachingImage {
|
Item {
|
||||||
id: pfp
|
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
path: `${Paths.home}/.face`
|
|
||||||
layer.enabled: true
|
layer.enabled: true
|
||||||
layer.effect: Mask {
|
layer.effect: Mask {
|
||||||
maskSource: shape
|
maskSource: shape
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CachingImage {
|
||||||
|
anchors.fill: parent
|
||||||
|
path: `${Paths.home}/.face`
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledRect {
|
||||||
|
anchors.fill: parent
|
||||||
|
color: Qt.alpha(Colours.palette.m3scrim, 0.4)
|
||||||
|
opacity: mouse.containsMouse ? 1 : 0
|
||||||
|
layer.enabled: opacity < 1
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
type: Anim.DefaultEffects
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MaterialShape {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
implicitSize: parent.height * 0.7
|
||||||
|
shape: MaterialShape.Diamond
|
||||||
|
color: Colours.palette.m3primary
|
||||||
|
scale: mouse.pressed ? 0.9 : mouse.containsMouse ? 1 : 0.7
|
||||||
|
|
||||||
|
Behavior on color {
|
||||||
|
CAnim {}
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on scale {
|
||||||
|
Anim {
|
||||||
|
type: Anim.FastSpatial
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MaterialIcon {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
text: "person_edit"
|
||||||
|
color: Colours.palette.m3onPrimary
|
||||||
|
fontStyle: Tokens.font.icon.large
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue