# HG changeset patch # User Chris Cannam # Date 1389344646 0 # Node ID 833cd1b8014f45ec8250961d6707a056915e27d1 # Parent 084fd76deb89a36708fabd732dc04e578d75df78 Make it possible to globally hide pane accessories (close button & current-indicator) diff -r 084fd76deb89 -r 833cd1b8014f view/PaneStack.cpp --- a/view/PaneStack.cpp Thu Jan 09 16:41:55 2014 +0000 +++ b/view/PaneStack.cpp Fri Jan 10 09:04:06 2014 +0000 @@ -39,6 +39,7 @@ PaneStack::PaneStack(QWidget *parent, ViewManager *viewManager) : QFrame(parent), m_currentPane(0), + m_showAccessories(true), m_splitter(new QSplitter), m_propertyStackStack(new QStackedWidget), m_viewManager(viewManager), @@ -60,6 +61,12 @@ setLayout(layout); } +void +PaneStack::setShowPaneAccessories(bool show) +{ + m_showAccessories = show; +} + Pane * PaneStack::addPane(bool suppressPropertyBox) { @@ -79,6 +86,7 @@ xButton->setIcon(IconLoader().load("cross")); xButton->setFixedSize(QSize(16, 16)); xButton->setFlat(true); + xButton->setVisible(m_showAccessories); layout->addWidget(xButton, 0, 0); connect(xButton, SIGNAL(clicked()), this, SLOT(paneDeleteButtonClicked())); @@ -88,6 +96,7 @@ layout->setRowStretch(1, 20); currentIndicator->setMinimumWidth(8); currentIndicator->setScaledContents(true); + currentIndicator->setVisible(m_showAccessories); long initialCentreFrame = -1; for (int i = 0; i < m_panes.size(); ++i) { @@ -288,8 +297,8 @@ bool multi = (getPaneCount() > 1); for (std::vector::iterator i = m_panes.begin(); i != m_panes.end(); ++i) { - i->xButton->setVisible(multi); - i->currentIndicator->setVisible(multi); + i->xButton->setVisible(multi && m_showAccessories); + i->currentIndicator->setVisible(multi && m_showAccessories); } } diff -r 084fd76deb89 -r 833cd1b8014f view/PaneStack.h --- a/view/PaneStack.h Thu Jan 09 16:41:55 2014 +0000 +++ b/view/PaneStack.h Fri Jan 10 09:04:06 2014 +0000 @@ -68,6 +68,8 @@ void setLayoutStyle(LayoutStyle style); void setPropertyStackMinWidth(int mw); + + void setShowPaneAccessories(bool show); // current indicator, close button void sizePanesEqually(); @@ -119,6 +121,8 @@ std::vector m_panes; std::vector m_hiddenPanes; + bool m_showAccessories; + QSplitter *m_splitter; QStackedWidget *m_propertyStackStack;