forked from lubuwest/Friendiqa
version v0.6
This commit is contained in:
parent
bdc28e632e
commit
8482bde3ed
86 changed files with 7064 additions and 3208 deletions
|
@ -34,101 +34,47 @@ import QtQuick.Controls 2.12
|
|||
import "qrc:/js/service.js" as Service
|
||||
import "qrc:/js/helper.js" as Helperjs
|
||||
import "qrc:/qml/genericqml"
|
||||
import "qrc:/qml/calendarqml"
|
||||
|
||||
Rectangle{
|
||||
id:eventList
|
||||
z:2
|
||||
border.color: "grey"
|
||||
width: parent.width-4*mm
|
||||
height:parent.height-12*mm
|
||||
x:mm
|
||||
y:mm
|
||||
radius: 0.5*mm
|
||||
// height: parent.height
|
||||
// width:parent.width
|
||||
|
||||
//radius: 0.5*mm
|
||||
property var daylist:[]
|
||||
property int dayint: 0
|
||||
property var events:[]
|
||||
|
||||
MButton{
|
||||
id:closeButton
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 1*mm
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 1*mm
|
||||
height: 6*mm
|
||||
width: 8*mm
|
||||
text: "\uf057"
|
||||
onClicked:{eventList.destroy()}
|
||||
onClicked:{rootstackView.pop()}
|
||||
}
|
||||
ListView {
|
||||
id: eventlistView
|
||||
y:closeButton.height+2*mm
|
||||
width: eventList.width-4*root.fontFactor*osSettings.bigFontSize
|
||||
height: eventList.height-closeButton.height-root.fontFactor*osSettings.bigFontSize
|
||||
clip: true
|
||||
model: eventModel
|
||||
delegate: EventListItem{}
|
||||
}
|
||||
ListView {
|
||||
id: eventlistView
|
||||
x: mm
|
||||
y:closeButton.height+2*mm
|
||||
width: eventList.width-2*mm
|
||||
height: eventList.height-closeButton.height-4*mm
|
||||
clip: true
|
||||
model: eventModel
|
||||
delegate: eventItem
|
||||
}
|
||||
|
||||
ListModel{
|
||||
id: eventModel
|
||||
}
|
||||
ListModel{
|
||||
id: eventModel
|
||||
}
|
||||
|
||||
Component.onCompleted:{//print("daylist"+JSON.stringify(daylist) + dayint)
|
||||
Component.onCompleted:{//print("daylist"+JSON.stringify(events) + dayint)
|
||||
var currentevents=events.filter(event=>(dayint>=event.startday)&&(dayint<=event.endday));
|
||||
for (var i=0; i<currentevents.length;i++){
|
||||
var liststate="";if(currentevents.length<2){liststate="large"};
|
||||
//print(JSON.stringify(events[daylist[i]]));
|
||||
eventModel.append({"event":currentevents[i],"eventstatus":liststate});
|
||||
}
|
||||
}
|
||||
|
||||
Component{
|
||||
id:eventItem
|
||||
Rectangle{
|
||||
property string status: eventstatus
|
||||
width:eventlistView.width
|
||||
height:eventNameText.height+eventDetailsText.height+mm
|
||||
border.color: "light grey"
|
||||
border.width: 1
|
||||
radius: 0.5*mm
|
||||
Image {
|
||||
id:profileImage
|
||||
source: ((event.eventOwner.profile_image!="") && (typeof(event.eventOwner.profile_image)=="string"))? "file://"+event.eventOwner.profile_image : event.eventOwner.profile_image_url
|
||||
x:1
|
||||
y:1
|
||||
width: 7*mm
|
||||
height: 7*mm
|
||||
//radius:mm
|
||||
|
||||
onStatusChanged: if (profileImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
|
||||
}
|
||||
Text {
|
||||
id:eventNameText
|
||||
x: 8*mm
|
||||
width:parent.width-8*mm
|
||||
height:contentHeight
|
||||
text: new Date(event.start).toLocaleString(Qt.locale(),Locale.NarrowFormat)+ " - " +(event.end>0?new Date(event.end).toLocaleString(Qt.locale(),Locale.NarrowFormat):" ")+": "+event.title //+calendarrectangle.offsetTime
|
||||
font.pixelSize: 3*mm
|
||||
wrapMode:Text.Wrap
|
||||
}
|
||||
|
||||
Text {
|
||||
id:eventDetailsText
|
||||
x:8*mm
|
||||
z:4
|
||||
width: parent.width-8*mm
|
||||
height: contentHeight
|
||||
textFormat: Text.RichText
|
||||
text: status==""?"":Qt.atob(event.desc) + (event.location==""?"":"<br><br>"+qsTr("Location")+": "+event.location)//Qt.atob(event.html)
|
||||
anchors.top: eventNameText.bottom
|
||||
font.pixelSize: 3*mm
|
||||
wrapMode:Text.Wrap
|
||||
onLinkActivated:{Qt.openUrlExternally(link)}
|
||||
}
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked:{if (status==""){status="large"} else {status=""}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue