diff --git a/MacShell/CardWidget.qml b/MacShell/CardWidget.qml index ece08ef..d6afe95 100644 --- a/MacShell/CardWidget.qml +++ b/MacShell/CardWidget.qml @@ -238,5 +238,7 @@ Item { scale: w.s; transformOrigin: Item.TopLeft z: 3 sourceComponent: w.content + Binding { target: body.item; property: "width"; value: body.width; when: body.item !== null } + Binding { target: body.item; property: "height"; value: body.height; when: body.item !== null } } } diff --git a/MacShell/Desktop.qml b/MacShell/Desktop.qml index 56ae74d..db8b7e9 100644 --- a/MacShell/Desktop.qml +++ b/MacShell/Desktop.qml @@ -553,7 +553,7 @@ Scope { WlrLayershell.keyboardFocus: ((renameSheet.open || linkSheet.open || emojiSheet.open) && !root.picking) ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None // The whole screen takes the pointer (empty desktop: selection rectangle, right-click menu) EXCEPT - // * a Player widget's buttons, which live in the widgets window and still have to be clickable, and + // * interactive widgets' buttons (Player, Reminders), which live in the widgets window and still have to be clickable, and // * everything, while the widgets are being edited (the widgets window needs the pointer then). mask: Region { item: root.widgetsEditing ? null : iconLayer @@ -561,7 +561,11 @@ Scope { Region { item: pr0; intersection: Intersection.Subtract }, Region { item: pr1; intersection: Intersection.Subtract }, Region { item: pr2; intersection: Intersection.Subtract }, - Region { item: pr3; intersection: Intersection.Subtract } + Region { item: pr3; intersection: Intersection.Subtract }, + Region { item: pr4; intersection: Intersection.Subtract }, + Region { item: pr5; intersection: Intersection.Subtract }, + Region { item: pr6; intersection: Intersection.Subtract }, + Region { item: pr7; intersection: Intersection.Subtract } ] } @@ -692,11 +696,15 @@ Scope { id: iconLayer anchors.fill: parent - // hit areas of the Player widgets' buttons, cut out of the mask above + // hit areas of the interactive widgets' buttons, cut out of the mask above Item { id: pr0; x: root.playerRect(w.modelData.name, 0, 0); y: root.playerRect(w.modelData.name, 0, 1); width: root.playerRect(w.modelData.name, 0, 2); height: root.playerRect(w.modelData.name, 0, 3) } Item { id: pr1; x: root.playerRect(w.modelData.name, 1, 0); y: root.playerRect(w.modelData.name, 1, 1); width: root.playerRect(w.modelData.name, 1, 2); height: root.playerRect(w.modelData.name, 1, 3) } Item { id: pr2; x: root.playerRect(w.modelData.name, 2, 0); y: root.playerRect(w.modelData.name, 2, 1); width: root.playerRect(w.modelData.name, 2, 2); height: root.playerRect(w.modelData.name, 2, 3) } Item { id: pr3; x: root.playerRect(w.modelData.name, 3, 0); y: root.playerRect(w.modelData.name, 3, 1); width: root.playerRect(w.modelData.name, 3, 2); height: root.playerRect(w.modelData.name, 3, 3) } + Item { id: pr4; x: root.playerRect(w.modelData.name, 4, 0); y: root.playerRect(w.modelData.name, 4, 1); width: root.playerRect(w.modelData.name, 4, 2); height: root.playerRect(w.modelData.name, 4, 3) } + Item { id: pr5; x: root.playerRect(w.modelData.name, 5, 0); y: root.playerRect(w.modelData.name, 5, 1); width: root.playerRect(w.modelData.name, 5, 2); height: root.playerRect(w.modelData.name, 5, 3) } + Item { id: pr6; x: root.playerRect(w.modelData.name, 6, 0); y: root.playerRect(w.modelData.name, 6, 1); width: root.playerRect(w.modelData.name, 6, 2); height: root.playerRect(w.modelData.name, 6, 3) } + Item { id: pr7; x: root.playerRect(w.modelData.name, 7, 0); y: root.playerRect(w.modelData.name, 7, 1); width: root.playerRect(w.modelData.name, 7, 2); height: root.playerRect(w.modelData.name, 7, 3) } // A local monitor-sized wallpaper copy is the source for the right-click menu's glass. // It is never visible on screen: opacity 0 (a ShaderEffectSource ignores its source's own opacity, the same idiom the diff --git a/MacShell/ExtraWidgets.qml b/MacShell/ExtraWidgets.qml index f62d982..67905b0 100644 --- a/MacShell/ExtraWidgets.qml +++ b/MacShell/ExtraWidgets.qml @@ -5,6 +5,7 @@ import QtQuick import QtQuick.Effects import Quickshell +import Quickshell.Hyprland import Quickshell.Io import Quickshell.Services.UPower import "I18n.js" as I18n @@ -20,6 +21,22 @@ Item { readonly property bool editing: host ? host.editing : false readonly property color accent: hub && hub.dock ? hub.dock.accent : "#0A84FF" readonly property string cfgDir: host ? host.configDir : Quickshell.env("HOME") + "/.config/macwidgets" + Process { command: ["mkdir", "-p", root.cfgDir]; running: true } + property bool typing: false + signal cancelTypingRequested() + function cancelTyping() { + typing = false; + cancelTypingRequested(); + } + Connections { + target: Hyprland + function onRawEvent(event) { + var n = event.name; + if (n === "workspacev2" || n === "activewindowv2" || n === "activespecialv2") { + if (root.typing) root.cancelTyping(); + } + } + } readonly property bool asleep: false property var stockSymbols: ["AAPL", "NVDA", "^GSPC", "BTC-USD"] // data is only fetched for widgets that are on the desktop @@ -50,7 +67,7 @@ Item { FileView { id: notesFile; path: root.cfgDir + "/notes.md"; watchChanges: true; printErrors: false; onFileChanged: reload() onLoadFailed: setText("# Notes\n\nWrite anything here — it shows up on the desktop.\nOpen this file from the Notes widget.\n") } FileView { id: remFile; path: root.cfgDir + "/reminders.md"; watchChanges: true; printErrors: false; onFileChanged: reload() - onLoadFailed: setText("- [ ] Try the new widgets\n- [x] Install MacShell\n- [ ] Click a circle to tick it off\n") } + onLoadFailed: { setText("- [ ] Try the new widgets\n- [x] Install MacShell\n- [ ] Click a circle to tick it off\n"); reload(); } } readonly property string notesText: notesFile.loaded ? notesFile.text() : "" readonly property var reminders: { var t = remFile.loaded ? remFile.text() : "", out = [], l = t.split("\n"); @@ -85,10 +102,13 @@ Item { onRemindersChanged: syncReminders() Component.onCompleted: syncReminders() function toggleReminder(lineNo) { + if (!remFile.loaded) return; var l = remFile.text().split("\n"); if (lineNo < 0 || lineNo >= l.length) return; l[lineNo] = /\[ \]/.test(l[lineNo]) ? l[lineNo].replace("[ ]", "[x]") : l[lineNo].replace(/\[(x|X)\]/, "[ ]"); remFile.setText(l.join("\n")); + remFile.reload(); + root.syncReminders(); if (bar) bar.playSound("tink", 0.6); } function openFile(p) { Quickshell.execDetached(["xdg-open", p]); } @@ -99,21 +119,29 @@ Item { var cur = remFile.loaded ? remFile.text() : ""; if (cur !== "" && cur.charAt(cur.length - 1) !== "\n") cur += "\n"; remFile.setText(cur + "- [ ] " + t + "\n"); + remFile.reload(); + root.syncReminders(); if (bar) bar.playSound("pop", 0.5); } function setReminderText(lineNo, text) { + if (!remFile.loaded) return; var l = remFile.text().split("\n"); if (lineNo < 0 || lineNo >= l.length) return; var t = String(text || "").trim(); if (t === "") { deleteReminder(lineNo); return; } l[lineNo] = l[lineNo].replace(/^(\s*[-*]\s*\[( |x|X)\]\s*).*$/, "$1" + t.replace(/\$/g, "$$$$")); remFile.setText(l.join("\n")); + remFile.reload(); + root.syncReminders(); } function deleteReminder(lineNo) { + if (!remFile.loaded) return; var l = remFile.text().split("\n"); if (lineNo < 0 || lineNo >= l.length) return; l.splice(lineNo, 1); remFile.setText(l.join("\n")); + remFile.reload(); + root.syncReminders(); if (bar) bar.playSound("tink", 0.4); } @@ -337,50 +365,75 @@ Item { Component { id: cReminders Item { + id: remRoot + anchors.fill: parent readonly property var ctx: parent ? parent.ctx : null readonly property var open: root.reminders.filter(function (r) { return !r.done; }) readonly property color blue: ctx && ctx.mono ? ctx.fg : "#0A84FF" Item { id: rHead width: parent.width - height: cnt.height + height: 24 Text { anchors.left: parent.left; anchors.verticalCenter: parent.verticalCenter - width: parent.width - cnt.width - addBtn.width - 14; elide: Text.ElideRight - text: I18n.tr("Reminders"); color: blue; font.family: Fonts.forWeight(Font.Bold, root.fam); font.pixelSize: 14; font.weight: Font.Bold + width: parent.width - addBtn.width - 14; elide: Text.ElideRight + text: I18n.tr("Reminders"); color: "white"; font.family: Fonts.forWeight(Font.Bold, root.fam); font.pixelSize: 14; font.weight: Font.Bold } - MorphText { - id: cnt - anchors.right: parent.right; anchors.verticalCenter: parent.verticalCenter - text: parent.parent.open.length; duration: 420; animateWidth: false - color: blue; font.family: Fonts.forWeight(Font.Bold, root.fam); font.pixelSize: 22; font.weight: Font.Bold - } - // + — add one without leaving the widget. It lives beside the count, never on top of it, - // and fades in on hover the way macOS reveals its controls. + // + — add one without leaving the widget. Rectangle { id: addBtn - anchors.right: cnt.left; anchors.rightMargin: 8 + z: 2 + anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter width: 20; height: 20; radius: 10 visible: opacity > 0.01 - opacity: root.editing ? 0 : ((headHover.hovered || adding) ? 1 : 0) + opacity: root.editing ? 0 : ((headHover.hovered || adding || addMa.containsMouse) ? 1 : 0.6) Behavior on opacity { NumberAnimation { duration: 220; easing.type: Easing.OutCubic } } - color: addMa.containsMouse ? Qt.rgba(blue.r, blue.g, blue.b, 0.22) : "transparent" + color: addMa.containsMouse ? Qt.rgba(1, 1, 1, 0.22) : "transparent" rotation: adding ? 45 : 0 Behavior on rotation { NumberAnimation { duration: 320; easing.type: Easing.OutBack; easing.overshoot: 2 } } scale: addMa.pressed ? 0.88 : 1 Behavior on scale { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } } - Rectangle { anchors.centerIn: parent; width: 11; height: 1.7; radius: 1; color: blue } - Rectangle { anchors.centerIn: parent; width: 1.7; height: 11; radius: 1; color: blue } + Rectangle { anchors.centerIn: parent; width: 11; height: 1.7; radius: 1; color: "white" } + Rectangle { anchors.centerIn: parent; width: 1.7; height: 11; radius: 1; color: "white" } MouseArea { id: addMa; anchors.fill: parent; anchors.margins: -4; hoverEnabled: true; cursorShape: Qt.PointingHandCursor - onClicked: { adding = !adding; if (adding) newInput.forceActiveFocus(); } + onClicked: { adding = !adding; } } } HoverHandler { id: headHover } } property bool adding: false property int editingLine: -1 + function updateTyping() { + root.typing = adding || editingLine >= 0; + } + onAddingChanged: { + updateTyping(); + if (adding) { + editingLine = -1; + focusTimer.restart(); + } + } + onEditingLineChanged: { + updateTyping(); + if (editingLine >= 0) adding = false; + } + Connections { + target: root + function onCancelTypingRequested() { + adding = false; + editingLine = -1; + } + } + Component.onDestruction: { + if (adding || editingLine >= 0) root.typing = false; + } + Timer { + id: focusTimer + interval: 50 + onTriggered: newInput.forceActiveFocus() + } Flickable { id: remFlick y: rHead.height + 6 @@ -414,26 +467,35 @@ Item { x: 24; width: parent.width - 24 anchors.verticalCenter: parent.verticalCenter color: ctx ? ctx.fg : "white"; font.family: root.fam; font.pixelSize: 13 - selectByMouse: false - onAccepted: { root.addReminder(text); text = ""; } + selectByMouse: true + onAccepted: { + if (text.trim() === "") { + adding = false; + } else { + root.addReminder(text); + text = ""; + } + } Keys.onEscapePressed: { text = ""; adding = false; } Text { visible: parent.text === ""; text: I18n.tr("New Reminder"); color: ctx ? ctx.fg2 : "grey"; font: parent.font } } } Repeater { model: remModel - delegate: Row { + delegate: Item { id: remRow - required property var model - readonly property var modelData: remRow.model + required property int line + required property bool done + required property string text + required property bool fresh required property int index - spacing: 8 width: parent.width + height: Math.max(22, rowTxt.implicitHeight) // the first list staggers in; a row added later springs in on its own, and nothing else moves property real inT: 0 opacity: inT transform: Translate { y: (1 - remRow.inT) * 8 } - Component.onCompleted: remRow.model.fresh ? rowSolo.start() : rowIn.start() + Component.onCompleted: remRow.fresh ? rowSolo.start() : rowIn.start() SequentialAnimation { id: rowIn PauseAnimation { duration: Math.min(300, remRow.index * 45) } @@ -442,9 +504,10 @@ Item { NumberAnimation { id: rowSolo; target: remRow; property: "inT"; from: 0; to: 1; duration: 320; easing.type: Easing.OutBack; easing.overshoot: 1.4 } Rectangle { id: tick + x: 0 width: 16; height: 16; radius: 8 anchors.verticalCenter: parent.verticalCenter - readonly property bool done: modelData.done + readonly property bool done: remRow.done property real fill: done ? 1 : 0 Behavior on fill { NumberAnimation { duration: 420; easing.type: Easing.OutBack; easing.overshoot: 2.4 } } color: Qt.rgba(blue.r, blue.g, blue.b, fill) @@ -462,21 +525,21 @@ Item { // the tick draws itself in Canvas { id: tickMark - anchors.centerIn: parent - width: 11; height: 11 + anchors.fill: parent property real draw: tick.fill onDrawChanged: requestPaint() + Component.onCompleted: requestPaint() onPaint: { var c = getContext("2d"); c.reset(); if (draw <= 0.01) return; c.strokeStyle = "white"; c.lineWidth = 1.9; c.lineCap = "round"; c.lineJoin = "round"; - var p = [[1.6, 5.6], [4.3, 8.4], [9.4, 2.6]]; + var p = [[4.5, 7.5], [7.0, 10.5], [11.5, 4.5]]; var d = Math.max(0, Math.min(1, (draw - 0.15) / 0.85)); c.beginPath(); c.moveTo(p[0][0], p[0][1]); - var t1 = Math.min(1, d / 0.4); + var t1 = Math.min(1, d / 0.35); c.lineTo(p[0][0] + (p[1][0] - p[0][0]) * t1, p[0][1] + (p[1][1] - p[0][1]) * t1); - if (d > 0.4) { - var t2 = (d - 0.4) / 0.6; + if (d > 0.35) { + var t2 = (d - 0.35) / 0.65; c.lineTo(p[1][0] + (p[2][0] - p[1][0]) * t2, p[1][1] + (p[2][1] - p[1][1]) * t2); } c.stroke(); @@ -485,43 +548,100 @@ Item { MouseArea { anchors.fill: parent; anchors.margins: -4 enabled: !root.editing; cursorShape: Qt.PointingHandCursor - onClicked: { tickPop.restart(); root.toggleReminder(modelData.line); if (root.bar) root.bar.playSound("tink", 0.5); } + onClicked: { tickPop.restart(); root.toggleReminder(remRow.line); if (root.bar) root.bar.playSound("tink", 0.5); } } } Item { - width: parent.width - 24 - height: Math.max(rowTxt.implicitHeight, 18) + id: rowContent + anchors.left: tick.right + anchors.leftMargin: 8 + anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - // Nothing here is a text field, so a click can never leave text selected on the desktop. - // Renaming lives in the Reminders app, which this row opens. - HoverHandler { id: rowHover; enabled: !root.editing } + height: parent.height + readonly property bool isEditing: editingLine === remRow.line + HoverHandler { id: rowHover; enabled: !root.editing && !rowContent.isEditing } Text { id: rowTxt - width: parent.width - (rowHover.hovered ? 20 : 0); elide: Text.ElideRight + visible: !rowContent.isEditing + anchors.left: parent.left + anchors.right: parent.right + anchors.rightMargin: rowHover.hovered ? 20 : 0 + elide: Text.ElideRight anchors.verticalCenter: parent.verticalCenter - text: modelData.text; font.strikeout: modelData.done - color: ctx ? (modelData.done ? ctx.fg2 : ctx.fg) : "white" + text: remRow.text; font.strikeout: remRow.done + color: ctx ? (remRow.done ? ctx.fg2 : ctx.fg) : "white" font.family: root.fam; font.pixelSize: 13 } + TextInput { + id: inlineEditInput + visible: rowContent.isEditing + anchors.left: parent.left + anchors.right: parent.right + anchors.rightMargin: 20 + anchors.verticalCenter: parent.verticalCenter + color: ctx ? ctx.fg : "white" + font.family: root.fam + font.pixelSize: 13 + selectByMouse: true + text: remRow.text + onVisibleChanged: { + if (visible) { + text = remRow.text; + inlineFocusTimer.restart(); + } + } + Timer { + id: inlineFocusTimer + interval: 40 + onTriggered: { + inlineEditInput.forceActiveFocus(); + inlineEditInput.selectAll(); + } + } + onAccepted: { + var val = text.trim(); + if (val === "") { + root.deleteReminder(remRow.line); + } else { + root.setReminderText(remRow.line, val); + } + editingLine = -1; + } + Keys.onEscapePressed: { + editingLine = -1; + } + } MouseArea { id: rowMa - anchors.fill: parent; anchors.rightMargin: 22 - enabled: !root.editing + anchors.fill: parent + anchors.rightMargin: 22 + visible: !rowContent.isEditing + enabled: !root.editing && !rowContent.isEditing cursorShape: Qt.PointingHandCursor onClicked: { - root.openFile(root.cfgDir + "/reminders.md"); + adding = false; + editingLine = remRow.line; } } Text { anchors.right: parent.right; anchors.verticalCenter: parent.verticalCenter - text: "\u00D7"; color: ctx ? ctx.fg2 : "grey"; font.family: root.fam; font.pixelSize: 15 - opacity: rowHover.hovered ? 1 : 0 + text: rowContent.isEditing ? "\u2715" : "\u00D7" + color: "white" + font.family: root.fam + font.pixelSize: 15 + opacity: rowContent.isEditing ? 0.8 : (rowHover.hovered ? 0.9 : 0) Behavior on opacity { NumberAnimation { duration: 140 } } MouseArea { anchors.fill: parent; anchors.margins: -5 - enabled: rowHover.hovered + enabled: rowContent.isEditing || rowHover.hovered cursorShape: Qt.PointingHandCursor - onClicked: root.deleteReminder(modelData.line) + onClicked: { + if (rowContent.isEditing) { + editingLine = -1; + } else { + root.deleteReminder(remRow.line); + } + } } } } @@ -529,10 +649,15 @@ Item { } } } - // the header opens the Reminders app, not a text editor + // the header: double-click to open reminders.md in external editor, single-click does nothing MouseArea { - anchors.fill: rHead; enabled: !root.editing; cursorShape: Qt.PointingHandCursor - onClicked: { + anchors.left: rHead.left + anchors.top: rHead.top + anchors.bottom: rHead.bottom + anchors.right: addBtn.left + enabled: !root.editing + cursorShape: Qt.ArrowCursor + onDoubleClicked: { root.openFile(root.cfgDir + "/reminders.md"); } } diff --git a/MacShell/MacDock.qml b/MacShell/MacDock.qml index 7c9454c..2d8e048 100644 --- a/MacShell/MacDock.qml +++ b/MacShell/MacDock.qml @@ -2900,7 +2900,8 @@ Scope { { type: "calendar", name: I18n.tr("Calendar"), hint: I18n.tr("Today's date and the month"), styles: [["liquid", I18n.tr("Liquid Glass")], ["normal", I18n.tr("Normal")]] }, { type: "clock", name: I18n.tr("Clock"), hint: I18n.tr("Analog clock face"), styles: [["liquid", I18n.tr("Liquid Glass")], ["light", I18n.tr("Light")], ["dark", I18n.tr("Dark")]] }, { type: "player", name: I18n.tr("Player"), hint: I18n.tr("Now Playing with controls and lyrics"), styles: [["liquid", I18n.tr("Liquid Glass")], ["light", I18n.tr("Light")], ["dark", I18n.tr("Dark")]] }, - { type: "image", name: I18n.tr("Image"), hint: I18n.tr("Your own picture (you choose the file)"), styles: [["normal", I18n.tr("Photo")]] } + { type: "image", name: I18n.tr("Image"), hint: I18n.tr("Your own picture (you choose the file)"), styles: [["normal", I18n.tr("Photo")]] }, + { type: "reminders", name: I18n.tr("Reminders"), hint: I18n.tr("To-do list and checklist"), styles: [["liquid", I18n.tr("Liquid Glass")], ["normal", I18n.tr("Normal")]] } ] delegate: Item { id: addRow diff --git a/MacShell/MacWidgets.qml b/MacShell/MacWidgets.qml index d535f3c..428db1b 100644 --- a/MacShell/MacWidgets.qml +++ b/MacShell/MacWidgets.qml @@ -55,8 +55,14 @@ Scope { property bool anyLiquid: false property int rev: 0 // bumped on every change to the list, so Settings bindings can re-evaluate count() + ExtraWidgets { + id: extraWidgets + host: root + } + readonly property alias extra: extraWidgets + readonly property var styleNames: ({ liquid: "Liquid Glass", normal: "Normal", light: "Light", dark: "Dark" }) - readonly property var typeNames: ({ weather: "Weather", calendar: "Calendar", clock: "Clock", player: "Player", image: "Image" }) + readonly property var typeNames: ({ weather: "Weather", calendar: "Calendar", clock: "Clock", player: "Player", image: "Image", reminders: "Reminders" }) readonly property var sizeNames: ({ small: "Small", medium: "Medium", large: "Large" }) function dims(size) { var b = size === "large" ? [375, 385] : (size === "medium" ? [395, 185] : [185, 185]); @@ -326,9 +332,10 @@ Scope { wmodel.clear(); for (var i = 0; i < o.widgets.length; i++) { var w = o.widgets[i]; - if (!w || (w.type !== "weather" && w.type !== "calendar" && w.type !== "clock" && w.type !== "player" && w.type !== "image")) continue; - wmodel.append({ wid: String(w.id || ("w" + i)), wtype: w.type, - wstyle: w.type === "image" ? "normal" : (w.type === "clock" || w.type === "player") + var t = w ? (w.type || w.wtype) : ""; + if (!t || !root.typeNames[t]) continue; + wmodel.append({ wid: String(w.id || ("w" + i)), wtype: t, + wstyle: t === "image" ? "normal" : (t === "clock" || t === "player") ? ((w.style === "light" || w.style === "dark") ? w.style : "liquid") : (w.style === "normal" ? "normal" : "liquid"), wsize: (w.size === "medium" || w.size === "large") ? w.size : "small", @@ -372,12 +379,15 @@ Scope { running: root.player !== null && root.player.isPlaying && root.count("player") > 0 onTriggered: { try { root.player.positionChanged(); } catch (err) { } } } - // screen rectangles of the Player widgets: they stay clickable while the rest of the layer is click-through + function isInteractive(type) { + return type === "player" || type === "reminders" || type === "notes"; + } + // screen rectangles of interactive widgets (Player, Reminders): they stay clickable while the rest of the layer is click-through readonly property var playerRects: { var r = rev, out = []; for (var i = 0; i < wmodel.count; i++) { var m = wmodel.get(i); - if (m.wtype !== "player") continue; + if (!root.isInteractive(m.wtype)) continue; var d = dims(m.wsize); out.push([m.wx, m.wy, d[0], d[1]]); } @@ -712,12 +722,15 @@ Scope { WlrLayershell.namespace: "macwidgets" WlrLayershell.layer: WlrLayer.Bottom - WlrLayershell.keyboardFocus: WlrKeyboardFocus.None + WlrLayershell.keyboardFocus: (root.extra && root.extra.typing) ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None - // click-through unless editing; only the Player widgets (up to 4) take clicks, for their buttons + // click-through unless editing; interactive widgets (Player, Reminders) take clicks for their buttons mask: Region { item: root.editing ? ui : null - regions: [ Region { item: hit0 }, Region { item: hit1 }, Region { item: hit2 }, Region { item: hit3 } ] + regions: [ + Region { item: hit0 }, Region { item: hit1 }, Region { item: hit2 }, Region { item: hit3 }, + Region { item: hit4 }, Region { item: hit5 }, Region { item: hit6 }, Region { item: hit7 } + ] } Item { @@ -728,6 +741,10 @@ Scope { Item { id: hit1; x: root.pr(1, 0); y: root.pr(1, 1); width: root.pr(1, 2); height: root.pr(1, 3) } Item { id: hit2; x: root.pr(2, 0); y: root.pr(2, 1); width: root.pr(2, 2); height: root.pr(2, 3) } Item { id: hit3; x: root.pr(3, 0); y: root.pr(3, 1); width: root.pr(3, 2); height: root.pr(3, 3) } + Item { id: hit4; x: root.pr(4, 0); y: root.pr(4, 1); width: root.pr(4, 2); height: root.pr(4, 3) } + Item { id: hit5; x: root.pr(5, 0); y: root.pr(5, 1); width: root.pr(5, 2); height: root.pr(5, 3) } + Item { id: hit6; x: root.pr(6, 0); y: root.pr(6, 1); width: root.pr(6, 2); height: root.pr(6, 3) } + Item { id: hit7; x: root.pr(7, 0); y: root.pr(7, 1); width: root.pr(7, 2); height: root.pr(7, 3) } Rectangle { // slight dim while editing anchors.fill: parent diff --git a/MacShell/WidgetVisual.qml b/MacShell/WidgetVisual.qml index a1ddfac..bd25f67 100644 --- a/MacShell/WidgetVisual.qml +++ b/MacShell/WidgetVisual.qml @@ -179,12 +179,41 @@ Item { editing: host.editing } } + Component { + id: cardVisual + CardWidget { + scaleF: host.widgetScale + style: wstyle + size: wsize + mode: wmode + fam: host.fontFamily + screenX: v.sx; screenY: v.sy + glassReady: host.glassState === "ready" + shaderUrl: "file://" + host.glassShaderOut + wallUrl: host.fileUrl(host.wallpaperFor(v.sname)) + wallVideo: host.liveWallVideo + wallPaused: host.liveWallPaused + screenW: v.sw + screenH: v.sh + glassOpacity: host.glassOpacity + glassBlur: host.glassBlur + glassLiquid: host.glassLiquid + glassRim: host.glassRim + borderTint: host.borderTint + glassGrain: host.glassGrain + darkGlass: host.darkGlass + editing: host.editing + content: (host && host.extra) ? host.extra.comp(v.wtype) : null + onGlassFailed: host.glassState = "failed" + } + } Loader { id: visual anchors.fill: parent sourceComponent: wtype === "calendar" ? calendarVisual : (wtype === "clock" ? clockVisual : (wtype === "player" ? playerVisual - : (wtype === "image" ? imageVisual : weatherVisual))) + : (wtype === "image" ? imageVisual + : ((host && host.extra && host.extra.comp(wtype)) ? cardVisual : weatherVisual)))) } } diff --git a/MacShell/lang/es.js b/MacShell/lang/es.js index fdb3324..21cb96c 100644 --- a/MacShell/lang/es.js +++ b/MacShell/lang/es.js @@ -589,6 +589,7 @@ var strings = { "Your own picture (you choose the file)": "Tu propia imagen (elige el archivo)", "Current conditions, hourly and daily forecast": "Condiciones actuales y pronóstico por horas y días", "Today's date and the month": "Fecha de hoy y el mes", + "To-do list and checklist": "Lista de tareas y lista de verificación", "Now Playing with controls and lyrics": "Reproduciendo con controles y letra", "Unknown Title": "Título desconocido", "Loading lyrics…": "Cargando letra…", diff --git a/MacShell/lang/ru.js b/MacShell/lang/ru.js index 5a0fe8d..ddf8cd7 100644 --- a/MacShell/lang/ru.js +++ b/MacShell/lang/ru.js @@ -591,6 +591,9 @@ var strings = { "Your own picture (you choose the file)": "Своя картинка (вы выбираете файл)", "Current conditions, hourly and daily forecast": "Сейчас, почасовой и дневной прогноз", "Today's date and the month": "Сегодняшняя дата и месяц", + "To-do list and checklist": "Список задач и чек-лист", + "Reminders": "Напоминания", + "New Reminder": "Новое напоминание", "Now Playing with controls and lyrics": "«Сейчас играет» с управлением и текстом песни", "Unknown Title": "Без названия", "Loading lyrics…": "Загрузка текста…",