aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2017-11-07 18:03:29 +0100
committerEike Ziller <eike.ziller@qt.io>2017-11-10 08:03:57 +0000
commit830bf680d2c1c79a485fb0bf7869534145c9c672 (patch)
treee39f02b59a359bc46537e649e85ba0a5e8369643 /src
parentb2faf3b76747410be7cb7b3775a3ca87cc0a86b0 (diff)
Fix file system view layout on macOS
Combo boxes on Qt/macOS add an implicit spacing to their containing widget, which lead to a gray border around the tree view. Move the combo box into a separate widget to avoid the border around the tree view, and paint the background of the file system view to avoid a gray border around the combo box. Change-Id: I9cb8329f585d48016896d558e817c3d978a78669 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/projectexplorer/foldernavigationwidget.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/projectexplorer/foldernavigationwidget.cpp b/src/plugins/projectexplorer/foldernavigationwidget.cpp
index 80e35ecbcd..c30d056c6d 100644
--- a/src/plugins/projectexplorer/foldernavigationwidget.cpp
+++ b/src/plugins/projectexplorer/foldernavigationwidget.cpp
@@ -115,6 +115,8 @@ FolderNavigationWidget::FolderNavigationWidget(QWidget *parent) : QWidget(parent
m_toggleSync(new QToolButton(this)),
m_rootSelector(new QComboBox)
{
+ setBackgroundRole(QPalette::Base);
+ setAutoFillBackground(true);
m_fileSystemModel->setResolveSymlinks(false);
m_fileSystemModel->setIconProvider(Core::FileIconProvider::iconProvider());
QDir::Filters filters = QDir::AllEntries | QDir::NoDotAndDotDot;
@@ -131,8 +133,14 @@ FolderNavigationWidget::FolderNavigationWidget(QWidget *parent) : QWidget(parent
showOnlyFirstColumn(m_listView);
setFocusProxy(m_listView);
+ auto selectorWidget = new QWidget(this);
+ auto selectorLayout = new QVBoxLayout(selectorWidget);
+ selectorWidget->setLayout(selectorLayout);
+ selectorLayout->setContentsMargins(0, 0, 0, 0);
+ selectorLayout->addWidget(m_rootSelector);
+
auto layout = new QVBoxLayout();
- layout->addWidget(m_rootSelector);
+ layout->addWidget(selectorWidget);
layout->addWidget(m_listView);
layout->setSpacing(0);
layout->setContentsMargins(0, 0, 0, 0);