Commit 830bf680 authored by Eike Ziller's avatar Eike Ziller

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's avatarAlessandro Portale <alessandro.portale@qt.io>
parent b2faf3b7
......@@ -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);
......
Markdown is supported
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