import QtQuick 2.0 import QtQuick.LocalStorage 2.0 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import "qrc:/js/news.js" as Newsjs Item { id: newsitem width: newsView.width height:Math.max((itemMessage.height+topFlow.height+friendicaActivities.height+4*mm),profileImage.height+user_name.height+mm) property string conversation_id: "" property string attending: "" onAttendingChanged: {attendLabel.visible=true; attendLabel.text= qsTr("attending: ")+ qsTr(attending)} signal replyto(string parent_id) Rectangle{width:newsitem.width; height: 1; anchors.bottom: newsitem.bottom; color:"light grey"} Rectangle{ width:newsitem.width height:newsitem.height-1 color: (newsitemobject.messagetype==1)?"#ffe6e6" : "white" Column { id: authorcolumn width: 8*mm Image { id:profileImage source: (newsitemobject.user.profile_image!="")? "file://"+newsitemobject.user.profile_image : newsitemobject.user.profile_image_url x:1 width: 7*mm height: 7*mm MouseArea{ anchors.fill: parent onPressAndHold: { newsmenu.popup()} } onStatusChanged: if (profileImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"} } Label { id:user_name color: "grey" //height:3.5*mm width:parent.width font.pixelSize: 1.5*mm wrapMode: Text.WrapAtWordBoundaryOrAnywhere text: Qt.atob(newsitemobject.user.name) } } Column { id:newscolumn width: newsitem.width-8*mm anchors.left: authorcolumn.right Flow{ id:topFlow spacing: 2*mm width:parent.width Label { color: "grey" text: if (newsitemobject.messagetype==0){qsTr("Source: ")+newsitemobject.source } else if (newsitemobject.messagetype==1){ qsTr("Direct Message")} else {" Notification"} font.pixelSize: 1.5*mm } Label { id:createdAtLabel color: "grey" height:3.5*mm font.pixelSize: 1.5*mm horizontalAlignment: Label.AlignRight text: dateDiff } CheckBox { id:favoritedCheckbox style: CheckBoxStyle { background: Rectangle { implicitWidth: 6*mm implicitHeight:2*mm color:"white" } indicator: Rectangle{x:3*mm width: 3*mm implicitHeight:2*mm Text{ anchors.centerIn: parent color:control.checked?"black":"grey" text:"\u2605" }} } checked:(newsitemobject.favorited>0) onClicked:{ if(favoritedCheckbox.checkedState==Qt.Checked) {Newsjs.favorite(login,true,newsitemobject.status_id,root)} else if(favoritedCheckbox.checkedState==Qt.Unchecked) {Newsjs.favorite(login,false,newsitemobject.status_id,root)} } } Rectangle{ width: 4*mm height: 3*mm Text{ id:newsmenusymbol color: "grey" anchors.centerIn: parent font.pixelSize: 2*mm font.bold: true text: "\u22EE" } MouseArea{ anchors.fill:parent onClicked: {newsmenu.popup()}} } Rectangle{ width: 4*mm height: 3*mm visible:(newsitemobject.in_reply_to_status_id!="")?true:false Text{ id:conversationsymbol color: "grey" anchors.centerIn: parent font.pixelSize: 2*mm text: "\u21C4" } MouseArea{ anchors.fill:parent onClicked: { newsBusy.running=true; Newsjs.requestConversation(root.login,db,newsitemobject.status_id,root.contactlist,root,function(news,newContacts){ for (var i=0;i