diff options
author | Eike Ziller <eike.ziller@qt.io> | 2018-08-14 11:44:41 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2018-08-15 09:41:14 +0000 |
commit | 58747b2de107e8f6ac00daeb431ecbf3e603fd34 (patch) | |
tree | 1bd3a49e0117c487d43f5dea57bc3d627b8efbf7 /src | |
parent | 8fee3dd4b16da75f621455ff0b2386f819f47c91 (diff) | |
download | qt-creator-58747b2de107e8f6ac00daeb431ecbf3e603fd34.tar.gz |
Fix hiding file system view's bread crumb
When hiding the bread crumbs in the filter option dropdown, there was
some spacing and the separator line left.
With this patch, the spacing and line are hidden too, making the layout
nicer and more similar to before the bread crumbs feature existed.
Task-number: QTCREATORBUG-20733
Change-Id: I560b4414804c8cd25e88d645aa3042acb1b8e06c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/projectexplorer/foldernavigationwidget.cpp | 12 | ||||
-rw-r--r-- | src/plugins/projectexplorer/foldernavigationwidget.h | 1 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/plugins/projectexplorer/foldernavigationwidget.cpp b/src/plugins/projectexplorer/foldernavigationwidget.cpp index 0df7005c56..d4c91d32b9 100644 --- a/src/plugins/projectexplorer/foldernavigationwidget.cpp +++ b/src/plugins/projectexplorer/foldernavigationwidget.cpp @@ -295,6 +295,7 @@ FolderNavigationWidget::FolderNavigationWidget(QWidget *parent) : QWidget(parent m_toggleSync(new QToolButton(this)), m_toggleRootSync(new QToolButton(this)), m_rootSelector(new QComboBox), + m_crumbContainer(new QWidget(this)), m_crumbLabel(new DelayedFileCrumbLabel(this)) { m_context = new Core::IContext(this); @@ -337,16 +338,21 @@ FolderNavigationWidget::FolderNavigationWidget(QWidget *parent) : QWidget(parent selectorLayout->setContentsMargins(0, 0, 0, 0); selectorLayout->addWidget(m_rootSelector, 10); + auto crumbContainerLayout = new QVBoxLayout; + crumbContainerLayout->setSpacing(0); + crumbContainerLayout->setContentsMargins(0, 0, 0, 0); + m_crumbContainer->setLayout(crumbContainerLayout); auto crumbLayout = new QVBoxLayout; crumbLayout->setSpacing(0); crumbLayout->setContentsMargins(4, 4, 4, 4); crumbLayout->addWidget(m_crumbLabel); + crumbContainerLayout->addLayout(crumbLayout); + crumbContainerLayout->addWidget(createHLine()); m_crumbLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop); auto layout = new QVBoxLayout(); layout->addWidget(selectorWidget); - layout->addLayout(crumbLayout); - layout->addWidget(createHLine()); + layout->addWidget(m_crumbContainer); layout->addWidget(m_listView); layout->setSpacing(0); layout->setContentsMargins(0, 0, 0, 0); @@ -432,7 +438,7 @@ void FolderNavigationWidget::toggleAutoSynchronization() void FolderNavigationWidget::setShowBreadCrumbs(bool show) { m_showBreadCrumbsAction->setChecked(show); - m_crumbLabel->setVisible(show); + m_crumbContainer->setVisible(show); } void FolderNavigationWidget::setShowFoldersOnTop(bool onTop) diff --git a/src/plugins/projectexplorer/foldernavigationwidget.h b/src/plugins/projectexplorer/foldernavigationwidget.h index 1e55bbe83a..8f428863eb 100644 --- a/src/plugins/projectexplorer/foldernavigationwidget.h +++ b/src/plugins/projectexplorer/foldernavigationwidget.h @@ -145,6 +145,7 @@ private: QToolButton *m_toggleSync = nullptr; QToolButton *m_toggleRootSync = nullptr; QComboBox *m_rootSelector = nullptr; + QWidget *m_crumbContainer = nullptr; DelayedFileCrumbLabel *m_crumbLabel = nullptr; // FolderNavigationWidgetFactory needs private members to build a menu |