Verified Commit 4c48e406 authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

applets/digital-clock: add accessible properties to toolbuttons

parent 09715792
Pipeline #209340 passed with stage
in 8 minutes and 51 seconds
......@@ -106,6 +106,9 @@ PlasmaExtras.Representation {
text: i18nc("@action:button Add event", "Add…")
Layout.rightMargin: calendar.paddings
icon.name: "list-add"
Accessible.description: i18nc("@info:tooltip", "Add a new event")
onClicked: ApplicationIntegration.launchCalendar()
KeyNavigation.tab: calendar.showAgenda ? holidaysList : clocksList
}
......@@ -150,10 +153,14 @@ PlasmaExtras.Representation {
Layout.column: 4
Layout.alignment: Qt.AlignRight
visible: Plasmoid.action("configure").enabled
display: PlasmaComponents3.AbstractButton.IconOnly
icon.name: "configure"
text: Plasmoid.action("configure").text
onClicked: Plasmoid.action("configure").trigger()
PlasmaComponents3.ToolTip {
text: Plasmoid.action("configure").text
text: parent.text
}
}
......@@ -163,10 +170,15 @@ PlasmaExtras.Representation {
Layout.column: 5
checkable: true
checked: Plasmoid.configuration.pin
onToggled: Plasmoid.configuration.pin = checked
display: PlasmaComponents3.AbstractButton.IconOnly
icon.name: "window-pin"
text: i18n("Keep Open")
onToggled: Plasmoid.configuration.pin = checked
PlasmaComponents3.ToolTip {
text: i18n("Keep Open")
text: parent.text
}
}
......@@ -206,21 +218,25 @@ PlasmaExtras.Representation {
Layout.leftMargin: PlasmaCore.Units.smallSpacing
Layout.bottomMargin: PlasmaCore.Units.smallSpacing
icon.name: Qt.application.layoutDirection === Qt.RightToLeft ? "go-next" : "go-previous"
display: PlasmaComponents3.AbstractButton.IconOnly
text: {
switch(monthView.calendarViewDisplayed) {
case PlasmaCalendar.MonthView.CalendarView.DayView:
return i18n("Previous month")
case PlasmaCalendar.MonthView.CalendarView.MonthView:
return i18n("Previous year")
case PlasmaCalendar.MonthView.CalendarView.YearView:
return i18n("Previous decade")
default:
return "";
}
}
onClicked: monthView.previousView()
Accessible.name: tooltip
PlasmaComponents3.ToolTip {
text: {
switch(monthView.calendarViewDisplayed) {
case PlasmaCalendar.MonthView.CalendarView.DayView:
return i18n("Previous month")
case PlasmaCalendar.MonthView.CalendarView.MonthView:
return i18n("Previous year")
case PlasmaCalendar.MonthView.CalendarView.YearView:
return i18n("Previous decade")
default:
return "";
}
}
text: parent.text
}
}
......@@ -240,23 +256,27 @@ PlasmaExtras.Representation {
Layout.row: 1
Layout.column: 5
display: PlasmaComponents3.AbstractButton.IconOnly
icon.name: Qt.application.layoutDirection === Qt.RightToLeft ? "go-previous" : "go-next"
onClicked: monthView.nextView()
Accessible.name: tooltip
text: {
switch(monthView.calendarViewDisplayed) {
case PlasmaCalendar.MonthView.CalendarView.DayView:
return i18n("Next month")
case PlasmaCalendar.MonthView.CalendarView.MonthView:
return i18n("Next year")
case PlasmaCalendar.MonthView.CalendarView.YearView:
return i18n("Next decade")
default:
return "";
}
}
KeyNavigation.tab: monthViewWrapper
onClicked: monthView.nextView()
PlasmaComponents3.ToolTip {
text: {
switch(monthView.calendarViewDisplayed) {
case PlasmaCalendar.MonthView.CalendarView.DayView:
return i18n("Next month")
case PlasmaCalendar.MonthView.CalendarView.MonthView:
return i18n("Next year")
case PlasmaCalendar.MonthView.CalendarView.YearView:
return i18n("Next decade")
default:
return "";
}
}
text: parent.text
}
}
}
......@@ -549,10 +569,13 @@ PlasmaExtras.Representation {
text: i18n("Switch…")
Accessible.name: i18n("Switch to another timezone")
icon.name: "preferences-system-time"
Accessible.description: i18n("Switch to another timezone")
onClicked: KCMShell.openSystemSettings("kcm_clock")
PlasmaComponents3.ToolTip {
text: i18n("Switch to another timezone")
text: parent.Accessible.description
}
}
}
......
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