Commit 525ebb2e authored by Claudio Cambra's avatar Claudio Cambra
Browse files

Move week view 'scales' from independent entries in sidebar to toggleable header buttons

This should help free up the sidebar a bit 😄 

![image](/uploads/ec692bcf78b69193ea43cce786abf930/image.png)
parent 8ab430ca
Pipeline #176838 passed with stage
in 3 minutes and 4 seconds
......@@ -210,20 +210,17 @@ Kirigami.OverlayDrawer {
},
KActionFromAction {
kalendarAction: "open_week_view"
checkable: false
// Override the default checkable behaviour as we want this to stay highlighted
// in any of the hourly views, at least in desktop mode
checkable: true
checked: pageStack.currentItem.objectName == "weekView" ||
pageStack.currentItem.objectName == "threeDayView" ||
pageStack.currentItem.objectName == "dayView"
onTriggered: {
weekViewAction.trigger()
if (sidebar.modal) sidebar.close()
}
},
KActionFromAction {
kalendarAction: "open_day_view"
checkable: false
onTriggered: {
dayViewAction.trigger()
if (sidebar.modal) sidebar.close()
}
},
KActionFromAction {
kalendarAction: "open_schedule_view"
checkable: false
......
......@@ -20,7 +20,7 @@ Kirigami.ApplicationWindow {
width: Kirigami.Units.gridUnit * 65
minimumWidth: Kirigami.Units.gridUnit * 15
minimumWidth: Kirigami.Units.gridUnit * 25
minimumHeight: Kirigami.Units.gridUnit * 20
onClosing: KalendarApplication.saveWindowGeometry(root)
......@@ -1256,6 +1256,34 @@ Kirigami.ApplicationWindow {
titleDateButton.date: hourlyView.startDate
titleDateButton.lastDate: DateUtils.addDaysToDate(hourlyView.startDate, hourlyView.daysToShow - 1)
titleDateButton.onClicked: dateChangeDrawer.active = !dateChangeDrawer.active
Kirigami.ActionToolBar {
id: weekViewScaleToggles
Layout.preferredWidth: weekViewScaleToggles.maximumContentWidth
Layout.leftMargin: Kirigami.Units.largeSpacing
visible: !Kirigami.Settings.isMobile
actions: [
Kirigami.Action {
text: "Week"
checkable: true
checked: pageStack.currentItem.objectName == "weekView"
onTriggered: weekViewAction.trigger()
},
Kirigami.Action {
text: "3 Days"
checkable: true
checked: pageStack.currentItem.objectName == "threeDayView"
onTriggered: threeDayViewAction.trigger()
},
Kirigami.Action {
text: "Day"
checkable: true
checked: pageStack.currentItem.objectName == "dayView"
onTriggered: dayViewAction.trigger()
}
]
}
}
selectedDate: root.selectedDate
currentDate: root.currentDate
......
Supports Markdown
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