From cacf5b3b2479220f4aa56879928ffe23a4277a7f Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 7 Feb 2014 21:28:59 -0200 Subject: Fix the rest of item visibilities and a few alignment fixes. Every item is now back on the profile. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/diveeventitem.cpp | 1 - qt-ui/profile/profilewidget2.cpp | 30 +++++++++++++++++++----------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/qt-ui/profile/diveeventitem.cpp b/qt-ui/profile/diveeventitem.cpp index 7b748fedd..2250a7306 100644 --- a/qt-ui/profile/diveeventitem.cpp +++ b/qt-ui/profile/diveeventitem.cpp @@ -99,7 +99,6 @@ void DiveEventItem::setupToolTipString() void DiveEventItem::eventVisibilityChanged(const QString& eventName, bool visible) { - } void DiveEventItem::recalculatePos() diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index d28f9358d..d64da9964 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -146,7 +146,7 @@ void ProfileWidget2::setupItemOnScene() cartesianPlane->setBottomAxis(timeAxis); cartesianPlane->setLeftAxis(profileYAxis); - diveComputerText->setAlignment(Qt::AlignLeft | Qt::AlignTop); + diveComputerText->setAlignment(Qt::AlignRight | Qt::AlignTop); diveComputerText->setBrush(getColor(TIME_TEXT)); setupItem(reportedCeiling, timeAxis, profileYAxis, dataModel, DivePlotDataModel::CEILING, DivePlotDataModel::TIME, 1); @@ -490,15 +490,23 @@ void ProfileWidget2::setProfileState() cartesianPlane->setVisible(true); meanDepth->setVisible(true); + diveComputerText->setVisible(true); - cartesianPlane->setHorizontalLine( timeAxis->line() ); - cartesianPlane->setVerticalLine( profileYAxis->line() ); -// diveCeiling->setVisible(true); -// reportedCeiling->setVisible(true); -// Q_FOREACH(DiveCalculatedTissue *tissue, allTissues){ -// tissue->setVisible(true); -// } -// Q_FOREACH(DiveEventItem *event, eventItems){ -// event->setVisible(true); -// } + diveComputerText->setPos(itemPos.dcLabel.on); + + cartesianPlane->setHorizontalLine( itemPos.time.expanded ); + cartesianPlane->setVerticalLine( itemPos.depth.expanded ); + + diveCeiling->setVisible(s.value("calcceiling").toBool()); + reportedCeiling->setVisible(s.value("dcceiling").toBool()); + + if(s.value("calcalltissues").toBool()){ + Q_FOREACH(DiveCalculatedTissue *tissue, allTissues){ + tissue->setVisible(true); + } + } + // Only set visible the ones that should be visible, but how? + Q_FOREACH(DiveEventItem *event, eventItems){ + event->setVisible(true); + } } -- cgit v1.2.3-70-g09d2