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

Add a focus frame to labels that receive keyboard focus

GnuPG-bug-id: 6036
parent a0459257
Pipeline #193318 passed with stage
in 3 minutes and 57 seconds
......@@ -59,6 +59,7 @@
#include <QDesktopServices>
#include <QFile>
#include <QDir>
#include <QFocusFrame>
#include <QPointer>
#include <memory>
......@@ -145,6 +146,7 @@ private:
public:
bool ignoreNewInstance;
bool firstNewInstance;
QPointer<QFocusFrame> focusFrame;
QPointer<ConfigureDialog> configureDialog;
QPointer<MainWindow> mainWindow;
SmartCard::ReaderStatus readerStatus;
......@@ -210,13 +212,28 @@ public:
}
UiServer::setLogStream(log->logFile());
#endif
}
void updateFocusFrame(QWidget *focusWidget)
{
if (focusWidget && focusWidget->inherits("QLabel")) {
if (!focusFrame) {
focusFrame = new QFocusFrame{focusWidget};
}
focusFrame->setWidget(focusWidget);
} else if (focusFrame) {
focusFrame->setWidget(nullptr);
}
}
};
KleopatraApplication::KleopatraApplication(int &argc, char *argv[])
: QApplication(argc, argv), d(new Private(this))
{
connect(this, &QApplication::focusChanged,
this, [this](QWidget *, QWidget *now) {
d->updateFocusFrame(now);
});
}
void KleopatraApplication::init()
......
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