From 13906d66d7d2b80916e5e6c1b2ced82c52a36ce5 Mon Sep 17 00:00:00 2001
From: Gennady Pospelov <g.pospelov@fz-juelich.de>
Date: Tue, 21 Jun 2016 22:43:00 +0200
Subject: [PATCH] Partly successful attempt to remove ugly blu-frame focus from
 widgets under MacOS.

---
 GUI/coregui/Views/CommonWidgets/ItemSelectorWidget.cpp          | 1 +
 .../Views/InstrumentWidgets/InstrumentSelectorWidget.cpp        | 1 +
 GUI/coregui/Views/PropertyEditor/ComponentEditorPrivate.cpp     | 2 +-
 GUI/coregui/Views/SampleViewComponents.cpp                      | 1 +
 .../Views/SimulationWidgets/SimulationDataSelectorWidget.cpp    | 1 +
 GUI/coregui/Views/WelcomeView.cpp                               | 2 ++
 6 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/GUI/coregui/Views/CommonWidgets/ItemSelectorWidget.cpp b/GUI/coregui/Views/CommonWidgets/ItemSelectorWidget.cpp
index 2354b3648d5..a52eb2a463b 100644
--- a/GUI/coregui/Views/CommonWidgets/ItemSelectorWidget.cpp
+++ b/GUI/coregui/Views/CommonWidgets/ItemSelectorWidget.cpp
@@ -37,6 +37,7 @@ ItemSelectorWidget::ItemSelectorWidget(QWidget *parent)
     setLayout(layout);
 
     m_listView->setContextMenuPolicy(Qt::CustomContextMenu);
+    m_listView->setAttribute(Qt::WA_MacShowFocusRect, false);
 
     connect(m_listView, SIGNAL(customContextMenuRequested(const QPoint &)),
             this, SLOT(onCustomContextMenuRequested(const QPoint &)));
diff --git a/GUI/coregui/Views/InstrumentWidgets/InstrumentSelectorWidget.cpp b/GUI/coregui/Views/InstrumentWidgets/InstrumentSelectorWidget.cpp
index e5b56ebbce3..7d0edf1bb43 100644
--- a/GUI/coregui/Views/InstrumentWidgets/InstrumentSelectorWidget.cpp
+++ b/GUI/coregui/Views/InstrumentWidgets/InstrumentSelectorWidget.cpp
@@ -38,6 +38,7 @@ InstrumentSelectorWidget::InstrumentSelectorWidget(InstrumentModel *model, QWidg
     m_listView->setMovement(QListView::Static);
     m_listView->setMaximumWidth(200);
     m_listView->setSpacing(12);
+    m_listView->setAttribute(Qt::WA_MacShowFocusRect, false);
     //m_listView->setModel(m_instrumentModel);
 
     m_listView->setObjectName("listView");
diff --git a/GUI/coregui/Views/PropertyEditor/ComponentEditorPrivate.cpp b/GUI/coregui/Views/PropertyEditor/ComponentEditorPrivate.cpp
index 42992d3dbcd..970dff111da 100644
--- a/GUI/coregui/Views/PropertyEditor/ComponentEditorPrivate.cpp
+++ b/GUI/coregui/Views/PropertyEditor/ComponentEditorPrivate.cpp
@@ -79,7 +79,7 @@ void ComponentEditorPrivate::init_browser()
             "ComponentEditorPrivate::init_browser() -> Error. "
             "Unknown browser type.");
     }
-
+    m_browser->setAttribute(Qt::WA_MacShowFocusRect, false);
     m_browser->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
     m_browser->setFactoryForManager(m_manager, m_propertyFactory);
 }
diff --git a/GUI/coregui/Views/SampleViewComponents.cpp b/GUI/coregui/Views/SampleViewComponents.cpp
index 8e4a9caa954..63e9fb26aa3 100644
--- a/GUI/coregui/Views/SampleViewComponents.cpp
+++ b/GUI/coregui/Views/SampleViewComponents.cpp
@@ -33,6 +33,7 @@ ItemTreeView *SampleViewComponents::createTreeView(
     FilterPropertyProxy *proxy = new FilterPropertyProxy(1, parent);
     proxy->setSourceModel(sampleModel);
     tree_view->setModel(proxy);
+    tree_view->setAttribute(Qt::WA_MacShowFocusRect, false);
     return tree_view;
 }
 
diff --git a/GUI/coregui/Views/SimulationWidgets/SimulationDataSelectorWidget.cpp b/GUI/coregui/Views/SimulationWidgets/SimulationDataSelectorWidget.cpp
index d484e289220..493e010eaf5 100644
--- a/GUI/coregui/Views/SimulationWidgets/SimulationDataSelectorWidget.cpp
+++ b/GUI/coregui/Views/SimulationWidgets/SimulationDataSelectorWidget.cpp
@@ -57,6 +57,7 @@ SimulationDataSelectorWidget::SimulationDataSelectorWidget(QWidget *parent)
     QLabel *instrumentSelectionLabel = new QLabel(QStringLiteral("Select Instrument:"));
     instrumentSelectionLabel->setToolTip(select_instrument_tooltip);
     m_instrumentCombo->setToolTip(select_instrument_tooltip);
+    m_instrumentCombo->setAttribute(Qt::WA_MacShowFocusRect, false);
 
     QLabel *sampleSelectionLabel = new QLabel(QStringLiteral("Select Sample:"));
     sampleSelectionLabel->setToolTip(select_sample_tooltip);
diff --git a/GUI/coregui/Views/WelcomeView.cpp b/GUI/coregui/Views/WelcomeView.cpp
index 75ad8b7f0c0..bb6f1123581 100644
--- a/GUI/coregui/Views/WelcomeView.cpp
+++ b/GUI/coregui/Views/WelcomeView.cpp
@@ -68,6 +68,8 @@ WelcomeView::WelcomeView(MainWindow *parent)
     m_newProjectButton->setFont(buttonFont);
     m_newProjectButton->setToolTip("Create new project");
 //    m_newProjectButton->setStyleSheet(ssheet);
+    m_newProjectButton->setAttribute(Qt::WA_MacShowFocusRect, false);
+
 
     m_openProjectButton = new QPushButton(tr("Open Project"));
     m_openProjectButton->setMinimumWidth(buttonWidth);
-- 
GitLab