Skip to content

Commit 039f729

Browse files
committed
Fix: Item stats weren't initially shown on any tab other than first open one
1 parent 42c79a0 commit 039f729

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/main/main_window.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,8 @@ void MainWindow::handle_tabChanged()
796796
// Make sure active table is up to date
797797
progress.setMaximum(activeMapper->compTable.getNumberOfCellsToUpdate());
798798
activeMapper->compTable.setUpdateImmediately(true, &progress);
799+
800+
const bool firstOpen = !activeMapper->tabHasBeenOpened(false);
799801
activeMapper->openingTab();
800802

801803
// Filter bar visibility
@@ -806,6 +808,7 @@ void MainWindow::handle_tabChanged()
806808
const bool statsShown = activeMapper->itemStatsPanelCurrentlySetVisible();
807809
showItemStatsPanelAction->setChecked(statsShown);
808810
activeMapper->statsEngine.setCurrentlyVisible(statsShown, true);
811+
if (firstOpen) activeMapper->tab.refreshStats();
809812
}
810813
generalStatsEngine.setCurrentlyVisible(!activeMapper);
811814

src/stats/stats_engine.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void StatsEngine::setCurrentlyVisible(bool visible, bool noUpdate)
6363
{
6464
currentlyVisible = visible;
6565

66-
if (currentlyVisible && !noUpdate) {
66+
if (visible && !noUpdate) {
6767
updateCharts();
6868
}
6969
}

0 commit comments

Comments
 (0)