Remove more unneeded tab widget code

This commit is contained in:
Sergio Martins
2022-08-14 18:47:59 +01:00
parent 7f072366ed
commit 6a9988e7b0
3 changed files with 2 additions and 18 deletions

View File

@@ -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());

View File

@@ -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

View File

@@ -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()