Skip to content

Commit

Permalink
applauncherwidget: enter key to launch current/first shown app (flame…
Browse files Browse the repository at this point in the history
…shot-org#3331)

* applauncherwidget: enter key to launch current/first shown app

* fix clang formatting
  • Loading branch information
d-a-s authored Sep 14, 2023
1 parent a7e0a61 commit 1d276a2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/tools/launcher/applauncherwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,17 @@ void AppLauncherWidget::keyPressEvent(QKeyEvent* keyEvent)
{
if (keyEvent->key() == Qt::Key_Escape) {
close();
} else if (keyEvent->key() == Qt::Key_Return) {
auto* widget = (QListWidget*)m_tabWidget->currentWidget();
if (m_filterList->isVisible())
widget = m_filterList;
auto* item = widget->currentItem();
if (item == nullptr) {
item = widget->item(0);
widget->setCurrentItem(item);
}
QModelIndex const idx = widget->currentIndex();
AppLauncherWidget::launch(idx);
} else {
QWidget::keyPressEvent(keyEvent);
}
Expand Down

0 comments on commit 1d276a2

Please sign in to comment.