plasma: focus the search widget whenever the launcher applet widget gains focus

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-05-17 07:25:06 +03:00
parent 8e835f1f0e
commit 23410fc396

View file

@ -1536,6 +1536,9 @@ public:
void resetSearch();
void setAllowedRunners(const QStringList &runners);
protected:
void focusInEvent(QFocusEvent *event) final;
public Q_SLOTS:
void slotUpdateLayout();
@ -1681,6 +1684,14 @@ void LauncherAppletWidget::setAllowedRunners(const QStringList &runners)
m_searchwidget->setAllowedRunners(runners);
}
void LauncherAppletWidget::focusInEvent(QFocusEvent *event)
{
QGraphicsWidget::focusInEvent(event);
if (!m_lineedit->hasFocus()) {
m_lineedit->setFocus(event->reason());
}
}
void LauncherAppletWidget::slotUpdateLayout()
{
slotUserTimeout();