From e60f4d58932cc01f687cdaffb7bc50d10b745ea2 Mon Sep 17 00:00:00 2001 From: "craig.p.drummond" Date: Fri, 3 Oct 2014 15:49:36 +0000 Subject: [PATCH] Set focus on pagewidget's list when pref dialog is shown - to workaround weird OSX painting bug. --- gui/preferencesdialog.cpp | 5 +++++ support/pagewidget.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/gui/preferencesdialog.cpp b/gui/preferencesdialog.cpp index 655f48224..ec64fe9da 100644 --- a/gui/preferencesdialog.cpp +++ b/gui/preferencesdialog.cpp @@ -55,6 +55,7 @@ #endif #include "scrobbling/scrobblingsettings.h" #include +#include static int iCount=0; @@ -138,6 +139,10 @@ PreferencesDialog::PreferencesDialog(QWidget *parent) #endif setAttribute(Qt::WA_DeleteOnClose); setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); + + // Under OSX if we dont set focus, then a weird blue line is shown to the right of the item list + // this line looks like part of a focus highlight. Odd, but setting focus works-around this... + QTimer::singleShot(0, pageWidget, SLOT(setFocus())); } PreferencesDialog::~PreferencesDialog() diff --git a/support/pagewidget.h b/support/pagewidget.h index 9ce7c376d..b42993a25 100644 --- a/support/pagewidget.h +++ b/support/pagewidget.h @@ -80,6 +80,9 @@ public: PageWidgetItem * currentPage() const; void setCurrentPage(PageWidgetItem *item); +public Q_SLOTS: + void setFocus(); + Q_SIGNALS: void currentPageChanged();