Verified Commit 28451bc8 authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

applets/digital-clock: add accessible properties to compact representation

Read it first and then we can consider reading it correctly.
parent d69d6325
Pipeline #209263 passed with stage
in 11 minutes and 17 seconds
......@@ -24,6 +24,19 @@ Item {
PlasmaCore.ColorScope.colorGroup: PlasmaCore.Theme.NormalColorGroup
PlasmaCore.ColorScope.inherit: false
/**
* These accessible properties are used in the compact representation,
* not here.
*/
Accessible.name: i18nc("@info:tooltip %1 is a localized long date", "Today is %1", tooltipSubtext.text)
Accessible.description: {
let description = [];
for (let i = 0; i < timezoneRepeater.count; i += 2) {
description.push(`${timezoneRepeater.itemAt(i).text}: ${timezoneRepeater.itemAt(i + 1).text}`);
}
return description.join('; ');
}
ColumnLayout {
id: mainLayout
anchors {
......@@ -62,6 +75,8 @@ Item {
rowSpacing: 0
Repeater {
id: timezoneRepeater
model: {
// The timezones need to be duplicated in the array
// because we need their data twice - once for the name
......
......@@ -4,7 +4,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
import QtQuick 2.0
import QtQuick 2.15
import QtQuick.Layouts 1.1
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
......@@ -69,7 +69,14 @@ Item {
}
Plasmoid.preferredRepresentation: Plasmoid.compactRepresentation
Plasmoid.compactRepresentation: DigitalClock { }
Plasmoid.compactRepresentation: DigitalClock {
activeFocusOnTab: true
hoverEnabled: true
Accessible.name: tooltipLoader.item.Accessible.name
Accessible.description: tooltipLoader.item.Accessible.description
Accessible.role: Accessible.Button
}
Plasmoid.fullRepresentation: CalendarView { }
Plasmoid.toolTipItem: Loader {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment