forked from lubuwest/Friendiqa
Version 0.004
This commit is contained in:
parent
10dccdcdbb
commit
438f8a4e4d
64 changed files with 2736 additions and 636 deletions
47
source-android/qml/calendarqml/CalendarDay.qml
Normal file
47
source-android/qml/calendarqml/CalendarDay.qml
Normal file
|
@ -0,0 +1,47 @@
|
|||
import QtQuick 2.0
|
||||
import QtQuick.Controls 1.4
|
||||
|
||||
Item {
|
||||
id: calendarDay
|
||||
width:7*mm
|
||||
height: 7*mm
|
||||
property int dateInt:Math.floor((Date.parse(model.date)-(new Date().getTimezoneOffset() * 60 * 1000))/86400000)
|
||||
Rectangle {
|
||||
id: placeHolder
|
||||
color: 'lightblue'; antialiasing: true
|
||||
anchors.fill:parent
|
||||
}
|
||||
Text {
|
||||
id:daytext
|
||||
anchors.right: parent.right
|
||||
anchors.margins: 0.5*mm
|
||||
color:(model.month==monthgrid.month)?"black":"grey"
|
||||
wrapMode: Text.WrapAnywhere
|
||||
text: model.day
|
||||
font.bold: model.today
|
||||
font.pixelSize: 4*mm
|
||||
}
|
||||
Rectangle {
|
||||
id:eventRect
|
||||
color:"black"
|
||||
anchors.margins: 0.5*mm
|
||||
anchors.bottom: calendarDay.bottom
|
||||
width: parent.width-mm
|
||||
height: mm
|
||||
visible: eventdays.indexOf(dateInt)>-1
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: calendarDay
|
||||
onClicked: {
|
||||
var eventDate=[];
|
||||
var idx = eventdays.indexOf(dateInt);
|
||||
while (idx != -1) {
|
||||
eventDate.push(idx);
|
||||
idx = eventdays.indexOf(dateInt,idx + 1)
|
||||
}
|
||||
var component = Qt.createComponent("qrc:/qml/calendarqml/EventList.qml");
|
||||
if (component.status== Component.Ready){
|
||||
var eventlist = component.createObject(calendartab,{"daylist": eventDate})}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue