Version 0.004

This commit is contained in:
LubuWest 2017-05-11 22:15:34 +02:00
commit 438f8a4e4d
64 changed files with 2736 additions and 636 deletions

View file

@ -7,9 +7,23 @@ import "qrc:/js/helper.js" as Helperjs
Item {
id: newsitem
width: newsView.width
height:Math.max((itemMessage.height+topFlow.height+friendicaActivities.height+4*mm),profileImage.height+user_name.height+mm)
width: parent.width
height:toprow.height+friendicaActivities.height+controlrow.height+1//Math.max((itemMessage.height+topFlow.height+friendicaActivities.height+4*mm),profileImage.height+user_name.height+mm)
Connections{
target:newstab
onConversationChanged:{
newsBusy.running=false;
if(index==newsStack.conversationIndex){
if(newstab.conversation.length>0){
var component = Qt.createComponent("qrc:/qml/newsqml/Conversation.qml");
var conversation = component.createObject(friendicaActivities,{"news":newstab.conversation});
}
else{conversationsymbol.color="grey"}
}
}
}
property string attending: ""
onAttendingChanged: {attendLabel.visible=true;
attendLabel.text= qsTr("attending: ")+ qsTr(attending)}
@ -19,9 +33,7 @@ Item {
function showActivityContacts(contacts){
var component = Qt.createComponent("qrc:/qml/newsqml/FriendicaActivities.qml");
var imagedialog = component.createObject(friendicaActivities,{"activitymembers": contacts});
}
Rectangle{width:newsitem.width; height: 1; anchors.bottom: newsitem.bottom; color:"light grey"}
Rectangle{
@ -29,7 +41,8 @@ Item {
height:newsitem.height-1
color: (newsitemobject.messagetype==1)?"#ffe6e6" : "white"
Column {
Row{id:toprow
Column {
id: authorcolumn
width: 8*mm
@ -41,7 +54,7 @@ Item {
height: 7*mm
MouseArea{
anchors.fill: parent
onClicked:{print(root.currentIndex);
onClicked:{
try{root.currentIndex=1;
friendstab.active=true;
root.contactdetailsSignal(newsitemobject.user)} catch (e){Helperjs.showMessage("Error",e,root)}
@ -61,7 +74,7 @@ Item {
Column {
id:newscolumn
width: newsitem.width-8*mm
anchors.left: authorcolumn.right
//anchors.left: authorcolumn.right
Flow{
id:topFlow
@ -92,7 +105,7 @@ Item {
Label {
id:newscountLabel
visible:((newstabstatus=="Tree")&&(newsitemobject.newscount>1))?true:false
visible:((newstabstatus=="Conversations")&&(newsitemobject.newscount>1))?true:false
color: "grey"
height:3.5*mm
font.pixelSize: 1.5*mm
@ -117,12 +130,25 @@ Item {
wrapMode: Text.Wrap
onLinkActivated:{
Qt.openUrlExternally(link)}
Component.onCompleted:{
if (newsitemobject.attachmentList.length>0){
for(var attachments in newsitemobject.attachmentList){// (newsitemobject.attachmentList[attachments].url);
var attachcomponent = Qt.createQmlObject('import QtQuick 2.0; '+
'AnimatedImage {id:gif;source: "'+newsitemobject.attachmentList[attachments].url+
'";onStatusChanged: playing = (status == AnimatedImage.Ready)}',
friendicaActivities,"Attachment"+attachments);
}
}
}
}
Flow{
}
}
Flow{
id:friendicaActivities
anchors.top:toprow.bottom
width:parent.width
spacing:mm
Label{color: "grey"
font.pixelSize: 1.5*mm
text: friendica_activities.likeText
@ -162,11 +188,22 @@ Item {
onClicked: { showActivityContacts(newsitemobject.attendmaybe)}
}
}
Label{
id:attendLabel
//visible: false
color: "grey"
height:3.5*mm
font.pixelSize: 1.5*mm
horizontalAlignment: Label.AlignRight
text: (friendica_activities.self.attending)?(qsTr("Attending: ")+ qsTr(friendica_activities.self.attending)):""
}
}
Row{
Row{id:controlrow
anchors.top:friendicaActivities.bottom
CheckBox{
id:likeCheckbox
height:3*mm
//height:3*mm
width:8*mm
visible: (newsitemobject.messagetype==0)? true:false
checked:(friendica_activities.self.liked==1)?true:false
@ -195,7 +232,7 @@ Item {
}
CheckBox{
id: dislikeCheckbox
height:3*mm
//height:3*mm
width:8*mm
visible: (newsitemobject.messagetype==0)? true:false
checked: (friendica_activities.self.disliked==1)?true:false
@ -222,10 +259,30 @@ Item {
if (dislikeCheckbox.checked==true){Newsjs.like(root.login,root.db,1,"dislike",newsitemobject.status_id,root);likeCheckbox.checked=false; model.friendica_activities.self.disliked=0}
else {Newsjs.like(root.login,root.db,0,"dislike",newsitemobject.status_id,root); model.friendica_activities.self.disliked=1}}
}
// Rectangle{
// width: 8*mm
// height: 3*mm
// color:"transparent"
// Text{
// id:trashsymbol
// color: "grey"
// anchors.centerIn: parent
// font.pixelSize: 2*mm
// font.bold: true
// text: "\uf1f8"
// }
// MouseArea{
// anchors.fill:parent
// onClicked: {
// Newsjs.deleteNews(root.login,root.db,newsitemobject.status_id,newsitemobject.messagetype,root,function(reply){
// newsModel.remove(index)})
// }}
// }
CheckBox {
id:favoritedCheckbox
visible:(newsitemobject.messagetype==0)
width: 7*mm
width: 8*mm
style: CheckBoxStyle {
background: Rectangle {
implicitWidth: 6*mm
@ -251,7 +308,7 @@ Item {
}
}
Rectangle{
width: 7*mm
width: 8*mm
height: 3*mm
color:"transparent"
Text{
@ -267,7 +324,7 @@ Item {
onClicked: {newsmenu.popup()}}
}
Rectangle{
width: 7*mm
width: 8*mm
height: 3*mm
visible:newstab.newstabstatus!="Conversation"
color:"transparent"
@ -281,20 +338,15 @@ Item {
}
MouseArea{
anchors.fill:parent
onClicked: { conversationsymbol.color="black";showConversation(index,newsitemobject)}
onClicked:{
conversationsymbol.color="black";
showConversation(index,newsitemobject)
}
}
}
Label{
id:attendLabel
//visible: false
color: "grey"
height:3.5*mm
font.pixelSize: 1.5*mm
horizontalAlignment: Label.AlignRight
text: (friendica_activities.self.attending)?(qsTr("Attending: ")+ qsTr(friendica_activities.self.attending)):""
}
}
}
Menu {
id:newsmenu
MenuItem {
@ -350,6 +402,4 @@ Item {
}
}
}
}
}
}}