From a59d5c452081be197ad9400081f818a25122d4cc Mon Sep 17 00:00:00 2001 From: gregor herrmann Date: Thu, 19 Aug 2021 15:30:28 +0200 Subject: [PATCH] Take display time shift into account when expanding a group in the day view tab. --- src/gui/dayviewtabcontainer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/dayviewtabcontainer.cpp b/src/gui/dayviewtabcontainer.cpp index 8b06716..5427fd8 100644 --- a/src/gui/dayviewtabcontainer.cpp +++ b/src/gui/dayviewtabcontainer.cpp @@ -26,6 +26,7 @@ DayViewTabContainer::DayViewTabContainer(QWidget *aParent): TabContainer(aParent void DayViewTabContainer::expandTimeGroup(QTime time, int conferenceId) { EventModel* eventModel = static_cast(treeView->model()); + Conference conference = Conference::getById(conferenceId); // iterate over the time groups for (int g = 0; g != eventModel->rowCount(); ++g) { @@ -35,7 +36,9 @@ void DayViewTabContainer::expandTimeGroup(QTime time, int conferenceId) { QModelIndex eventIdx = eventModel->index(e, 0, groupIdx); int eventId = eventIdx.data().toInt(); Event event = Event::getById(eventId, conferenceId); - if (time < event.start().time().addSecs(event.duration())) { // if time < end + QDateTime eventStart = event.start(); + if (conference.hasDisplayTimeShift()) eventStart = eventStart.addSecs(conference.displayTimeShift() * 60); + if (time < eventStart.time().addSecs(event.duration())) { // if time < end // expand this group treeView->expand(groupIdx); treeView->scrollTo(eventIdx, QAbstractItemView::PositionAtTop); -- 2.39.5