applets/digital-clock: add accessible properties to toolbuttons

wilder-5.26
Fushan Wen 4 years ago
parent 0971579241
commit 4c48e40681
No known key found for this signature in database
GPG Key ID: 2E48D1487C91DCAA
  1. 45
      applets/digital-clock/package/contents/ui/CalendarView.qml

@ -106,6 +106,9 @@ PlasmaExtras.Representation {
text: i18nc("@action:button Add event", "Add…") text: i18nc("@action:button Add event", "Add…")
Layout.rightMargin: calendar.paddings Layout.rightMargin: calendar.paddings
icon.name: "list-add" icon.name: "list-add"
Accessible.description: i18nc("@info:tooltip", "Add a new event")
onClicked: ApplicationIntegration.launchCalendar() onClicked: ApplicationIntegration.launchCalendar()
KeyNavigation.tab: calendar.showAgenda ? holidaysList : clocksList KeyNavigation.tab: calendar.showAgenda ? holidaysList : clocksList
} }
@ -150,10 +153,14 @@ PlasmaExtras.Representation {
Layout.column: 4 Layout.column: 4
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
visible: Plasmoid.action("configure").enabled visible: Plasmoid.action("configure").enabled
display: PlasmaComponents3.AbstractButton.IconOnly
icon.name: "configure" icon.name: "configure"
text: Plasmoid.action("configure").text
onClicked: Plasmoid.action("configure").trigger() onClicked: Plasmoid.action("configure").trigger()
PlasmaComponents3.ToolTip { PlasmaComponents3.ToolTip {
text: Plasmoid.action("configure").text text: parent.text
} }
} }
@ -163,10 +170,15 @@ PlasmaExtras.Representation {
Layout.column: 5 Layout.column: 5
checkable: true checkable: true
checked: Plasmoid.configuration.pin checked: Plasmoid.configuration.pin
onToggled: Plasmoid.configuration.pin = checked
display: PlasmaComponents3.AbstractButton.IconOnly
icon.name: "window-pin" icon.name: "window-pin"
PlasmaComponents3.ToolTip {
text: i18n("Keep Open") text: i18n("Keep Open")
onToggled: Plasmoid.configuration.pin = checked
PlasmaComponents3.ToolTip {
text: parent.text
} }
} }
@ -206,9 +218,8 @@ PlasmaExtras.Representation {
Layout.leftMargin: PlasmaCore.Units.smallSpacing Layout.leftMargin: PlasmaCore.Units.smallSpacing
Layout.bottomMargin: PlasmaCore.Units.smallSpacing Layout.bottomMargin: PlasmaCore.Units.smallSpacing
icon.name: Qt.application.layoutDirection === Qt.RightToLeft ? "go-next" : "go-previous" icon.name: Qt.application.layoutDirection === Qt.RightToLeft ? "go-next" : "go-previous"
onClicked: monthView.previousView()
Accessible.name: tooltip display: PlasmaComponents3.AbstractButton.IconOnly
PlasmaComponents3.ToolTip {
text: { text: {
switch(monthView.calendarViewDisplayed) { switch(monthView.calendarViewDisplayed) {
case PlasmaCalendar.MonthView.CalendarView.DayView: case PlasmaCalendar.MonthView.CalendarView.DayView:
@ -221,6 +232,11 @@ PlasmaExtras.Representation {
return ""; return "";
} }
} }
onClicked: monthView.previousView()
PlasmaComponents3.ToolTip {
text: parent.text
} }
} }
@ -240,11 +256,8 @@ PlasmaExtras.Representation {
Layout.row: 1 Layout.row: 1
Layout.column: 5 Layout.column: 5
display: PlasmaComponents3.AbstractButton.IconOnly
icon.name: Qt.application.layoutDirection === Qt.RightToLeft ? "go-previous" : "go-next" icon.name: Qt.application.layoutDirection === Qt.RightToLeft ? "go-previous" : "go-next"
onClicked: monthView.nextView()
Accessible.name: tooltip
KeyNavigation.tab: monthViewWrapper
PlasmaComponents3.ToolTip {
text: { text: {
switch(monthView.calendarViewDisplayed) { switch(monthView.calendarViewDisplayed) {
case PlasmaCalendar.MonthView.CalendarView.DayView: case PlasmaCalendar.MonthView.CalendarView.DayView:
@ -257,6 +270,13 @@ PlasmaExtras.Representation {
return ""; return "";
} }
} }
KeyNavigation.tab: monthViewWrapper
onClicked: monthView.nextView()
PlasmaComponents3.ToolTip {
text: parent.text
} }
} }
} }
@ -549,10 +569,13 @@ PlasmaExtras.Representation {
text: i18n("Switch…") text: i18n("Switch…")
Accessible.name: i18n("Switch to another timezone") Accessible.name: i18n("Switch to another timezone")
icon.name: "preferences-system-time" icon.name: "preferences-system-time"
Accessible.description: i18n("Switch to another timezone")
onClicked: KCMShell.openSystemSettings("kcm_clock") onClicked: KCMShell.openSystemSettings("kcm_clock")
PlasmaComponents3.ToolTip { PlasmaComponents3.ToolTip {
text: i18n("Switch to another timezone") text: parent.Accessible.description
} }
} }
} }

Loading…
Cancel
Save