Permalink
Browse files

Fix Keyboard Focus loss on Ride list

.. QWebEnginePage::setHtml() steals keyboard focus (!)

.. to stop this behaviour setEnabled(false) stops it
   from trying to do that.

.. this obviously only happens when NOWEBKIT is defined.
  • Loading branch information...
1 parent 073f475 commit 598d7c5f5a230506421ccffb16c33719cda8cfeb @liversedge liversedge committed Feb 16, 2017
@@ -35,6 +35,7 @@ IntervalSummaryWindow::IntervalSummaryWindow(Context *context) : context(context
{
setWindowTitle(tr("Interval Summary"));
setReadOnly(true);
+ setEnabled(false); // stop the fucking thing grabbing keyboard focus FFS.
setFrameStyle(QFrame::NoFrame);
#ifdef Q_OS_WIN
QStyle *cde = QStyleFactory::create(OS_STYLE);
@@ -141,6 +141,7 @@ LTMWindow::LTMWindow(Context *context) :
QFont defaultFont; // mainwindow sets up the defaults.. we need to apply
#ifdef NOWEBKIT
dataSummary = new QWebEngineView(this);
+ dataSummary->setEnabled(false); // stop grabbing focus
dataSummary->settings()->setFontSize(QWebEngineSettings::DefaultFontSize, defaultFont.pointSize()+1);
dataSummary->settings()->setFontFamily(QWebEngineSettings::StandardFont, defaultFont.family());
#else
@@ -92,6 +92,7 @@ RideSummaryWindow::RideSummaryWindow(Context *context, bool ridesummary) :
#ifdef NOWEBKIT
rideSummary = new QWebEngineView(this);
+ rideSummary->setEnabled(false);
#else
rideSummary = new QWebView(this);
#endif
@@ -105,6 +105,7 @@ DiarySidebar::DiarySidebar(Context *context) : context(context)
#ifdef NOWEBKIT
// WebEngine
summary = new QWebEngineView(this);
+ summary->setEnabled(false);
summary->setContentsMargins(0,0,0,0);
summary->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
summary->setAcceptDrops(false);
@@ -221,6 +221,7 @@ LTMSidebar::LTMSidebar(Context *context) : QWidget(context->mainWindow), context
#ifdef NOWEBKIT
summary = new QWebEngineView(this);
+ summary->setEnabled(false);
summary->setContentsMargins(0,0,0,0);
summary->page()->view()->setContentsMargins(0,0,0,0);
//XXX WEBENGINEsummary->page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);

0 comments on commit 598d7c5

Please sign in to comment.