forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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)
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user