info labels for profile header
adds info labels to profile header ('Following you' / 'Bot')
This commit is contained in:
parent
5dad14eafb
commit
52c8f549c0
2 changed files with 66 additions and 7 deletions
|
@ -23,6 +23,7 @@ Page {
|
|||
property int reblogs_count
|
||||
property int count_moments
|
||||
property bool locked: false
|
||||
property bool bot: false
|
||||
property bool following: false
|
||||
property bool requested: false
|
||||
property bool followed_by: false
|
||||
|
@ -77,6 +78,9 @@ Page {
|
|||
case 'locked':
|
||||
locked = messageObject.data
|
||||
break;
|
||||
case 'bot':
|
||||
bot = messageObject.data
|
||||
break;
|
||||
case 'created_at':
|
||||
created_at = messageObject.data
|
||||
break;
|
||||
|
|
|
@ -12,7 +12,9 @@ Item {
|
|||
property string bg: ""
|
||||
|
||||
width: parent.width
|
||||
height: avatarImage.height + Theme.paddingLarge*2
|
||||
height: if (following === true || bot === true) {
|
||||
avatarImage.height + Theme.paddingLarge*2 + infoLbl.height + Theme.paddingLarge
|
||||
} else avatarImage.height + Theme.paddingLarge*2
|
||||
|
||||
Rectangle {
|
||||
id: bgImage
|
||||
|
@ -69,6 +71,8 @@ Item {
|
|||
|
||||
Column {
|
||||
anchors {
|
||||
top: parent.top
|
||||
topMargin: Theme.paddingLarge
|
||||
left: avatarImage.right
|
||||
leftMargin: Theme.paddingLarge
|
||||
right: parent.right
|
||||
|
@ -77,12 +81,11 @@ Item {
|
|||
}
|
||||
|
||||
Label {
|
||||
id: ttl
|
||||
text:
|
||||
if (title === "") {
|
||||
description.split('@')[0]
|
||||
}
|
||||
else title
|
||||
id: profileTitle
|
||||
text: if (title === "") {
|
||||
description.split('@')[0]
|
||||
}
|
||||
else title
|
||||
font.pixelSize: Theme.fontSizeLarge
|
||||
font.family: Theme.fontFamilyHeading
|
||||
color: Theme.highlightColor
|
||||
|
@ -93,6 +96,7 @@ Item {
|
|||
}
|
||||
|
||||
Label {
|
||||
id: profileDescription
|
||||
text: "@"+description
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
font.family: Theme.fontFamilyHeading
|
||||
|
@ -104,4 +108,55 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
id: infoLbl
|
||||
spacing: Theme.paddingLarge
|
||||
layoutDirection: Qt.RightToLeft
|
||||
height: Theme.iconSizeSmall + Theme.paddingSmall
|
||||
anchors {
|
||||
top: avatarImage.bottom
|
||||
topMargin: Theme.paddingLarge
|
||||
left: parent.left
|
||||
leftMargin: Theme.paddingLarge
|
||||
right: parent.right
|
||||
rightMargin: Theme.paddingLarge
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: followingBg
|
||||
visible: (following ? true : false)
|
||||
radius: Theme.paddingSmall
|
||||
color: Theme.secondaryHighlightColor
|
||||
width: Theme.buttonWidthExtraSmall
|
||||
height: parent.height
|
||||
|
||||
Label {
|
||||
id: followingLbl
|
||||
text: qsTr("Follows you")
|
||||
font.pixelSize: Theme.fontSizeExtraSmall
|
||||
color: Theme.primaryColor
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: botBg
|
||||
visible: (bot ? true : false)
|
||||
radius: Theme.paddingSmall
|
||||
color: Theme.secondaryHighlightColor
|
||||
width: botLabel.width + 2*Theme.paddingLarge
|
||||
height: parent.height
|
||||
|
||||
Label {
|
||||
id: botLbl
|
||||
text: qsTr("Bot")
|
||||
font.pixelSize: Theme.fontSizeExtraSmall
|
||||
color: Theme.primaryColor
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue