1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2025-01-30 09:05:04 +01:00

FancyTabWidget: Only set text and tooltip for inserted tab

This commit is contained in:
Jonas Kvinge 2024-11-02 15:01:48 +01:00
parent a8e307bb6a
commit 4f79b8692c

View File

@ -234,16 +234,12 @@ int FancyTabWidget::InsertTab(const int preffered_index, FancyTabData *tab) {
tabBar()->setTabData(actual_index, QVariant::fromValue<FancyTabData*>(tab)); tabBar()->setTabData(actual_index, QVariant::fromValue<FancyTabData*>(tab));
if (mode_ == Mode::IconOnlyTabs || mode_ == Mode::IconsSidebar) { if (mode_ == Mode::IconOnlyTabs || mode_ == Mode::IconsSidebar) {
for (int i = 0; i < count(); ++i) { tabBar()->setTabText(actual_index, ""_L1);
tabBar()->setTabText(i, ""_L1); tabBar()->setTabToolTip(actual_index, tabBar()->tabData(actual_index).value<FancyTabData*>()->label());
tabBar()->setTabToolTip(i, tabBar()->tabData(i).value<FancyTabData*>()->label());
}
} }
else { else {
for (int i = 0; i < count(); ++i) { tabBar()->setTabText(actual_index, tabBar()->tabData(actual_index).value<FancyTabData*>()->label());
tabBar()->setTabText(i, tabBar()->tabData(i).value<FancyTabData*>()->label()); tabBar()->setTabToolTip(actual_index, ""_L1);
tabBar()->setTabToolTip(i, ""_L1);
}
} }
return actual_index; return actual_index;