From d7fa14de0d4ffc6b0ae9529ea8bf84ede1d519fa Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 1 Mar 2018 15:19:28 +0100 Subject: add indention to overlaping events --- views/calendar/qml/View.qml | 14 +++++++++----- views/calendar/qml/WeekEvents.qml | 12 +++++++++--- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/views/calendar/qml/View.qml b/views/calendar/qml/View.qml index 1b72881d..a545f473 100644 --- a/views/calendar/qml/View.qml +++ b/views/calendar/qml/View.qml @@ -29,7 +29,6 @@ FocusScope { property var month: Calendar.March property var year: 2017 - Column { anchors.centerIn: parent @@ -118,10 +117,15 @@ FocusScope { model: parent.events delegate: Rectangle { - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - Kube.Units.smallSpacing * 2 - height: Kube.Units.gridUnit * duration - y: Kube.Units.gridUnit * starts + anchors { + right: parent.right + rightMargin: Kube.Units.smallSpacing + } + width: parent.width - Kube.Units.smallSpacing * 2 - Kube.Units.gridUnit * model.indention + height: Kube.Units.gridUnit * model.duration + y: Kube.Units.gridUnit * model.starts + x: Kube.Units.gridUnit * model.indention + color: model.color Kube.Label { diff --git a/views/calendar/qml/WeekEvents.qml b/views/calendar/qml/WeekEvents.qml index b08c00a5..c8a420e0 100644 --- a/views/calendar/qml/WeekEvents.qml +++ b/views/calendar/qml/WeekEvents.qml @@ -8,12 +8,14 @@ ListModel { starts: 1 duration: 4 text: "Meeting" + indention: 0 }, ListElement { color: "#134bab" starts: 9 duration: 5 text: "Sport" + indention: 0 } ] } @@ -24,6 +26,7 @@ ListModel { starts: 9 duration: 5 text: "Sport" + indention: 0 } ] } @@ -36,6 +39,7 @@ ListModel { color: "#af1a6a" starts: 1 duration: 4 + indention: 0 text: "Meeting" } ] @@ -43,15 +47,17 @@ ListModel { ListElement { events: [ ListElement { - color: "#af1a6a" + color: "#134bab" starts: 3 duration: 5 + indention: 0 text: "Meeting" }, ListElement { color: "#af1a6a" - starts: 9 - duration: 4 + starts: 4 + duration: 7 + indention: 1 text: "Meeting2" } ] -- cgit v1.2.3