Fix a bug of Overview perf (#1324)

This commit is contained in:
Vanellope 2019-03-18 15:34:30 +09:00 committed by Itay Cohen
parent 8130e1c54f
commit f23ff9d8c5
3 changed files with 3 additions and 1 deletions

View File

@ -344,7 +344,7 @@ void MainWindow::setOverviewData()
bool MainWindow::isOverviewActive() bool MainWindow::isOverviewActive()
{ {
if (!overviewDock || overviewDock->userClosed) { if (!overviewDock || overviewDock->userClosed || !overviewDock->isVisible) {
return false; return false;
} }
if (core->isGraphEmpty()) { if (core->isGraphEmpty()) {

View File

@ -15,6 +15,7 @@ OverviewWidget::OverviewWidget(MainWindow *main, QAction *action) :
}); });
connect(this, &QDockWidget::visibilityChanged, this, [ = ](bool visibility) { connect(this, &QDockWidget::visibilityChanged, this, [ = ](bool visibility) {
isVisible = visibility;
if (visibility) { if (visibility) {
updateContents(); updateContents();
} }

View File

@ -19,6 +19,7 @@ public:
* @brief if user closed this widget explicitly * @brief if user closed this widget explicitly
*/ */
bool userClosed = false; bool userClosed = false;
bool isVisible = false;
private: private:
RefreshDeferrer *refreshDeferrer; RefreshDeferrer *refreshDeferrer;
/** /**