Commit b30d2add authored by Dimitris Kardarakos's avatar Dimitris Kardarakos

POC against sink with nextcloud todos

parent 8d08d3c5
......@@ -23,6 +23,7 @@ import org.kde.kirigami 2.0 as Kirigami
import QtQuick.Controls 2.4 as Controls2
import org.kde.phone.calindori 0.1 as Calindori
import "Utils.js" as Utils
import org.kube.framework 1.0 as Kube
Kirigami.ApplicationWindow {
id: root
......@@ -37,6 +38,12 @@ Kirigami.ApplicationWindow {
title: "Calindori"
actions: [
Kirigami.Action {
id: onlineCalendars
text: "Online Calendars"
onTriggered: root.pageStack.push(accountSwitcher);
},
Kirigami.Action {
id: calendarActions
......@@ -260,6 +267,98 @@ Kirigami.ApplicationWindow {
}
}
Kube.CheckedEntities {
id: calendarFilterCollector
}
Component {
id: accountSwitcher
Kirigami.Page {
Kube.ListView {
id: listView
anchors.fill: parent
Layout.fillWidth: true
Layout.maximumHeight: Math.min(contentHeight, parent.height - Kube.Units.gridUnit)
Layout.preferredHeight: contentHeight
spacing: Kube.Units.smallSpacing
model: Kube.CheckableEntityModel {
id: calendarModel
type: "calendar"
roles: ["name", "color", "enabled"]
sortRole: "name"
filter: {} //root.editMode ? {} : {enabled: true}
accountId: ""
checkedEntities: calendarFilterCollector
}
delegate: Kube.ListDelegate {
id: delegate
width: listView.availableWidth
height: Kube.Units.gridUnit
hoverEnabled: true
background: Item {}
RowLayout {
anchors.fill: parent
spacing: Kube.Units.smallSpacing
Kube.CheckBox {
id: checkBox
opacity: 0.9
visible: root.editMode
checked: model.checked || model.enabled
onCheckedChanged: {
model.checked = checked
model.enabled = checked
}
indicator: Rectangle {
width: Kube.Units.gridUnit * 0.8
height: Kube.Units.gridUnit * 0.8
color: model.color
Rectangle {
id: highlight
anchors.fill: parent
visible: checkBox.hovered || checkBox.visualFocus
color: Kube.Colors.highlightColor
opacity: 0.4
}
Kube.Icon {
anchors.centerIn: parent
height: Kube.Units.gridUnit
width: Kube.Units.gridUnit
visible: checkBox.checked
iconName: Kube.Icons.checkbox_inverted
}
}
}
Kube.Label {
id: label
Layout.fillWidth: true
text: model.name
color: Kube.Colors.highlightedTextColor
elide: Text.ElideLeft
clip: true
}
Rectangle {
visible: !root.editMode
width: Kube.Units.gridUnit * 0.8
height: Kube.Units.gridUnit * 0.8
radius: width / 2
color: model.color
}
}
}
}
}
}
ConfirmationSheet {
id: deleteSheet
......
......@@ -22,6 +22,7 @@ import QtQuick.Controls 2.4 as Controls2
import QtQuick.Layouts 1.11
import org.kde.kirigami 2.4 as Kirigami
import org.kde.phone.calindori 0.1 as Calindori
import org.kube.framework 1.0 as Kube
Kirigami.Page {
id: root
......@@ -56,18 +57,23 @@ Kirigami.Page {
pageStack.pop(todoPage);
}
}
}
Kube.CalendarSelector {
id: accountSwitcher
visible: false
}
Kirigami.CardsListView {
id: cardsListview
anchors.fill: parent
model: Calindori.TodosModel {
filterdt: root.todoDt
memorycalendar: root.calendar.memorycalendar
// model: Calindori.TodosModel {
// filterdt: root.todoDt
// memorycalendar: root.calendar.memorycalendar
// }
model: Kube.TodoModel {
calendarFilter: accountSwitcher.enabledCalendars
}
delegate: Kirigami.Card {
banner.title: model.summary
banner.titleLevel: 3
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment