Skip to content

Commit db184e7

Browse files
committed
Calendar fix
1 parent ef405cb commit db184e7

5 files changed

Lines changed: 83 additions & 11 deletions

File tree

dot_files/quickshell/GlobalStates.qml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,10 @@ Singleton {
123123

124124
// OSD (On-Screen Display) state
125125
property bool osdVisible: false
126-
property string osdType: "volume" // "volume", "brightness", "mic"
126+
property string osdType: "volume" // "volume", "brightness", "mic", "tooltip"
127127
property real osdValue: 0.0
128128
property bool osdMuted: false
129+
property string osdTooltipText: "" // For tooltip mode
129130

130131
// Notification states
131132
property int unreadNotificationCount: 0

dot_files/quickshell/modules/bar/StatusBar.qml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,13 +359,27 @@ PanelWindow {
359359
: Common.Appearance.m3colors.onSurfaceVariant
360360
}
361361

362-
// Date and Time
362+
// Calendar / Date-Time
363363
BarButton {
364364
id: clockButton
365-
buttonText: Services.DateTime.dateString + " " + Services.DateTime.timeString
366-
tooltip: "Click to open calendar"
365+
icon: Common.Icons.icons.calendar
366+
tooltip: Services.DateTime.fullDateTimeString
367+
367368
onClicked: Root.GlobalStates.toggleSidebarRight(root.targetScreen, "calendar")
368369

370+
// Show tooltip OSD on hover
371+
onContainsMouseChanged: {
372+
if (containsMouse) {
373+
Root.GlobalStates.osdType = "tooltip"
374+
Root.GlobalStates.osdTooltipText = Services.DateTime.fullDateTimeString
375+
Root.GlobalStates.osdVisible = true
376+
} else {
377+
if (Root.GlobalStates.osdType === "tooltip") {
378+
Root.GlobalStates.osdVisible = false
379+
}
380+
}
381+
}
382+
369383
Timer {
370384
interval: 1000
371385
running: true

dot_files/quickshell/modules/osd/Osd.qml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,18 @@ PanelWindow {
1212
required property var targetScreen
1313
screen: targetScreen
1414

15-
// Center at the bottom of the screen
16-
anchors.bottom: true
15+
// Position at top right, below status bar
16+
anchors.top: true
17+
anchors.right: true
1718

18-
// Use margins to center horizontally
19-
margins.bottom: 100
19+
margins.top: Common.Appearance.sizes.barHeight + Common.Appearance.spacing.medium
20+
margins.right: Common.Appearance.spacing.medium
2021

21-
implicitWidth: Common.Appearance.sizes.osdWidth
22-
implicitHeight: Common.Appearance.sizes.osdHeight + Common.Appearance.spacing.large
22+
// Tooltip mode uses auto-sizing, progress mode uses fixed width
23+
property bool isTooltip: Root.GlobalStates.osdType === "tooltip"
24+
25+
implicitWidth: isTooltip ? tooltipContent.implicitWidth + Common.Appearance.spacing.large * 2 : Common.Appearance.sizes.osdWidth
26+
implicitHeight: isTooltip ? tooltipContent.implicitHeight + Common.Appearance.spacing.medium * 2 : Common.Appearance.sizes.osdHeight + Common.Appearance.spacing.large
2327
color: "transparent"
2428

2529
// Float on top of windows without reserving space
@@ -55,8 +59,20 @@ PanelWindow {
5559
border.color: Common.Appearance.m3colors.outlineVariant
5660
}
5761

58-
// OSD content
62+
// Tooltip content (for tooltip mode)
63+
Text {
64+
id: tooltipContent
65+
visible: root.isTooltip
66+
anchors.centerIn: parent
67+
text: Root.GlobalStates.osdTooltipText
68+
font.family: Common.Appearance.fonts.main
69+
font.pixelSize: Common.Appearance.fontSize.normal
70+
color: Common.Appearance.m3colors.onSurface
71+
}
72+
73+
// Progress OSD content (for volume/brightness/mic)
5974
RowLayout {
75+
visible: !root.isTooltip
6076
anchors.fill: parent
6177
anchors.margins: Common.Appearance.spacing.medium
6278
spacing: Common.Appearance.spacing.medium

dot_files/quickshell/modules/sidebars/CalendarView.qml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,43 @@ Flickable {
6060
}
6161
}
6262

63+
// Current date and time display
64+
Rectangle {
65+
Layout.fillWidth: true
66+
Layout.preferredHeight: dateTimeColumn.implicitHeight + Common.Appearance.spacing.medium * 2
67+
radius: Common.Appearance.rounding.large
68+
color: Common.Appearance.m3colors.primaryContainer
69+
70+
ColumnLayout {
71+
id: dateTimeColumn
72+
anchors.fill: parent
73+
anchors.margins: Common.Appearance.spacing.medium
74+
spacing: Common.Appearance.spacing.tiny
75+
76+
Text {
77+
Layout.fillWidth: true
78+
text: Services.DateTime.timeString
79+
font.family: Common.Appearance.fonts.main
80+
font.pixelSize: Common.Appearance.fontSize.display
81+
font.weight: Font.Medium
82+
color: Common.Appearance.m3colors.onPrimaryContainer
83+
horizontalAlignment: Text.AlignHCenter
84+
}
85+
86+
Text {
87+
Layout.fillWidth: true
88+
text: Services.DateTime.dayNames[Services.DateTime.dayOfWeek] + ", " +
89+
Services.DateTime.monthNames[Services.DateTime.month - 1] + " " +
90+
Services.DateTime.day + ", " + Services.DateTime.year
91+
font.family: Common.Appearance.fonts.main
92+
font.pixelSize: Common.Appearance.fontSize.normal
93+
color: Common.Appearance.m3colors.onPrimaryContainer
94+
horizontalAlignment: Text.AlignHCenter
95+
opacity: 0.8
96+
}
97+
}
98+
}
99+
63100
// Calendar card
64101
Rectangle {
65102
Layout.fillWidth: true

dot_files/quickshell/services/DateTime.qml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Singleton {
1111
property string timeString: "00:00"
1212
property string dateString: ""
1313
property string fullDateTime: ""
14+
property string fullDateTimeString: "" // Human-readable format for tooltips
1415

1516
property int hour: 0
1617
property int minute: 0
@@ -48,6 +49,9 @@ Singleton {
4849

4950
// Full date time
5051
fullDateTime = dateString + " " + timeString
52+
53+
// Human-readable full date time for tooltips: "Wednesday, January 1, 2026 12:45 PM"
54+
fullDateTimeString = dayNames[dayOfWeek] + ", " + monthNames[month - 1] + " " + day + ", " + year + " " + timeString
5155
}
5256

5357
function pad(num: int): string {

0 commit comments

Comments
 (0)