diff --git a/src/DockAreaTabBar.cpp b/src/DockAreaTabBar.cpp index e32cbce..374fd79 100644 --- a/src/DockAreaTabBar.cpp +++ b/src/DockAreaTabBar.cpp @@ -257,6 +257,10 @@ void CDockAreaTabBar::insertTab(int Index, CDockWidgetTab* Tab) d->TabsLayout->insertWidget(Index, Tab); connect(Tab, SIGNAL(clicked()), this, SLOT(onTabClicked())); d->MenuOutdated = true; + if (Index <= d->CurrentIndex) + { + d->CurrentIndex++; + } } diff --git a/src/DockAreaTabBar.h b/src/DockAreaTabBar.h index 86a46b8..a683dc2 100644 --- a/src/DockAreaTabBar.h +++ b/src/DockAreaTabBar.h @@ -73,7 +73,9 @@ public: virtual ~CDockAreaTabBar(); /** - * Inserts the given dock widget tab at the given position + * Inserts the given dock widget tab at the given position. + * Inserting a new tab at an index less than or equal to the current index + * will increment the current index, but keep the current tab. */ void insertTab(int Index, CDockWidgetTab* Tab); diff --git a/src/stylesheets/default.css b/src/stylesheets/default.css index 1a676ca..b2301d7 100644 --- a/src/stylesheets/default.css +++ b/src/stylesheets/default.css @@ -36,7 +36,8 @@ ads--CDockWidgetTab ads--CDockWidgetTab[activeTab="true"] { - background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:0.5, stop:0 palette(window), stop:1 palette(light)); + /*background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:0.5, stop:0 palette(window), stop:1 palette(light));*/ + background: palette(highlight); } ads--CDockWidgetTab QLabel