Remove more unneeded tab widget code
This commit is contained in:
@@ -55,11 +55,6 @@ bool Stack::isPositionDraggable(QPoint p) const
|
||||
return dynamic_cast<Views::StackViewInterface *>(view())->isPositionDraggable(p);
|
||||
}
|
||||
|
||||
Controllers::DockWidget *Stack::currentDockWidget() const
|
||||
{
|
||||
return m_tabBar->currentDockWidget();
|
||||
}
|
||||
|
||||
void Stack::addDockWidget(DockWidget *dock)
|
||||
{
|
||||
insertDockWidget(dock, numDockWidgets());
|
||||
|
||||
@@ -35,9 +35,6 @@ public:
|
||||
*/
|
||||
int numDockWidgets() const;
|
||||
|
||||
/// @brief Returns the current dock widget
|
||||
DockWidget *currentDockWidget() const;
|
||||
|
||||
/// Sets whether the tab bar should be hidden when there's only 1 tab shown
|
||||
/// Default is true.
|
||||
/// See Config::Flag_AlwaysShowTabs to change this behaviour
|
||||
|
||||
@@ -28,16 +28,8 @@ Stack_qtquick::Stack_qtquick(Controllers::Stack *controller, QQuickItem *parent)
|
||||
, StackViewInterface(controller)
|
||||
, m_dockWidgetModel(new DockWidgetModel(this))
|
||||
{
|
||||
connect(m_dockWidgetModel, &DockWidgetModel::countChanged, this, [this] {
|
||||
Controllers::DockWidget *currentDw = m_dockWidgetModel->currentDockWidget();
|
||||
if (currentDw && m_dockWidgetModel->indexOf(currentDw) == -1) {
|
||||
// The current dock widget was removed, set the first one as current
|
||||
if (m_stack->numDockWidgets() > 0)
|
||||
m_dockWidgetModel->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
Q_EMIT m_stack->tabBar()->countChanged();
|
||||
});
|
||||
connect(m_dockWidgetModel, &DockWidgetModel::countChanged, this,
|
||||
[this] { Q_EMIT m_stack->tabBar()->countChanged(); });
|
||||
}
|
||||
|
||||
void Stack_qtquick::init()
|
||||
|
||||
Reference in New Issue
Block a user