Skip to content

Commit

Permalink
Improve accessible-label values for the todo mvc example
Browse files Browse the repository at this point in the history
Use more elaborate label text.
  • Loading branch information
tronical committed Jul 10, 2024
1 parent 1acf2fb commit 03f1e58
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
9 changes: 4 additions & 5 deletions examples/todo-mvc/ui/views/create_task_view.slint
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 34,7 @@ export component CreateTaskView {
HorizontalLayout {
IconButton {
icon: Icons.close;
accessible-label: @tr("close");
accessible-label: @tr("Cancel New Task Creation");

clicked => {
root.reset();
Expand All @@ -43,7 43,7 @@ export component CreateTaskView {
}

// spacer
Rectangle {}
Rectangle { }

Button {
text: @tr("Create");
Expand Down Expand Up @@ -94,7 94,6 @@ export component CreateTaskView {
}
}


TextButton {
text: CreateTaskAdapter.time-string(CreateTaskAdapter.due-time);
horizontal-stretch: 0;
Expand All @@ -105,10 104,10 @@ export component CreateTaskView {
}
}

Rectangle {}
Rectangle { }
}

date-picker := DatePickerPopup {
date-picker := DatePickerPopup {
x: (root.width - 360px) / 2;
y: (root.height - 524px) / 2;
width: 360px;
Expand Down
4 changes: 2 additions & 2 deletions examples/todo-mvc/ui/views/task_list_view.slint
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 46,7 @@ export component TaskListView {
SelectionListView {
width: 100%;
model: TaskListAdapter.tasks;
accessible-label: @tr("task listview");
accessible-label: @tr("List of Tasks");

toggle(index) => {
TaskListAdapter.toggle-task-checked(index);
Expand All @@ -62,7 62,7 @@ export component TaskListView {

ActionButton {
icon: Icons.add;
accessible-label: @tr("add");
accessible-label: @tr("Create New Task");

clicked => {
TaskListAdapter.show-create-task();
Expand Down
16 changes: 6 additions & 10 deletions examples/todo-mvc/ui/widgets/selection_list_view.slint
Original file line number Diff line number Diff line change
Expand Up @@ -48,37 48,34 @@ export component SelectionListViewItemDelegate {
check-box := CheckBox {
horizontal-stretch: 0;
y: (parent.height - self.height) / 2;
accessible-label: @tr("selected");

accessible-label: @tr("Task Done");
toggled => {
root.toggle();
}
}

VerticalLayout {
alignment: center;

text-label := Text {
horizontal-alignment: left;
color: TodoPalette.foreground;
font-size: FontSettings.body-strong.font-size;
font-weight: FontSettings.body-strong.font-weight;
overflow: elide;
}

description-label := Text {
color: TodoPalette.foreground;
font-size: FontSettings.body.font-size;
font-weight: FontSettings.body.font-weight;
overflow: elide;
}
}
}

IconButton {
y: (parent.height - self.height) / 2;
icon: Icons.remove;
accessible-label: @tr("remove");

accessible-label: @tr("Delete Task");
clicked => {
root.remove();
}
Expand All @@ -94,12 91,11 @@ export component SelectionListView inherits ListView {

accessible-role: list;

for item[index] in root.model : SelectionListViewItemDelegate {
for item[index] in root.model: SelectionListViewItemDelegate {
width: root.visible-width;
text: item.text;
description: item.description;
checked: item.checked;

toggle => {
root.toggle(index);
}
Expand Down

0 comments on commit 03f1e58

Please sign in to comment.