Garden was welded onto the notification list in CenterWidgetGroup — always on, unrelated, stealing space from notifications that said "Nothing". Moved it into the BottomWidgetGroup drawer as a fifth tab alongside Calendar, To Do, Pomodoro, and Stopwatch. CenterWidgetGroup is now just the notification list. Lens events (note_created, synced) emit through notify-send so they land in the notification system properly. Forked calendar, todo, pomodoro, notifications out of ii-base into our tree — the right sidebar no longer borrows any widget files from ii. Toggle dialogs (bluetooth, wifi, nightLight) still symlinked as infrastructure.
122 lines
No EOL
3.8 KiB
QML
122 lines
No EOL
3.8 KiB
QML
import qs.services
|
|
import qs.modules.common
|
|
import qs.modules.common.widgets
|
|
import "calendar_layout.js" as CalendarLayout
|
|
import QtQuick
|
|
import QtQuick.Layouts
|
|
|
|
Item {
|
|
// Layout.topMargin: 10
|
|
anchors.topMargin: 10
|
|
property int monthShift: 0
|
|
property var viewingDate: CalendarLayout.getDateInXMonthsTime(monthShift)
|
|
property var calendarLayout: CalendarLayout.getCalendarLayout(viewingDate, monthShift === 0)
|
|
width: calendarColumn.width
|
|
implicitHeight: calendarColumn.height + 10 * 2
|
|
|
|
Keys.onPressed: (event) => {
|
|
if ((event.key === Qt.Key_PageDown || event.key === Qt.Key_PageUp)
|
|
&& event.modifiers === Qt.NoModifier) {
|
|
if (event.key === Qt.Key_PageDown) {
|
|
monthShift++;
|
|
} else if (event.key === Qt.Key_PageUp) {
|
|
monthShift--;
|
|
}
|
|
event.accepted = true;
|
|
}
|
|
}
|
|
MouseArea {
|
|
anchors.fill: parent
|
|
onWheel: (event) => {
|
|
if (event.angleDelta.y > 0) {
|
|
monthShift--;
|
|
} else if (event.angleDelta.y < 0) {
|
|
monthShift++;
|
|
}
|
|
}
|
|
}
|
|
|
|
ColumnLayout {
|
|
id: calendarColumn
|
|
anchors.centerIn: parent
|
|
spacing: 5
|
|
|
|
// Calendar header
|
|
RowLayout {
|
|
Layout.fillWidth: true
|
|
spacing: 5
|
|
CalendarHeaderButton {
|
|
clip: true
|
|
buttonText: `${monthShift != 0 ? "• " : ""}${viewingDate.toLocaleDateString(Qt.locale(), "MMMM yyyy")}`
|
|
tooltipText: (monthShift === 0) ? "" : Translation.tr("Jump to current month")
|
|
downAction: () => {
|
|
monthShift = 0;
|
|
}
|
|
}
|
|
Item {
|
|
Layout.fillWidth: true
|
|
Layout.fillHeight: false
|
|
}
|
|
CalendarHeaderButton {
|
|
forceCircle: true
|
|
downAction: () => {
|
|
monthShift--;
|
|
}
|
|
contentItem: MaterialSymbol {
|
|
text: "chevron_left"
|
|
iconSize: Appearance.font.pixelSize.larger
|
|
horizontalAlignment: Text.AlignHCenter
|
|
color: Appearance.colors.colOnLayer1
|
|
}
|
|
}
|
|
CalendarHeaderButton {
|
|
forceCircle: true
|
|
downAction: () => {
|
|
monthShift++;
|
|
}
|
|
contentItem: MaterialSymbol {
|
|
text: "chevron_right"
|
|
iconSize: Appearance.font.pixelSize.larger
|
|
horizontalAlignment: Text.AlignHCenter
|
|
color: Appearance.colors.colOnLayer1
|
|
}
|
|
}
|
|
}
|
|
|
|
// Week days row
|
|
RowLayout {
|
|
id: weekDaysRow
|
|
Layout.alignment: Qt.AlignHCenter
|
|
Layout.fillHeight: false
|
|
spacing: 5
|
|
Repeater {
|
|
model: CalendarLayout.weekDays
|
|
delegate: CalendarDayButton {
|
|
day: Translation.tr(modelData.day)
|
|
isToday: modelData.today
|
|
bold: true
|
|
enabled: false
|
|
}
|
|
}
|
|
}
|
|
|
|
// Real week rows
|
|
Repeater {
|
|
id: calendarRows
|
|
// model: calendarLayout
|
|
model: 6
|
|
delegate: RowLayout {
|
|
Layout.alignment: Qt.AlignHCenter
|
|
Layout.fillHeight: false
|
|
spacing: 5
|
|
Repeater {
|
|
model: Array(7).fill(modelData)
|
|
delegate: CalendarDayButton {
|
|
day: calendarLayout[modelData][index].day
|
|
isToday: calendarLayout[modelData][index].today
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |