Commit 4788eb33 authored by Claudio Cambra's avatar Claudio Cambra
Browse files

Rename QML files to give them more accurate and intuitive names

Another mainly administrative MR, but this should help make our code more readable
parent feb13877
Pipeline #178800 passed with stage
in 3 minutes and 24 seconds
......@@ -273,7 +273,7 @@ CalendarManager::CalendarManager(QObject *parent)
m_todoViewCollectionModel->setSortCaseSensitivity(Qt::CaseInsensitive);
m_todoViewCollectionModel->sort(0, Qt::AscendingOrder);
// Model for the sidebar
// Model for the mainDrawer
m_viewCollectionModel = new KalendarCollectionFilterProxyModel(this);
m_viewCollectionModel->setSourceModel(collectionFilter);
m_viewCollectionModel->addMimeTypeFilter(QStringLiteral("application/x-vnd.akonadi.calendar.event"));
......
......@@ -24,7 +24,7 @@ class ContactManager : public QObject
{
Q_OBJECT
/// Model for getting the contact collections available for the sidebar
/// Model for getting the contact collections available for the mainDrawer
Q_PROPERTY(QAbstractItemModel *contactCollections READ contactCollections CONSTANT)
/// Model for getting the edidable contact collections (with enough access right)
......
......@@ -93,8 +93,8 @@ Item {
}
]
IncidenceBackground {
id: incidenceBackground
IncidenceDelegateBackground {
id: incidenceDelegateBackground
isOpenOccurrence: parent.isOpenOccurrence
reactToCurrentMonth: parent.reactToCurrentMonth
isInCurrentMonth: parent.isInCurrentMonth
......
......@@ -8,7 +8,7 @@ import org.kde.kirigami 2.14 as Kirigami
import "labelutils.js" as LabelUtils
Kirigami.ShadowedRectangle {
id: incidenceBackground
id: incidenceDelegateBackground
property bool isOpenOccurrence: false
property bool reactToCurrentMonth: false
......@@ -17,7 +17,7 @@ Kirigami.ShadowedRectangle {
anchors.fill: parent
color: isOpenOccurrence ? modelData.color :
LabelUtils.getIncidenceBackgroundColor(modelData.color, root.isDark)
LabelUtils.getIncidenceDelegateBackgroundColor(modelData.color, root.isDark)
Behavior on color { ColorAnimation { duration: Kirigami.Units.shortDuration; easing.type: Easing.OutCubic } }
opacity: isOpenOccurrence || isInCurrentMonth ? 1.0 : 0
Behavior on opacity { NumberAnimation { duration: Kirigami.Units.shortDuration; easing.type: Easing.OutCubic } }
......
......@@ -17,18 +17,18 @@ RowLayout {
QQC2.ToolButton {
visible: !Kirigami.Settings.isMobile
icon.name: sidebar.collapsed ? "sidebar-expand" : "sidebar-collapse"
icon.name: mainDrawer.collapsed ? "sidebar-expand" : "sidebar-collapse"
onClicked: {
if(sidebar.collapsed && !wideScreen) { // Collapsed due to narrow window
if(mainDrawer.collapsed && !wideScreen) { // Collapsed due to narrow window
// We don't want to write to config as when narrow the button will only open the modal drawer
sidebar.collapsed = !sidebar.collapsed;
mainDrawer.collapsed = !mainDrawer.collapsed;
} else {
Config.forceCollapsedSidebar = !Config.forceCollapsedSidebar;
Config.forceCollapsedMainDrawer = !Config.forceCollapsedMainDrawer;
Config.save()
}
}
QQC2.ToolTip.text: sidebar.collapsed ? i18n("Expand Sidebar") : i18n("Collapse Sidebar")
QQC2.ToolTip.text: mainDrawer.collapsed ? i18n("Expand Main Drawer") : i18n("Collapse Main Drawer")
QQC2.ToolTip.visible: hovered
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
}
......
......@@ -8,7 +8,7 @@ import org.kde.kirigami 2.15 as Kirigami
import org.kde.kalendar 1.0
Kirigami.Page {
id: deleteSheet
id: deletePage
signal deleteCollection(int collectionId)
signal cancel
......@@ -26,7 +26,7 @@ Kirigami.Page {
enabled: collectionId !== undefined
shortcut: "Return"
onTriggered: {
deleteCollection(deleteSheet.collectionId);
deleteCollection(deletePage.collectionId);
}
}
......@@ -63,7 +63,7 @@ Kirigami.Page {
QQC2.Button {
icon.name: "delete"
text: i18n("Delete")
onClicked: deleteCollection(deleteSheet.collectionId)
onClicked: deleteCollection(deletePage.collectionId)
}
QQC2.Button {
......
......@@ -8,7 +8,7 @@ import org.kde.kirigami 2.15 as Kirigami
import org.kde.kalendar 1.0
Kirigami.Page {
id: deleteSheet
id: deletePage
signal addException(date exceptionDate, var incidenceWrapper)
signal addRecurrenceEndDate(date endDate, var incidenceWrapper)
......@@ -54,11 +54,11 @@ Kirigami.Page {
QQC2.Label {
Layout.fillWidth: true
text: if(incidenceWrapper.recurrenceData.type === 0 && !deleteSheet.incidenceHasChildren) {
text: if(incidenceWrapper.recurrenceData.type === 0 && !deletePage.incidenceHasChildren) {
return i18n("Do you want to delete item: \"%1\"?", incidenceWrapper.summary)
} else if(incidenceWrapper.recurrenceData.type === 0 && deleteSheet.incidenceHasChildren) {
} else if(incidenceWrapper.recurrenceData.type === 0 && deletePage.incidenceHasChildren) {
return i18n("Item \"%1\" has sub-items. Do you want to delete all related items, or just the currently selected item?", incidenceWrapper.summary)
} else if (incidenceWrapper.recurrenceData.type > 0 && deleteSheet.incidenceHasChildren) {
} else if (incidenceWrapper.recurrenceData.type > 0 && deletePage.incidenceHasChildren) {
return i18n("The calendar item \"%1\" recurs over multiple dates. This item also has sub-items.\n\nDo you want to delete the selected occurrence on %2, also future occurrences, or all of its occurrences?\n\nDeleting all will also delete sub-items!", incidenceWrapper.summary, deleteDate.toLocaleDateString(Qt.locale()))
} else if (incidenceWrapper.recurrenceData.type > 0) {
return i18n("The calendar item \"%1\" recurs over multiple dates. Do you want to delete the selected occurrence on %2, also future occurrences, or all of its occurrences?", incidenceWrapper.summary, deleteDate.toLocaleDateString(Qt.locale()))
......@@ -99,14 +99,14 @@ Kirigami.Page {
QQC2.Button {
icon.name: "group-delete"
text: i18n("Delete Only This")
visible: deleteSheet.incidenceHasChildren && incidenceWrapper.recurrenceData.type === 0
visible: deletePage.incidenceHasChildren && incidenceWrapper.recurrenceData.type === 0
onClicked: deleteIncidence(incidenceWrapper.incidencePtr)
}
QQC2.Button {
icon.name: "delete"
text: deleteSheet.incidenceHasChildren || incidenceWrapper.recurrenceData.type > 0 ? i18n("Delete All") : i18n("Delete")
onClicked: deleteSheet.incidenceHasChildren ? deleteIncidenceWithChildren(incidenceWrapper.incidencePtr) : deleteIncidence(incidenceWrapper.incidencePtr)
text: deletePage.incidenceHasChildren || incidenceWrapper.recurrenceData.type > 0 ? i18n("Delete All") : i18n("Delete")
onClicked: deletePage.incidenceHasChildren ? deleteIncidenceWithChildren(incidenceWrapper.incidencePtr) : deleteIncidence(incidenceWrapper.incidencePtr)
}
QQC2.Button {
......
......@@ -8,7 +8,7 @@ import org.kde.kirigami 2.15 as Kirigami
import org.kde.kalendar 1.0
Kirigami.Page {
id: deleteSheet
id: recurringIncidenceChangePage
signal changeAll
signal changeThis
......@@ -61,7 +61,7 @@ Kirigami.Page {
shortcut: "Return"
text: i18n("Only This Item")
onTriggered: {
deleteSheet.setAllDay();
recurringIncidenceChangePage.setAllDay();
changeThis();
}
},
......@@ -69,7 +69,7 @@ Kirigami.Page {
icon.name: "edit-table-delete-row"
text: i18n("Also Future Items")
onTriggered: {
deleteSheet.setAllDay();
recurringIncidenceChangePage.setAllDay();
changeThisAndFuture();
}
},
......@@ -77,7 +77,7 @@ Kirigami.Page {
icon.name: "group-delete"
text: i18n("All Occurrences")
onTriggered: {
deleteSheet.setAllDay();
recurringIncidenceChangePage.setAllDay();
changeAll();
}
},
......
......@@ -14,7 +14,7 @@ import org.kde.kitemmodels 1.0
import QtGraphicalEffects 1.12
Kirigami.OverlayDrawer {
id: sidebar
id: mainDrawer
signal calendarClicked(int collectionId)
signal calendarCheckChanged(int collectionId, bool checked)
......@@ -30,16 +30,16 @@ Kirigami.OverlayDrawer {
Connections {
target: applicationWindow()
function onWidthChanged() {
if(!Kirigami.Settings.isMobile && !Config.forceCollapsedSidebar) {
sidebar.collapsed = applicationWindow().width < Kirigami.Units.gridUnit * 50
if(!Kirigami.Settings.isMobile && !Config.forceCollapsedMainDrawer) {
mainDrawer.collapsed = applicationWindow().width < Kirigami.Units.gridUnit * 50
} // HACK: Workaround for incredibly glitchy behaviour caused by using wideScreen property
}
}
Connections {
target: Config
function onForceCollapsedSidebarChanged() {
sidebar.collapsed = Config.forceCollapsedSidebar;
function onForceCollapsedMainDrawerChanged() {
mainDrawer.collapsed = Config.forceCollapsedMainDrawer;
}
}
......@@ -48,10 +48,10 @@ Kirigami.OverlayDrawer {
handleVisible: modal
handleClosedIcon.source: null
handleOpenIcon.source: null
width: sidebar.collapsed ? menu.Layout.minimumWidth + Kirigami.Units.smallSpacing : Kirigami.Units.gridUnit * 16
width: mainDrawer.collapsed ? menu.Layout.minimumWidth + Kirigami.Units.smallSpacing : Kirigami.Units.gridUnit * 16
Component.onCompleted: {
collapsed = Config.forceCollapsedSidebar // Fix crashing caused by setting on load
collapsed = Config.forceCollapsedMainDrawer // Fix crashing caused by setting on load
ContactManager.contactCollections; // Fix crashing because the contactCollections was created too late
}
Behavior on width { NumberAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad } }
......@@ -73,8 +73,8 @@ Kirigami.OverlayDrawer {
Layout.fillWidth: true
Layout.preferredHeight: pageStack.globalToolBar.preferredHeight
leftPadding: sidebar.collapsed ? 0 : Kirigami.Units.smallSpacing
rightPadding: sidebar.collapsed ? Kirigami.Units.smallSpacing / 2 : Kirigami.Units.smallSpacing
leftPadding: mainDrawer.collapsed ? 0 : Kirigami.Units.smallSpacing
rightPadding: mainDrawer.collapsed ? Kirigami.Units.smallSpacing / 2 : Kirigami.Units.smallSpacing
topPadding: 0
bottomPadding: 0
......@@ -86,7 +86,7 @@ Kirigami.OverlayDrawer {
text: i18n("Kalendar")
visible: !searchField.visible
opacity: sidebar.collapsed ? 0 : 1
opacity: mainDrawer.collapsed ? 0 : 1
Behavior on opacity {
OpacityAnimator {
duration: Kirigami.Units.longDuration
......@@ -99,8 +99,8 @@ Kirigami.OverlayDrawer {
id: searchField
Layout.fillWidth: true
visible: sidebar.mode !== KalendarApplication.Event
opacity: sidebar.collapsed ? 0 : 1
visible: mainDrawer.mode !== KalendarApplication.Event
opacity: mainDrawer.collapsed ? 0 : 1
Behavior on opacity {
OpacityAnimator {
duration: Kirigami.Units.longDuration
......@@ -209,7 +209,7 @@ Kirigami.OverlayDrawer {
checkable: false
onTriggered: {
monthViewAction.trigger()
if (sidebar.modal) sidebar.close()
if (mainDrawer.modal) mainDrawer.close()
}
},
KActionFromAction {
......@@ -222,7 +222,7 @@ Kirigami.OverlayDrawer {
pageStack.currentItem.objectName == "dayView"
onTriggered: {
weekViewAction.trigger()
if (sidebar.modal) sidebar.close()
if (mainDrawer.modal) mainDrawer.close()
}
},
KActionFromAction {
......@@ -230,7 +230,7 @@ Kirigami.OverlayDrawer {
checkable: false
onTriggered: {
scheduleViewAction.trigger()
if (sidebar.modal) sidebar.close()
if (mainDrawer.modal) mainDrawer.close()
}
},
KActionFromAction {
......@@ -238,7 +238,7 @@ Kirigami.OverlayDrawer {
checkable: false
onTriggered: {
todoViewAction.trigger()
if (sidebar.modal) sidebar.close()
if (mainDrawer.modal) mainDrawer.close()
}
},
KActionFromAction {
......@@ -246,7 +246,7 @@ Kirigami.OverlayDrawer {
checkable: false
onTriggered: {
contactViewAction.trigger()
if (sidebar.modal) sidebar.close()
if (mainDrawer.modal) mainDrawer.close()
}
}
]
......@@ -265,7 +265,7 @@ Kirigami.OverlayDrawer {
kalendarAction: "open_tag_manager"
onTriggered: {
tagManagerAction.trigger()
if (sidebar.modal) sidebar.close()
if (mainDrawer.modal) mainDrawer.close()
}
},
KActionFromAction {
......@@ -273,7 +273,7 @@ Kirigami.OverlayDrawer {
kalendarAction: "options_configure"
onTriggered: {
configureAction.trigger()
if (sidebar.modal) sidebar.close()
if (mainDrawer.modal) mainDrawer.close()
}
}
]
......@@ -300,7 +300,7 @@ Kirigami.OverlayDrawer {
height: 1
z: -2
opacity: sidebar.collapsed ? 0 : 1
opacity: mainDrawer.collapsed ? 0 : 1
Behavior on opacity {
OpacityAnimator {
duration: Kirigami.Units.longDuration
......@@ -327,7 +327,7 @@ Kirigami.OverlayDrawer {
clip: true
z: -2
opacity: sidebar.collapsed ? 0 : 1
opacity: mainDrawer.collapsed ? 0 : 1
Behavior on opacity {
OpacityAnimator {
duration: Kirigami.Units.longDuration
......@@ -401,8 +401,8 @@ Kirigami.OverlayDrawer {
text: model.display
showAction: false
activeFocusOnTab: true
backgroundColor: sidebar.activeTags.includes(model.display) ? Kirigami.Theme.highlightColor : Kirigami.Theme.backgroundColor
enabled: !sidebar.collapsed
backgroundColor: mainDrawer.activeTags.includes(model.display) ? Kirigami.Theme.highlightColor : Kirigami.Theme.backgroundColor
enabled: !mainDrawer.collapsed
onClicked: tagClicked(model.display)
}
}
......@@ -450,7 +450,7 @@ Kirigami.OverlayDrawer {
id: calendarList
property var calendarModel: KDescendantsProxyModel {
model: switch(sidebar.mode) {
model: switch(mainDrawer.mode) {
case KalendarApplication.Todo:
return CalendarManager.todoCollections;
case KalendarApplication.Event:
......@@ -458,7 +458,7 @@ Kirigami.OverlayDrawer {
case KalendarApplication.Contact:
return ContactManager.contactCollections;
default:
console.log('Should not happen', sidebar.mode)
console.log('Should not happen', mainDrawer.mode)
}
}
......@@ -480,7 +480,7 @@ Kirigami.OverlayDrawer {
(Kirigami.Units.largeSpacing * 2 * model.kDescendantLevel) + (Kirigami.Units.iconSizes.smallMedium * (model.kDescendantLevel - 1)) :
(Kirigami.Units.largeSpacing * model.kDescendantLevel) + (Kirigami.Units.iconSizes.smallMedium * (model.kDescendantLevel - 1))
hoverEnabled: false
enabled: !sidebar.collapsed
enabled: !mainDrawer.collapsed
separatorVisible: false
......@@ -575,7 +575,7 @@ Kirigami.OverlayDrawer {
(Kirigami.Units.largeSpacing * 2 * model.kDescendantLevel) + (Kirigami.Units.iconSizes.smallMedium * (model.kDescendantLevel - 1)) :
(Kirigami.Units.largeSpacing * model.kDescendantLevel) + (Kirigami.Units.iconSizes.smallMedium * (model.kDescendantLevel - 1))
separatorVisible: false
enabled: !sidebar.collapsed
enabled: !mainDrawer.collapsed
highlighted: visualFocus || incidenceDropArea.containsDrag
leading: Kirigami.Icon {
......@@ -600,7 +600,7 @@ Kirigami.OverlayDrawer {
onClicked: {
calendarClicked(collectionId);
if(sidebar.modal) sidebar.close()
if(mainDrawer.modal) mainDrawer.close()
}
CalendarItemMouseArea {
......@@ -611,7 +611,7 @@ Kirigami.OverlayDrawer {
anchors.fill: parent
enabled: mode !== KalendarApplication.Contact
onDeleteCalendar: sidebar.deleteCalendar(collectionId, collectionDetails)
onDeleteCalendar: mainDrawer.deleteCalendar(collectionId, collectionDetails)
DropArea {
id: incidenceDropArea
......@@ -649,11 +649,11 @@ Kirigami.OverlayDrawer {
icon: "show-all-effects"
label: i18n("View all tasks")
labelItem.color: Kirigami.Theme.textColor
visible: sidebar.mode === KalendarApplication.Todo
visible: mainDrawer.mode === KalendarApplication.Todo
separatorVisible: false
onClicked: {
viewAllTodosClicked();
if(sidebar.modal && sidebar.mode === KalendarApplication.Todo) sidebar.close()
if(mainDrawer.modal && mainDrawer.mode === KalendarApplication.Todo) mainDrawer.close()
}
}
}
......@@ -24,8 +24,8 @@ QtObject {
}
appMain.pageStack.replace(newViewComponent);
if (appMain.filterHeaderLoaderItem.active && appMain.pageStack.currentItem.mode !== KalendarApplication.Contact) {
appMain.pageStack.currentItem.header = appMain.filterHeaderLoaderItem.item;
if (appMain.filterHeaderBarLoaderItem.active && appMain.pageStack.currentItem.mode !== KalendarApplication.Contact) {
appMain.pageStack.currentItem.header = appMain.filterHeaderBarLoaderItem.item;
}
if(viewSettings) {
......@@ -42,10 +42,10 @@ QtObject {
function editorToUse() {
if (!Kirigami.Settings.isMobile) {
appMain.editorWindowedLoaderItem.active = true
return appMain.editorWindowedLoaderItem.item.incidenceEditor
return appMain.editorWindowedLoaderItem.item.incidenceEditorPage
} else {
appMain.pageStack.layers.push(incidenceEditor);
return incidenceEditor;
appMain.pageStack.layers.push(incidenceEditorPage);
return incidenceEditorPage;
}
}
......@@ -126,7 +126,7 @@ QtObject {
let incidenceWrapper = Qt.createQmlObject('import org.kde.kalendar 1.0; IncidenceWrapper {id: incidence}', utilsObject, "incidence");
incidenceWrapper.incidenceItem = CalendarManager.incidenceItem(incidencePtr);
const openDialogWindow = appMain.pageStack.pushDialogLayer(appMain.deleteIncidenceSheetComponent, {
const openDialogWindow = appMain.pageStack.pushDialogLayer(appMain.deleteIncidencePageComponent, {
incidenceWrapper: incidenceWrapper,
deleteDate: deleteDate
}, {
......@@ -163,7 +163,7 @@ QtObject {
CalendarManager.updateIncidenceDates(incidenceWrapper, startOffset, endOffset);
} else {
const onClosingHandler = () => { caughtDelegate.caught = false; utilsObject.reenableDragOnCurrentView(); };
const openDialogWindow = appMain.pageStack.pushDialogLayer(appMain.recurringIncidenceChangeSheetComponent, {
const openDialogWindow = appMain.pageStack.pushDialogLayer(appMain.recurringIncidenceChangePageComponent, {
incidenceWrapper: incidenceWrapper,
startOffset: startOffset,
endOffset: endOffset,
......
......@@ -168,7 +168,7 @@ function isDarkColor(background) {
return temp.a > 0 && getDarkness(background) >= 0.4;
}
function getIncidenceBackgroundColor(color, darkMode) {
function getIncidenceDelegateBackgroundColor(color, darkMode) {
let bgColor = getDarkness(color) > 0.9 ? Qt.lighter(color, 1.5) : color;
if(darkMode) {
if(getDarkness(color) >= 0.5) {
......
......@@ -52,21 +52,21 @@ Item {
property int dayWidth: Kalendar.Config.showWeekNumbers ?
((width - weekHeaderWidth) / daysPerRow) - spacing : // No spacing on right, spacing in between weekheader and monthgrid
(width - weekHeaderWidth - (spacing * (daysPerRow - 1))) / daysPerRow // No spacing on left or right of month grid when no week header
property int dayHeight: ((height - bgLoader.dayLabels.height) / numberOfRows) - spacing
property int dayHeight: ((height - bgLoader.dayLabelsBar.height) / numberOfRows) - spacing
property int spacing: Kalendar.Config.monthGridBorderWidth // Between grid squares in background
property int listViewSpacing: root.dayWidth < (Kirigami.Units.gridUnit * 5 + Kirigami.Units.smallSpacing * 2) ?
Kirigami.Units.smallSpacing / 2 : Kirigami.Units.smallSpacing // Between lines of incidences ( ====== <- )
readonly property bool isDark: LabelUtils.isDarkColor(Kirigami.Theme.backgroundColor)
readonly property int mode: Kalendar.KalendarApplication.Event
implicitHeight: (numberOfRows > 1 ? Kirigami.Units.gridUnit * 10 * numberOfRows : numberOfLinesShown * Kirigami.Units.gridUnit) + bgLoader.dayLabels.height
implicitHeight: (numberOfRows > 1 ? Kirigami.Units.gridUnit * 10 * numberOfRows : numberOfLinesShown * Kirigami.Units.gridUnit) + bgLoader.dayLabelsBar.height
height: implicitHeight
Kirigami.Separator {
id: gridBackground
anchors {
fill: parent
topMargin: root.bgLoader.dayLabels.height
topMargin: root.bgLoader.dayLabelsBar.height
}
visible: backgroundLoader.status === Loader.Ready
}
......@@ -80,9 +80,9 @@ Item {
spacing: root.spacing
anchors.fill: parent
property alias dayLabels: dayLabelsComponent
DayLabels {
id: dayLabelsComponent
property alias dayLabelsBar: dayLabelsBarComponent
DayLabelsBar {
id: dayLabelsBarComponent
delegate: root.dayHeaderDelegate
startDate: root.startDate
dayWidth: root.dayWidth
......@@ -238,7 +238,7 @@ Item {
spacing: root.spacing
anchors {
fill: parent
topMargin: root.bgLoader.dayLabels.height + root.spacing
topMargin: root.bgLoader.dayLabelsBar.height + root.spacing
leftMargin: Kalendar.Config.showWeekNumbers ? weekHeaderWidth + root.spacing : 0
}
......@@ -315,7 +315,7 @@ Item {
id: incidencesRepeater
model: modelData
MultiDayViewIncidenceDelegate {
DayGridViewIncidenceDelegate {
id: incidenceDelegate
dayWidth: root.dayWidth
height: line.height
......
......@@ -407,12 +407,12 @@ Kirigami.Page {
asynchronous: !viewLoader.isCurrentItem
active: switch(root.daysToShow) {
case 1:
return dayViewMultiDayViewModel.incidenceCount > 0;
return dayViewDayGridViewModel.incidenceCount > 0;
case 3:
return threeDayViewMultiDayViewModel.incidenceCount > 0;
return threeDayViewDayGridViewModel.incidenceCount > 0;
case 7:
default:
return weekViewMultiDayViewModel.incidenceCount > 0;
return weekViewDayGridViewModel.incidenceCount > 0;
}
sourceComponent: Item {
id: allDayViewItem
......@@ -422,12 +422,12 @@ Kirigami.Page {
Repeater {
model: switch(root.daysToShow) {
case 1:
return dayViewMultiDayViewModel;
return dayViewDayGridViewModel;
case 3:
return threeDayViewMultiDayViewModel;
return threeDayViewDayGridViewModel;
case 7:
default:
return weekViewMultiDayViewModel;
return weekViewDayGridViewModel;
} // from root.model
Layout.topMargin: Kirigami.Units.largeSpacing
//One row => one week
......@@ -516,7 +516,7 @@ Kirigami.Page {
/* There are 2 possibilities here: we move multiday incidence between days or we move hourly incidence
* to convert it into multiday incidence
*/
if (drop.source.objectName === 'hourlyIncidenceDelegate') {
if (drop.source.objectName === 'hourlyIncidenceDelegateBackgroundBackground') {
// This is conversion from non-multiday to multiday
root.convertIncidence(true, offset, offset, drop.source.occurrenceDate, incidenceWrapper, drop.source);
} else {
......@@ -541,9 +541,9 @@ Kirigami.Page {
Repeater {
id: allDayIncidencesRepeater
model: modelData
MultiDayViewIncidenceDelegate {
id: multiDayIncidenceDelegate
objectName: "multiDayIncidenceDelegate"
DayGridViewIncidenceDelegate {
id: dayGridViewIncidenceDelegate
objectName: "dayGridViewIncidenceDelegate"
dayWidth: root.dayWidth
height: Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing
parentViewSpacing: root.gridLineWidth
......@@ -823,11 +823,11 @@ Kirigami.Page {
z: 9999
onDropped: if(viewLoader.isCurrentItem) {
let incidenceWrapper = Qt.createQmlObject('import org.kde.kalendar 1.0; IncidenceWrapper {id: incidence}', hourlyViewIncidenceDropArea, "incidence");
/* So when we drop the entire incidence card somewhere, we are dropping the delegate with object name "hourlyIncidenceDelegate" or "multiDayIncidenceDelegate" in case when all day event is converted to the hour incidence.
/* So when we drop the entire incidence card somewhere, we are dropping the delegate with object name "hourlyIncidenceDelegateBackgroundBackground" or "multiDayIncidenceDelegateBackgroundBackground" in case when all day event is converted to the hour incidence.
* However, when we are simply resizing, we are actually dropping the specific mouseArea within the delegate that handles
* the dragging for the incidence's bottom edge which has name "endDtResizeMouseArea". Hence why we check the object names
*/
if(drop.source.objectName === "hourlyIncidenceDelegate") {
if(drop.source.objectName === "hourlyIncidenceDelegateBackgroundBackground") {