|
|
|
|
@ -6,7 +6,7 @@ |
|
|
|
|
SPDX-License-Identifier: LGPL-2.0-or-later |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
import QtQuick 2.0 |
|
|
|
|
import QtQuick 2.15 |
|
|
|
|
import QtQuick.Layouts 1.1 |
|
|
|
|
|
|
|
|
|
import org.kde.plasma.plasmoid 2.0 |
|
|
|
|
@ -21,6 +21,9 @@ Item { |
|
|
|
|
width: PlasmaCore.Units.gridUnit * 15 |
|
|
|
|
height: PlasmaCore.Units.gridUnit * 15 |
|
|
|
|
|
|
|
|
|
readonly property string currentTime: Qt.formatTime(dataSource.data["Local"]["DateTime"], Qt.locale().timeFormat(Locale.LongFormat)) |
|
|
|
|
readonly property string currentDate: Qt.formatDate(dataSource.data["Local"]["DateTime"], Qt.locale().dateFormat(Locale.LongFormat).replace(/(^dddd.?\s)|(,?\sdddd$)/, "")) |
|
|
|
|
|
|
|
|
|
property int hours |
|
|
|
|
property int minutes |
|
|
|
|
property int seconds |
|
|
|
|
@ -32,8 +35,8 @@ Item { |
|
|
|
|
Plasmoid.preferredRepresentation: Plasmoid.compactRepresentation |
|
|
|
|
|
|
|
|
|
Plasmoid.toolTipMainText: Qt.formatDate(dataSource.data["Local"]["DateTime"],"dddd") |
|
|
|
|
Plasmoid.toolTipSubText: Qt.formatTime(dataSource.data["Local"]["DateTime"], Qt.locale().timeFormat(Locale.LongFormat)) + "\n" + |
|
|
|
|
Qt.formatDate(dataSource.data["Local"]["DateTime"], Qt.locale().dateFormat(Locale.LongFormat).replace(/(^dddd.?\s)|(,?\sdddd$)/, "")) |
|
|
|
|
Plasmoid.toolTipSubText: `${currentTime}\n${currentDate}` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function dateTimeChanged() { |
|
|
|
|
var currentTZOffset = dataSource.data["Local"]["Offset"] / 60; |
|
|
|
|
@ -67,6 +70,12 @@ Item { |
|
|
|
|
|
|
|
|
|
property bool wasExpanded |
|
|
|
|
|
|
|
|
|
activeFocusOnTab: true |
|
|
|
|
|
|
|
|
|
Accessible.name: Plasmoid.title |
|
|
|
|
Accessible.description: i18nc("@info:tooltip", "Current time is %1; Current date is %2", analogclock.currentTime, analogclock.currentDate) |
|
|
|
|
Accessible.role: Accessible.Button |
|
|
|
|
|
|
|
|
|
onPressed: wasExpanded = Plasmoid.expanded |
|
|
|
|
onClicked: Plasmoid.expanded = !wasExpanded |
|
|
|
|
|
|
|
|
|
|