diff --git a/examples/deleteonclose/main.cpp b/examples/deleteonclose/main.cpp index 2f08ffe..d4da8c1 100644 --- a/examples/deleteonclose/main.cpp +++ b/examples/deleteonclose/main.cpp @@ -11,6 +11,7 @@ int main(int argc, char *argv[]) QMainWindow w; ads::CDockManager::setConfigFlag(ads::CDockManager::FocusHighlighting, true); + ads::CDockManager::setConfigFlag(ads::CDockManager::AllTabsHaveCloseButton, true); auto dockManager = new ads::CDockManager(&w); QAction *action = new QAction("New Delete On Close", &w); diff --git a/src/DockAreaWidget.cpp b/src/DockAreaWidget.cpp index dcbef60..d762b84 100644 --- a/src/DockAreaWidget.cpp +++ b/src/DockAreaWidget.cpp @@ -136,6 +136,10 @@ public: m_CurrentWidget = nullptr; m_CurrentIndex = -1; } + else if (indexOf(Widget) < m_CurrentIndex) + { + --m_CurrentIndex; + } m_Widgets.removeOne(Widget); }