feat: show exact local reset time alongside countdown and clarify rolling window

This commit is contained in:
Matteo Benedetto
2026-08-21 16:52:13 +02:00
parent b4fe554994
commit 327a8b9d58
2 changed files with 15 additions and 5 deletions
+12 -2
View File
@@ -16,6 +16,16 @@ Rectangle {
property int clockTick: 0 property int clockTick: 0
property color accentColor: "#818cf8" property color accentColor: "#818cf8"
function formatResetMoment() {
if (!resetAt || resetAt <= 0) return "—"
const d = new Date(resetAt * 1000)
const now = new Date()
if (d.toDateString() === now.toDateString()) {
return d.toLocaleTimeString(Qt.locale(), "HH:mm")
}
return d.toLocaleDateString(Qt.locale(), "dd/MM") + " " + d.toLocaleTimeString(Qt.locale(), "HH:mm")
}
function countdown() { function countdown() {
const tick = root.clockTick const tick = root.clockTick
if (!resetAt || resetAt <= 0) return "—" if (!resetAt || resetAt <= 0) return "—"
@@ -103,7 +113,7 @@ Rectangle {
} }
} }
// Riga 3: Dettaglio usato + Reset countdown // Riga 3: Dettaglio usato + Orario esatto + Countdown
RowLayout { RowLayout {
Layout.fillWidth: true Layout.fillWidth: true
spacing: 4 spacing: 4
@@ -117,7 +127,7 @@ Rectangle {
Item { Layout.fillWidth: true } Item { Layout.fillWidth: true }
PC3.Label { PC3.Label {
text: i18n("⏱ %1", root.countdown()) text: i18n("reset %1 (%2)", root.formatResetMoment(), root.countdown())
color: root.accentColor color: root.accentColor
font.pointSize: Kirigami.Theme.defaultFont.pointSize - 3 font.pointSize: Kirigami.Theme.defaultFont.pointSize - 3
} }
+3 -3
View File
@@ -31,7 +31,7 @@ PlasmoidItem {
Plasmoid.backgroundHints: PlasmaCore.Types.DefaultBackground Plasmoid.backgroundHints: PlasmaCore.Types.DefaultBackground
toolTipMainText: i18n("Antigravity — quote modelli") toolTipMainText: i18n("Antigravity — quote modelli")
toolTipSubText: root.data && root.data.gemini toolTipSubText: root.data && root.data.gemini
? i18n("Gemini: %1% · Claude: %2%", ? i18n("Gemini: %1% · Claude: %2% · Finestra mobile (rolling)",
Math.round((root.data.gemini.remaining || 0) * 100), Math.round((root.data.gemini.remaining || 0) * 100),
Math.round((root.data.claude ? root.data.claude.remaining || 0 : 0) * 100)) Math.round((root.data.claude ? root.data.claude.remaining || 0 : 0) * 100))
: (root.errorMsg || "") : (root.errorMsg || "")
@@ -154,7 +154,7 @@ PlasmoidItem {
font.pointSize: Kirigami.Theme.defaultFont.pointSize + 1 font.pointSize: Kirigami.Theme.defaultFont.pointSize + 1
} }
PC3.Label { PC3.Label {
text: root.data && root.data.project ? "CLOUDCODE-PA" : "GOOGLE AI" text: "CLOUDCODE-PA"
color: root.themeViolet color: root.themeViolet
font.bold: true font.bold: true
font.pointSize: Kirigami.Theme.defaultFont.pointSize - 3 font.pointSize: Kirigami.Theme.defaultFont.pointSize - 3
@@ -242,7 +242,7 @@ PlasmoidItem {
} }
Item { Layout.fillWidth: true } Item { Layout.fillWidth: true }
PC3.Label { PC3.Label {
text: "DAILY" text: "ROLLING"
color: root.themeViolet color: root.themeViolet
font.bold: true font.bold: true
font.pointSize: Kirigami.Theme.defaultFont.pointSize - 3 font.pointSize: Kirigami.Theme.defaultFont.pointSize - 3