Commit ada89a7e authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Add labels to the Search fields

Improve accessibility by adding labels to the Search fields and use a
more descriptive instruction as placeholder text.

GnuPG-bug-id: 6095
parent b569a1b2
......@@ -90,12 +90,26 @@ public:
auto groupsLayout = new QGridLayout;
groupsLayout->setColumnStretch(0, 1);
groupsLayout->setRowStretch(1, 1);
int row = -1;
row++;
{
auto hbox = new QHBoxLayout;
auto label = new QLabel{i18nc("@label", "Search:")};
label->setToolTip(i18nc("@info:tooltip", "Search the list for groups matching the search term."));
hbox->addWidget(label);
ui.groupsFilter = new QLineEdit(q);
ui.groupsFilter->setClearButtonEnabled(true);
ui.groupsFilter->setToolTip(i18nc("@info:tooltip", "Search the list for groups matching the search term."));
ui.groupsFilter->setPlaceholderText(i18nc("@info::placeholder", "Enter search term"));
label->setBuddy(ui.groupsFilter);
hbox->addWidget(ui.groupsFilter, 1);
groupsLayout->addLayout(hbox, row, 0);
}
ui.groupsFilter = new QLineEdit(q);
ui.groupsFilter->setClearButtonEnabled(true);
ui.groupsFilter->setPlaceholderText(i18nc("@info::placeholder", "Search..."));
groupsLayout->addWidget(ui.groupsFilter, 0, 0);
row++;
groupsModel = AbstractKeyListModel::createFlatKeyListModel(q);
groupsFilterModel = new ProxyModel(q);
groupsFilterModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
......@@ -109,7 +123,7 @@ public:
ui.groupsList->setSelectionBehavior(QAbstractItemView::SelectRows);
ui.groupsList->setSelectionMode(QAbstractItemView::ExtendedSelection);
groupsLayout->addWidget(ui.groupsList, 1, 0);
groupsLayout->addWidget(ui.groupsList, row, 0);
auto groupsButtonLayout = new QVBoxLayout;
......@@ -130,7 +144,7 @@ public:
groupsButtonLayout->addStretch(1);
groupsLayout->addLayout(groupsButtonLayout, 1, 1);
groupsLayout->addLayout(groupsButtonLayout, row, 1);
mainLayout->addLayout(groupsLayout, /*stretch=*/ 1);
......
......@@ -87,10 +87,21 @@ public:
auto availableKeysLayout = new QVBoxLayout;
availableKeysLayout->addWidget(new QLabel(i18n("Available keys:"), q));
ui.availableKeysFilter = new QLineEdit(q);
ui.availableKeysFilter->setClearButtonEnabled(true);
ui.availableKeysFilter->setPlaceholderText(i18nc("Placeholder text", "Search..."));
availableKeysLayout->addWidget(ui.availableKeysFilter);
{
auto hbox = new QHBoxLayout;
auto label = new QLabel{i18nc("@label", "Search:")};
label->setToolTip(i18nc("@info:tooltip", "Search the list for keys matching the search term."));
hbox->addWidget(label);
ui.availableKeysFilter = new QLineEdit(q);
ui.availableKeysFilter->setClearButtonEnabled(true);
ui.availableKeysFilter->setToolTip(i18nc("@info:tooltip", "Search the list for keys matching the search term."));
ui.availableKeysFilter->setPlaceholderText(i18nc("@info::placeholder", "Enter search term"));
label->setBuddy(ui.availableKeysFilter);
hbox->addWidget(ui.availableKeysFilter, 1);
availableKeysLayout->addLayout(hbox);
}
availableKeysModel = AbstractKeyListModel::createFlatKeyListModel(q);
availableKeysModel->useKeyCache(true, KeyList::AllKeys);
......@@ -129,10 +140,21 @@ public:
auto groupKeysLayout = new QVBoxLayout;
groupKeysLayout->addWidget(new QLabel(i18n("Group keys:"), q));
ui.groupKeysFilter = new QLineEdit(q);
ui.groupKeysFilter->setClearButtonEnabled(true);
ui.groupKeysFilter->setPlaceholderText(i18nc("Placeholder text", "Search..."));
groupKeysLayout->addWidget(ui.groupKeysFilter);
{
auto hbox = new QHBoxLayout;
auto label = new QLabel{i18nc("@label", "Search:")};
label->setToolTip(i18nc("@info:tooltip", "Search the list for keys matching the search term."));
hbox->addWidget(label);
ui.groupKeysFilter = new QLineEdit(q);
ui.groupKeysFilter->setClearButtonEnabled(true);
ui.groupKeysFilter->setToolTip(i18nc("@info:tooltip", "Search the list for keys matching the search term."));
ui.groupKeysFilter->setPlaceholderText(i18nc("@info::placeholder", "Enter search term"));
label->setBuddy(ui.groupKeysFilter);
hbox->addWidget(ui.groupKeysFilter, 1);
groupKeysLayout->addLayout(hbox);
}
groupKeysModel = AbstractKeyListModel::createFlatKeyListModel(q);
ui.groupKeysList = new KeyTreeView(q);
......
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