Commit 43ecaf45 authored by Ming Rui Zhang's avatar Ming Rui Zhang

shortcut: block selecting elements that exceed the limit of smartlist

Change-Id: I2ac2442f78ebd678377b20b92ad3076767c68d9b
parent 56a8b8f9
......@@ -1582,12 +1582,20 @@ CallWidget::registerShortCuts()
connect(focusOnSmartListNextElementSC, &QShortcut::activated,
[this] {
ui->smartList->setCurrentIndex(ui->smartList->model()->index(ui->smartList->currentIndex().row() + 1, 0));
if (ui->smartList->currentIndex().row() == ui->smartList->model()->rowCount() - 1) {
return;
} else {
ui->smartList->setCurrentIndex(ui->smartList->model()->index(ui->smartList->currentIndex().row() + 1, 0));
}
});
connect(focusOnSmartListPrevElementSC, &QShortcut::activated,
[this] {
ui->smartList->setCurrentIndex(ui->smartList->model()->index(ui->smartList->currentIndex().row() - 1, 0));
if (ui->smartList->currentIndex().row() == 0) {
return;
} else {
ui->smartList->setCurrentIndex(ui->smartList->model()->index(ui->smartList->currentIndex().row() - 1, 0));
}
});
connect(focusOnContactSearchBarSC, &QShortcut::activated,
......
Markdown is supported
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