diff options
Diffstat (limited to 'qt-ui/profile/profilewidget2.cpp')
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index f0b7bc380..919db5c38 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -606,6 +606,7 @@ void ProfileWidget2::setEmptyState() if (currentState == EMPTY) return; + setBackgroundBrush(getColor(::BACKGROUND, isGrayscale)); dataModel->clear(); currentState = EMPTY; MainWindow::instance()->setToolButtonsEnabled(false); @@ -642,6 +643,11 @@ void ProfileWidget2::setProfileState() if (currentState == PROFILE) return; + if (dive_table.nr == 0) { // oops, called to plot something with zero dives. bail out. + setEmptyState(); + return; + } + currentState = PROFILE; MainWindow::instance()->setToolButtonsEnabled(true); toolTipItem->readPos(); |