[cuttlefish] Auto-focus on search textfield when app opens
ClosedPublic

Authored by Zren on Mon, Oct 29, 4:07 PM.

Details

Test Plan

Manually edited /usr/share/plasma/packages/org.kde.plasma.cuttlefish/contents/ui/Tools.qml, then launched cuttlefish.

Diff Detail

Repository
R118 Plasma SDK
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
Zren created this revision.Mon, Oct 29, 4:07 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMon, Oct 29, 4:07 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
Zren requested review of this revision.Mon, Oct 29, 4:07 PM
ngraham accepted this revision.Mon, Oct 29, 4:11 PM
ngraham added a subscriber: ngraham.

YES

This revision is now accepted and ready to land.Mon, Oct 29, 4:11 PM
This revision was automatically updated to reflect the committed changes.

You're my hero!

Zren added a comment.Mon, Oct 29, 9:36 PM

YES

lol, that annoyed you too eh? It's been bugging me for ages.

Indeed. I backported your change to Plasma/5.12 and Plasma/5.14, BTW. Now the only remaining annoyance is the fact that it doesn't quit with Ctrl+q...

Zren added a comment.Mon, Oct 29, 11:42 PM

So adding this shooooould work... but doesn't.

// cuttlefish.qml
import QtQuick 2.5
Item {
    Shortcut {
        sequence: StandardKey.Quit
        onActivated: Qt.quit()
    }
}

We get:

Signal QQmlEngine::quit() emitted, but no receivers connected to handle it.

to quit a C++ application when this method is called, connect the QQmlEngine::quit() signal to the QCoreApplication::quit() slot.

Hmmm.

Skimming Google/StackOverflow, we need to add:

// main.cpp
#include <QQmlEngine>
QObject::connect(settingsapp->engine(), &QQmlEngine::quit, &app, &QApplication::quit);

I wonder if we should be doing the shortcut in C++ as a QAction... oh well, discuss that in the patch. Patch incoming.