Skip to content

Commit

Permalink
Make government and sabotage tabs hide on re-click
Browse files Browse the repository at this point in the history
  • Loading branch information
rsubtil committed Sep 13, 2023
1 parent d21eaf6 commit ef0cbd3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions client/top_bar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,12 @@ void top_bar_left_click_gov()
if (!queen()->isRepoDlgOpen(QStringLiteral("GOV"))) {
government_report::instance()->init(true);
} else {
int i = queen()->gimmeIndexOf(QStringLiteral("GOV"));
QWidget *w = queen()->game_tab_widget->widget(i);
if (w->isVisible()) {
top_bar_show_map();
return;
}
queen()->game_tab_widget->setCurrentWidget(government_report::instance());
}
}
Expand All @@ -409,6 +415,12 @@ void top_bar_left_click_sabotages()
if (!queen()->isRepoDlgOpen(QStringLiteral("SAB"))) {
sabotages_report::instance()->init(true);
} else {
int i = queen()->gimmeIndexOf(QStringLiteral("SAB"));
QWidget *w = queen()->game_tab_widget->widget(i);
if (w->isVisible()) {
top_bar_show_map();
return;
}
queen()->game_tab_widget->setCurrentWidget(sabotages_report::instance());
}
}
Expand Down

0 comments on commit ef0cbd3

Please sign in to comment.