Skip to content

Commit

Permalink
FancyTabWidget: Only set text and tooltip for inserted tab
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaski committed Nov 2, 2024
1 parent a8e307b commit 4f79b86
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/widgets/fancytabwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,16 +234,12 @@ int FancyTabWidget::InsertTab(const int preffered_index, FancyTabData *tab) {
tabBar()->setTabData(actual_index, QVariant::fromValue<FancyTabData*>(tab));

if (mode_ == Mode::IconOnlyTabs || mode_ == Mode::IconsSidebar) {
for (int i = 0; i < count(); ++i) {
tabBar()->setTabText(i, ""_L1);
tabBar()->setTabToolTip(i, tabBar()->tabData(i).value<FancyTabData*>()->label());
}
tabBar()->setTabText(actual_index, ""_L1);
tabBar()->setTabToolTip(actual_index, tabBar()->tabData(actual_index).value<FancyTabData*>()->label());
}
else {
for (int i = 0; i < count(); ++i) {
tabBar()->setTabText(i, tabBar()->tabData(i).value<FancyTabData*>()->label());
tabBar()->setTabToolTip(i, ""_L1);
}
tabBar()->setTabText(actual_index, tabBar()->tabData(actual_index).value<FancyTabData*>()->label());
tabBar()->setTabToolTip(actual_index, ""_L1);
}

return actual_index;
Expand Down

0 comments on commit 4f79b86

Please sign in to comment.