show add profile button

This commit is contained in:
Dan Ballard 2019-11-20 13:05:50 -08:00
parent 7a7be2777b
commit d3e178474d
3 changed files with 15 additions and 4 deletions

View File

@ -17,6 +17,7 @@ Item {
property bool isGroup property bool isGroup
property bool showStatus property bool showStatus
property bool highlight property bool highlight
property bool button
property real logscale: 4 * Math.log10(gcd.themeScale + 1) property real logscale: 4 * Math.log10(gcd.themeScale + 1)
property int baseWidth: 48 * logscale property int baseWidth: 48 * logscale
@ -30,7 +31,7 @@ Item {
Rectangle { Rectangle {
width: highlight ? baseWidth - 4 : baseWidth width: highlight ? baseWidth - 4 : baseWidth
height: highlight ? baseWidth - 4 : baseWidth height: highlight ? baseWidth - 4 : baseWidth
color: "#FFFFFF" color: button ? windowItem.cwtch_dark_color: "#FFFFFF"
radius: width / 2 radius: width / 2
anchors.centerIn:parent anchors.centerIn:parent

View File

@ -41,6 +41,7 @@ Item { // LOTS OF NESTING TO DEAL WITH QT WEIRDNESS, SORRY
ContactPicture { ContactPicture {
id: imgProfile id: imgProfile
showStatus: type == "contact" showStatus: type == "contact"
button: type == "button"
} }
ColumnLayout { ColumnLayout {

View File

@ -50,10 +50,12 @@ ColumnLayout {
} }
} }
profilesModel.append({ profilesModel.insert(profilesModel.count-1,
{
"_handle": handle, "_handle": handle,
"_displayName": displayName, "_displayName": displayName,
"_image": image "_image": image,
"_type": "profile"
}) })
} }
@ -71,6 +73,13 @@ ColumnLayout {
ListModel { // Profile OBJECTS ARE STORED HERE ... ListModel { // Profile OBJECTS ARE STORED HERE ...
id: profilesModel id: profilesModel
ListElement {
_handle: ""
_displayName: qsTr("Add new profile")
_image: "qrc:/qml/images/fontawesome/solid/user-plus.svg"
_type: "button"
}
} }
Repeater { Repeater {
@ -84,7 +93,7 @@ ColumnLayout {
status: 0 status: 0
blocked: false blocked: false
loading: false loading: false
type: "profile" type: _type
} }
} }
} }