Add Ongoing to the Panama Daybook
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// The approved A · Daybook: month context on the left, the selected day's
|
||||
// schedule or grouped notification history on the right.
|
||||
// schedule, persistent activity or grouped notification history on the right.
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
@@ -46,7 +46,7 @@ Item {
|
||||
Text {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 4
|
||||
anchors.right: headerActions.left
|
||||
anchors.right: dateMenuTabs.left
|
||||
anchors.rightMargin: Theme.itemSpacing
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: Qt.formatDateTime(clock.date, "dddd, MMMM d")
|
||||
@@ -59,35 +59,36 @@ Item {
|
||||
}
|
||||
|
||||
Row {
|
||||
id: headerActions
|
||||
id: dateMenuTabs
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: 6
|
||||
|
||||
HeaderPill {
|
||||
visible: ShellState.dateMenuPage === "notifications"
|
||||
text: "← Back to agenda"
|
||||
text: "Agenda"
|
||||
active: ShellState.dateMenuPage === "agenda"
|
||||
onClicked: ShellState.dateMenuPage = "agenda"
|
||||
}
|
||||
|
||||
HeaderPill {
|
||||
text: "Do Not Disturb"
|
||||
active: Notifs.doNotDisturb
|
||||
icon: "notifications-disabled-symbolic"
|
||||
onClicked: Notifs.doNotDisturb = !Notifs.doNotDisturb
|
||||
text: "Ongoing"
|
||||
active: ShellState.dateMenuPage === "ongoing"
|
||||
badge: Ongoing.count
|
||||
onClicked: ShellState.dateMenuPage = "ongoing"
|
||||
}
|
||||
|
||||
HeaderPill {
|
||||
text: "Notifications"
|
||||
active: ShellState.dateMenuPage === "notifications"
|
||||
badge: Notifs.history.length
|
||||
onClicked: ShellState.dateMenuPage = "notifications"
|
||||
}
|
||||
|
||||
HeaderPill {
|
||||
visible: ShellState.dateMenuPage === "agenda"
|
||||
text: "Open Calendar ↗"
|
||||
text: "Calendar ↗"
|
||||
onClicked: CalendarAgenda.openCalendar(CalendarAgenda.selectedDate)
|
||||
}
|
||||
|
||||
HeaderPill {
|
||||
visible: ShellState.dateMenuPage === "notifications" && Notifs.hasNotifications
|
||||
text: "Clear all"
|
||||
onClicked: Notifs.dismissAll()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,10 +166,16 @@ Item {
|
||||
anchors.top: parent.top
|
||||
anchors.margins: 14
|
||||
visible: ShellState.dateMenuPage === "agenda"
|
||||
onRequestNotifications: {
|
||||
ShellState.dateMenuPage = "notifications";
|
||||
Notifs.markAllRead();
|
||||
}
|
||||
}
|
||||
|
||||
OngoingPane {
|
||||
id: ongoingPane
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.margins: 14
|
||||
maxHeight: body.height - 28
|
||||
visible: ShellState.dateMenuPage === "ongoing"
|
||||
}
|
||||
|
||||
Column {
|
||||
@@ -186,6 +193,8 @@ Item {
|
||||
|
||||
Text {
|
||||
anchors.left: parent.left
|
||||
anchors.right: notificationActions.left
|
||||
anchors.rightMargin: 8
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: "Notifications"
|
||||
color: Theme.fg
|
||||
@@ -194,14 +203,24 @@ Item {
|
||||
font.weight: Font.DemiBold
|
||||
}
|
||||
|
||||
Text {
|
||||
Row {
|
||||
id: notificationActions
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: Notifs.history.length + (Notifs.history.length === 1 ? " item" : " items")
|
||||
color: Theme.fgDim
|
||||
font.family: Theme.fontFamily
|
||||
font.features: Theme.tabularFigures
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
spacing: 6
|
||||
|
||||
HeaderPill {
|
||||
text: "Do Not Disturb"
|
||||
active: Notifs.doNotDisturb
|
||||
icon: "notifications-disabled-symbolic"
|
||||
onClicked: Notifs.doNotDisturb = !Notifs.doNotDisturb
|
||||
}
|
||||
|
||||
HeaderPill {
|
||||
visible: Notifs.hasNotifications
|
||||
text: "Clear all"
|
||||
onClicked: Notifs.dismissAll()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,9 +234,14 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
readonly property real rightContentHeight: ShellState.dateMenuPage === "notifications"
|
||||
? notificationPane.implicitHeight
|
||||
: agenda.implicitHeight
|
||||
readonly property real rightContentHeight: {
|
||||
if (ShellState.dateMenuPage === "notifications")
|
||||
return notificationPane.implicitHeight;
|
||||
if (ShellState.dateMenuPage === "ongoing")
|
||||
return ongoingPane.implicitHeight;
|
||||
return agenda.implicitHeight;
|
||||
}
|
||||
readonly property bool ongoingContentFits: ongoingPane.implicitHeight <= body.height - 28
|
||||
|
||||
component HeaderPill: Rectangle {
|
||||
id: pill
|
||||
@@ -225,6 +249,7 @@ Item {
|
||||
required property string text
|
||||
property string icon: ""
|
||||
property bool active: false
|
||||
property int badge: -1
|
||||
signal clicked
|
||||
|
||||
width: pillRow.implicitWidth + 20
|
||||
@@ -260,6 +285,27 @@ Item {
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
font.weight: Font.Medium
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: pill.badge > 0
|
||||
width: visible ? badgeText.implicitWidth + 9 : 0
|
||||
height: 17
|
||||
radius: Theme.pillRadius
|
||||
border.width: 0
|
||||
color: Theme.alpha(pill.active ? Theme.accent : Theme.fg, 0.12)
|
||||
|
||||
Text {
|
||||
id: badgeText
|
||||
anchors.centerIn: parent
|
||||
text: String(pill.badge)
|
||||
color: pill.active ? Theme.accent : Theme.fgDim
|
||||
font.family: Theme.fontFamily
|
||||
font.features: Theme.tabularFigures
|
||||
font.pixelSize: 9
|
||||
font.weight: Font.DemiBold
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
|
||||
Reference in New Issue
Block a user