Refactoring: move all apps inside a sub folder
This commit is contained in:
1 parent
33e4fe0c4e
commit
b1ca2a7cff
41 files changed
+54
-45
No files matched your search
@@ -0,0 +1,60 @@
|
||||
import QtQuick 2.5
|
||||
import "../Shared"
|
||||
|
||||
// Carte utilisateur (avatar rond + nom). `addCard` affiche la carte « Ajouter un compte ».
|
||||
Item {
|
||||
id: root
|
||||
|
||||
property string name: ""
|
||||
property bool addCard: false
|
||||
property bool highlighted: false
|
||||
signal clicked()
|
||||
|
||||
width: 140
|
||||
height: 200
|
||||
|
||||
Rectangle {
|
||||
id: avatar
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: Theme.spacingS
|
||||
width: 120
|
||||
height: 120
|
||||
radius: width / 2
|
||||
color: root.addCard ? Theme.surface : Theme.avatarColor(root.name)
|
||||
border.width: root.highlighted ? 4 : 0
|
||||
border.color: Theme.focusBackground
|
||||
scale: root.highlighted ? 1.1 : 1
|
||||
|
||||
Behavior on scale { NumberAnimation { duration: Theme.animFast } }
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: root.addCard ? "+" : root.name.charAt(0).toUpperCase()
|
||||
color: Theme.text
|
||||
font.pixelSize: 48
|
||||
font.bold: true
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors {
|
||||
top: avatar.bottom
|
||||
topMargin: Theme.spacingL
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
text: root.name
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
wrapMode: Text.WordWrap
|
||||
maximumLineCount: 2
|
||||
elide: Text.ElideRight
|
||||
color: root.highlighted ? Theme.text : Theme.textMuted
|
||||
font.pixelSize: Theme.fontBody
|
||||
font.bold: root.highlighted
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: root.clicked()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user