From ca517f1bf8f3c690e2d3651d7f74e1b68ed3bb98 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 2 Jul 2013 10:13:06 -0300 Subject: Shared background for profile and planner. Share the background for profile and planner. Those are not the same class, but they should behave somwheat the same. Signed-off-by: Tomaz Canabrava --- qt-ui/diveplanner.cpp | 4 ++++ qt-ui/profilegraphics.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 053e4efff..115aa5f7a 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -1,4 +1,6 @@ #include "diveplanner.h" +#include "graphicsview-common.h" + #include "../dive.h" #include #include @@ -15,6 +17,8 @@ DivePlannerGraphics::DivePlannerGraphics(QWidget* parent): QGraphicsView(parent), activeDraggedHandler(0), lastValidPos(0.0, 0.0) { + fill_profile_color(); + setBackgroundBrush(profile_color[BACKGROUND].at(0)); setMouseTracking(true); setScene(new QGraphicsScene()); scene()->setSceneRect(0,0,200,200); diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp index 93f6dda6e..25538758c 100644 --- a/qt-ui/profilegraphics.cpp +++ b/qt-ui/profilegraphics.cpp @@ -43,8 +43,10 @@ extern int evn_used; ProfileGraphicsView::ProfileGraphicsView(QWidget* parent) : QGraphicsView(parent), toolTip(0) , dive(0), diveDC(0) { gc.printer = false; + fill_profile_color(); setScene(new QGraphicsScene()); - setBackgroundBrush(QColor("#F3F3E6")); + + setBackgroundBrush(profile_color[BACKGROUND].at(0)); scene()->installEventFilter(this); setRenderHint(QPainter::Antialiasing); @@ -59,7 +61,7 @@ ProfileGraphicsView::ProfileGraphicsView(QWidget* parent) : QGraphicsView(parent setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy (Qt::ScrollBarAlwaysOff); - fill_profile_color(); + } void ProfileGraphicsView::wheelEvent(QWheelEvent* event) -- cgit v1.2.3-70-g09d2