new user profile labels
This commit is contained in:
parent
32f93b8e26
commit
ddf0d4d065
10 changed files with 57 additions and 228 deletions
|
@ -71,7 +71,6 @@ DISTFILES += qml/harbour-tooter.qml \
|
|||
qml/cover/CoverPage.qml \
|
||||
qml/pages/MainPage.qml \
|
||||
qml/pages/LoginPage.qml \
|
||||
qml/pages/components/Toot.qml \
|
||||
qml/pages/Browser.qml \
|
||||
qml/lib/API.js \
|
||||
qml/images/icon-s-following \
|
||||
|
@ -93,7 +92,7 @@ SAILFISHAPP_ICONS = 86x86 108x108 128x128 172x172
|
|||
|
||||
# to disable building translations every time, comment out the
|
||||
# following CONFIG line
|
||||
CONFIG += sailfishapp_i18n
|
||||
# CONFIG += sailfishapp_i18n
|
||||
|
||||
TRANSLATIONS += translations/harbour-tooter.ts \
|
||||
translations/harbour-tooter-de.ts \
|
||||
|
|
|
@ -132,7 +132,6 @@ function parseAccounts(collection, prefix, data){
|
|||
res[prefix + 'account_username'] = data["username"]
|
||||
res[prefix + 'account_acct'] = data["acct"]
|
||||
res[prefix + 'account_display_name'] = data["display_name"]
|
||||
res[prefix + 'account_discoverable'] = data["discoverable"]
|
||||
res[prefix + 'account_locked'] = data["locked"]
|
||||
res[prefix + 'account_created_at'] = data["created_at"]
|
||||
res[prefix + 'account_avatar'] = data["avatar"]
|
||||
|
|
|
@ -8,18 +8,18 @@ import "./components/"
|
|||
Page {
|
||||
id: conversationPage
|
||||
|
||||
property string headerTitle: ""
|
||||
property string type
|
||||
property alias title: header.title
|
||||
property alias description: header.description
|
||||
property alias avatar: header.image
|
||||
property string description: ""
|
||||
property string headerTitle: ""
|
||||
property string suggestedUser: ""
|
||||
property ListModel suggestedModel
|
||||
property string toot_id: ""
|
||||
property string toot_url: ""
|
||||
property string toot_uri: ""
|
||||
property int tootMaxChar: 500;
|
||||
property bool bot: false
|
||||
property bool bot: false //otherwise ReferenceError ProfileHeader.qml
|
||||
property bool followed_by: false //otherwise ReferenceError ProfileHeader.qml
|
||||
property bool locked: false //otherwise ReferenceError ProfileHeader.qml
|
||||
property ListModel mdl
|
||||
|
||||
allowedOrientations: Orientation.All
|
||||
|
|
|
@ -179,6 +179,7 @@ Page {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
view2.type = "accounts/search"
|
||||
view2.params = []
|
||||
|
|
|
@ -31,7 +31,6 @@ Page {
|
|||
text: qsTr("Load Images in Toots")
|
||||
description: qsTr("Disable this option if you want to preserve your data connection")
|
||||
icon.source: "image://theme/icon-m-image"
|
||||
enabled: true
|
||||
checked: typeof Logic.conf['loadImages'] !== "undefined" && Logic.conf['loadImages']
|
||||
onClicked: {
|
||||
Logic.conf['loadImages'] = checked
|
||||
|
@ -97,11 +96,8 @@ Page {
|
|||
font.pixelSize: Theme.fontSizeExtraSmall
|
||||
wrapMode: Text.Wrap
|
||||
color: Theme.highlightColor
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
rightMargin: Theme.paddingLarge + icnRemoveAccount
|
||||
}
|
||||
width: parent.width - Theme.paddingMedium
|
||||
anchors.left: parent.left
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,12 +51,16 @@ BackgroundItem {
|
|||
anchors.leftMargin: Theme.paddingLarge
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
height: account_acct.height + display_name.height
|
||||
|
||||
Label {
|
||||
id: display_name
|
||||
text: model.account_display_name+" "
|
||||
text: if (model.account_display_name + " ") {
|
||||
model.account_username.split("@")[0] + " "
|
||||
} else model.account_display_name
|
||||
color: !pressed ? Theme.primaryColor : Theme.highlightColor
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
}
|
||||
|
||||
Label {
|
||||
id: account_acct
|
||||
text: "@"+model.account_acct
|
||||
|
@ -65,6 +69,7 @@ BackgroundItem {
|
|||
font.pixelSize: Theme.fontSizeExtraSmall
|
||||
}
|
||||
}
|
||||
|
||||
onClicked: openUser( {
|
||||
"display_name": model.account_display_name,
|
||||
"username": model.account_acct,
|
||||
|
|
|
@ -70,7 +70,7 @@ SilicaListView {
|
|||
text: qsTr("New Toot")
|
||||
onClicked: {
|
||||
pageStack.push(Qt.resolvedUrl("../ConversationPage.qml"), {
|
||||
//headerTitle: "New Toot",
|
||||
headerTitle: qsTr("New Toot"),
|
||||
type: "new"
|
||||
})
|
||||
}
|
||||
|
@ -84,8 +84,7 @@ SilicaListView {
|
|||
}
|
||||
}
|
||||
|
||||
delegate: VisualContainer {
|
||||
} //Toot {}
|
||||
delegate: VisualContainer {}
|
||||
|
||||
add: Transition {
|
||||
NumberAnimation { property: "opacity"; from: 0; to: 1.0; duration: 800 }
|
||||
|
|
|
@ -12,7 +12,7 @@ Item {
|
|||
property string bg: ""
|
||||
|
||||
width: parent.width
|
||||
height: if (bot === true) {
|
||||
height: if (bot === true || locked === true || followed_by === true) {
|
||||
avatarImage.height + Theme.paddingLarge*2 + infoLbl.height + Theme.paddingLarge
|
||||
} else avatarImage.height + Theme.paddingLarge*2
|
||||
|
||||
|
@ -122,9 +122,9 @@ Item {
|
|||
rightMargin: Theme.paddingLarge
|
||||
}
|
||||
|
||||
/* Rectangle {
|
||||
Rectangle {
|
||||
id: followingBg
|
||||
visible: (following ? true : false)
|
||||
visible: (followed_by ? true : false)
|
||||
radius: Theme.paddingSmall
|
||||
color: Theme.secondaryHighlightColor
|
||||
width: followingLbl.width + 2*Theme.paddingLarge
|
||||
|
@ -138,7 +138,26 @@ Item {
|
|||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
} */
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: lockedBg
|
||||
visible: (locked ? true : false)
|
||||
radius: Theme.paddingSmall
|
||||
color: Theme.secondaryHighlightColor
|
||||
width: lockedImg.width + 2*Theme.paddingLarge
|
||||
height: parent.height
|
||||
|
||||
HighlightImage {
|
||||
id: lockedImg
|
||||
source: "image://theme/icon-s-secure?"
|
||||
width: Theme.fontSizeExtraSmall
|
||||
height: width
|
||||
color: Theme.primaryColor
|
||||
anchors.horizontalCenter: lockedBg.horizontalCenter
|
||||
anchors.verticalCenter: lockedBg.verticalCenter
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: botBg
|
||||
|
|
|
@ -1,187 +0,0 @@
|
|||
import QtQuick 2.0
|
||||
import Sailfish.Silica 1.0
|
||||
import QtGraphicalEffects 1.0
|
||||
|
||||
|
||||
BackgroundItem {
|
||||
id: delegate
|
||||
|
||||
signal send (string notice)
|
||||
signal navigateTo(string link)
|
||||
|
||||
width: parent.width
|
||||
height: lblText.paintedHeight + (lblText.text.length > 0 ? Theme.paddingLarge : 0 )+ lblName.paintedHeight + (type.length ? Theme.paddingLarge + iconRT.height : 0) + Theme.paddingLarge
|
||||
|
||||
Image {
|
||||
id: iconRT
|
||||
y: Theme.paddingLarge
|
||||
anchors.right: avatar.right
|
||||
visible: type.length
|
||||
width: Theme.iconSizeExtraSmall
|
||||
height: width
|
||||
source: "../../images/boosted.svg"
|
||||
}
|
||||
|
||||
Label {
|
||||
id: lblRtByName
|
||||
visible: type.length
|
||||
anchors.left: lblName.left
|
||||
anchors.bottom: iconRT.bottom
|
||||
font.pixelSize: Theme.fontSizeExtraSmall
|
||||
color: Theme.secondaryColor
|
||||
text: {
|
||||
var action;
|
||||
switch(type){
|
||||
case "reblog":
|
||||
action = qsTr('boosted');
|
||||
break;
|
||||
case "favourite":
|
||||
action = qsTr('favourited');
|
||||
break;
|
||||
case "follow":
|
||||
action = qsTr('followed you');
|
||||
break;
|
||||
default:
|
||||
action = type;
|
||||
}
|
||||
return '@' + retweetScreenName + ' ' + action
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
id: avatar
|
||||
x: Theme.horizontalPageMargin
|
||||
y: Theme.paddingLarge + (type.length ? iconRT.height+Theme.paddingMedium : 0)
|
||||
asynchronous: true
|
||||
width: Theme.iconSizeMedium
|
||||
height: width
|
||||
smooth: true
|
||||
source: account_avatar
|
||||
visible: true
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
pageStack.push(Qt.resolvedUrl("../ProfilePage.qml"), {
|
||||
"display_name": account_display_name,
|
||||
"username": account_username,
|
||||
"profileImage": account_avatar
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
id: lblName
|
||||
text: account_display_name
|
||||
font.weight: Font.Bold
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: (pressed ? Theme.highlightColor : Theme.primaryColor)
|
||||
anchors {
|
||||
top: avatar.top
|
||||
topMargin: 0
|
||||
left: avatar.right
|
||||
leftMargin: Theme.paddingMedium
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
id: iconLocked
|
||||
visible: account_locked
|
||||
y: Theme.paddingLarge
|
||||
opacity: 0.8
|
||||
source: "image://theme/icon-s-secure?" + (pressed
|
||||
? Theme.highlightColor
|
||||
: Theme.primaryColor)
|
||||
width: account_locked ? Theme.iconSizeExtraSmall*0.8 : 0
|
||||
height: width
|
||||
anchors {
|
||||
left: lblName.right
|
||||
leftMargin: Theme.paddingSmall
|
||||
verticalCenter: lblName.verticalCenter
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
id: lblScreenName
|
||||
truncationMode: TruncationMode.Fade
|
||||
text: '@'+account_username
|
||||
font.pixelSize: Theme.fontSizeExtraSmall
|
||||
color: (pressed ? Theme.secondaryHighlightColor : Theme.secondaryColor)
|
||||
anchors {
|
||||
left: iconLocked.right
|
||||
right: lblDate.left
|
||||
leftMargin: Theme.paddingMedium
|
||||
baseline: lblName.baseline
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
id: lblDate
|
||||
function timestamp() {
|
||||
var txt = Format.formatDate(created_at, Formatter.Timepoint)
|
||||
var elapsed = Format.formatDate(created_at, Formatter.DurationElapsedShort)
|
||||
return (elapsed ? elapsed : txt )
|
||||
}
|
||||
text: Format.formatDate(created_at, new Date() - created_at < 60*60*1000 ? Formatter.DurationElapsedShort : Formatter.TimeValueTwentyFourHours)
|
||||
font.pixelSize: Theme.fontSizeExtraSmall
|
||||
color: (pressed ? Theme.highlightColor : Theme.primaryColor)
|
||||
horizontalAlignment: Text.AlignRight
|
||||
anchors {
|
||||
right: parent.right
|
||||
baseline: lblName.baseline
|
||||
rightMargin: Theme.paddingLarge
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
id: lblText
|
||||
height: content.length ? paintedHeight : 0
|
||||
onLinkActivated: {
|
||||
console.log(link)
|
||||
if (link[0] === "@") {
|
||||
pageStack.push(Qt.resolvedUrl("../Profile.qml"), {
|
||||
"name": "",
|
||||
"username": link.substring(1),
|
||||
"profileImage": ""
|
||||
})
|
||||
} else if (link[0] === "#") {
|
||||
pageStack.pop(pageStack.find(function(page) {
|
||||
var check = page.isFirstPage === true;
|
||||
if (check)
|
||||
page.onLinkActivated(link)
|
||||
return check;
|
||||
}));
|
||||
send(link)
|
||||
} else {
|
||||
Qt.openUrlExternally(link);
|
||||
}
|
||||
}
|
||||
text: content
|
||||
textFormat: Text.RichText
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: (pressed ? Theme.highlightColor : Theme.primaryColor)
|
||||
linkColor : Theme.highlightColor
|
||||
wrapMode: Text.Wrap
|
||||
maximumLineCount: 6
|
||||
anchors {
|
||||
left: lblName.left
|
||||
right: parent.right
|
||||
top: lblScreenName.bottom
|
||||
topMargin: Theme.paddingSmall
|
||||
rightMargin: Theme.paddingLarge
|
||||
}
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
pageStack.push(Qt.resolvedUrl("../ConversationPage.qml"), {
|
||||
headerTitle: "Conversation",
|
||||
toot_id: id,
|
||||
toot_url: status_url,
|
||||
//title: account_display_name,
|
||||
description: '@'+account_acc,
|
||||
avatar: account_avatar,
|
||||
type: "reply"
|
||||
})
|
||||
}
|
||||
|
||||
}
|
|
@ -375,13 +375,11 @@ BackgroundItem {
|
|||
if (typeof mdl !== "undefined")
|
||||
m.append(mdl.get(index))
|
||||
pageStack.push(Qt.resolvedUrl("../ConversationPage.qml"), {
|
||||
headerTitle: "Conversation",
|
||||
toot_id: status_id,
|
||||
toot_url: status_url,
|
||||
toot_uri: status_uri,
|
||||
title: account_display_name,
|
||||
description: '@'+account_acct,
|
||||
avatar: account_avatar,
|
||||
headerTitle: qsTr("Conversation"),
|
||||
"toot_id": status_id,
|
||||
"toot_url": status_url,
|
||||
"toot_uri": status_uri,
|
||||
"description": '@'+account_acct,
|
||||
mdl: m,
|
||||
type: "reply"
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue