Add a calendar to the action drawer

Use the unused lower-left convergence space for KDE's MonthView\ninstead of leaving wallpaper exposed below the notification list.
This commit is contained in:
Marco Allegretti 2026-05-24 15:48:57 +02:00
parent 2e8ab6a741
commit 2d7e689d8d

View file

@ -6,10 +6,12 @@ import QtQuick.Controls 2.15
import QtQuick.Window 2.2 import QtQuick.Window 2.2
import QtQuick.Layouts import QtQuick.Layouts
import org.kde.plasma.clock
import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.plasma.private.mobileshell as MobileShell import org.kde.plasma.private.mobileshell as MobileShell
import org.kde.plasma.components 3.0 as PC3 import org.kde.plasma.components 3.0 as PC3
import org.kde.kirigami as Kirigami import org.kde.kirigami as Kirigami
import org.kde.plasma.workspace.calendar as PlasmaCalendar
import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
@ -28,7 +30,7 @@ Item {
readonly property bool swipeAreaMoving: swipeAreaBase.moving || swipeAreaPortrait.moving readonly property bool swipeAreaMoving: swipeAreaBase.moving || swipeAreaPortrait.moving
readonly property bool isConvergence: ShellSettings.Settings.convergenceModeEnabled readonly property bool isConvergence: ShellSettings.Settings.convergenceModeEnabled
readonly property real convergenceFrameThickness: MobileShell.Constants.convergenceWorkspaceFrameThickness readonly property real convergenceFrameThickness: MobileShell.Constants.convergenceWorkspaceFrameThickness
readonly property real convergenceSurfaceTopInset: MobileShell.Constants.topPanelHeight readonly property real convergenceSurfaceTopInset: MobileShell.Constants.topPanelHeight + convergenceFrameThickness
readonly property real convergenceSurfaceBottomInset: MobileShell.Constants.convergenceDockHeight + convergenceFrameThickness readonly property real convergenceSurfaceBottomInset: MobileShell.Constants.convergenceDockHeight + convergenceFrameThickness
readonly property real convergenceSurfaceSideInset: 0 readonly property real convergenceSurfaceSideInset: 0
readonly property real convergenceSurfaceWidth: Math.max(0, width - convergenceSurfaceSideInset * 2) readonly property real convergenceSurfaceWidth: Math.max(0, width - convergenceSurfaceSideInset * 2)
@ -165,6 +167,44 @@ Item {
} }
} }
} }
Item {
id: convergenceCalendarPanel
visible: root.isConvergence && actionDrawer.mode != MobileShell.ActionDrawer.Portrait
opacity: Math.max(0, Math.min(root.brightnessPressedValue, actionDrawer.offsetResistance / root.minimizedQuickSettingsOffset))
clip: true
anchors {
top: parent.top
left: parent.left
right: parent.right
bottom: parent.bottom
topMargin: notificationDrawer.hasNotifications
? toolButtons.y + toolButtons.height + Kirigami.Units.smallSpacing
: notificationDrawer.y + notificationDrawer.height + Kirigami.Units.largeSpacing
leftMargin: root.convergenceSurfaceSideInset + Kirigami.Units.gridUnit
rightMargin: root.convergenceNotificationRightMargin + Kirigami.Units.gridUnit
bottomMargin: root.convergenceSurfaceBottomInset + Kirigami.Units.largeSpacing
}
Kirigami.Theme.colorSet: Kirigami.Theme.View
Kirigami.Theme.inherit: false
MobileShell.PanelBackground {
anchors.fill: parent
panelType: MobileShell.PanelBackground.PanelType.Drawer
}
PlasmaCalendar.MonthView {
anchors.fill: parent
anchors.margins: Kirigami.Units.smallSpacing
borderOpacity: 0.25
today: calendarClock.dateTime
eventPluginsManager: eventPluginsManager
}
}
} }
// notification drawer ui // notification drawer ui
@ -173,7 +213,6 @@ Item {
id: notificationDrawer id: notificationDrawer
readonly property bool isConvergence: root.isConvergence readonly property bool isConvergence: root.isConvergence
swipeArea: swipeAreaPortrait swipeArea: swipeAreaPortrait
actionDrawer: root.actionDrawer actionDrawer: root.actionDrawer
mediaControlsWidget: root.mediaControlsWidget mediaControlsWidget: root.mediaControlsWidget
@ -301,4 +340,12 @@ Item {
id: mediaWidget id: mediaWidget
opacity: brightnessPressedValue opacity: brightnessPressedValue
} }
Clock {
id: calendarClock
}
PlasmaCalendar.EventPluginsManager {
id: eventPluginsManager
}
} }