mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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 <tcanabrava@kde.org>
This commit is contained in:
parent
2df0b398f3
commit
ca517f1bf8
2 changed files with 8 additions and 2 deletions
|
@ -1,4 +1,6 @@
|
||||||
#include "diveplanner.h"
|
#include "diveplanner.h"
|
||||||
|
#include "graphicsview-common.h"
|
||||||
|
|
||||||
#include "../dive.h"
|
#include "../dive.h"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
|
@ -15,6 +17,8 @@
|
||||||
DivePlannerGraphics::DivePlannerGraphics(QWidget* parent): QGraphicsView(parent), activeDraggedHandler(0),
|
DivePlannerGraphics::DivePlannerGraphics(QWidget* parent): QGraphicsView(parent), activeDraggedHandler(0),
|
||||||
lastValidPos(0.0, 0.0)
|
lastValidPos(0.0, 0.0)
|
||||||
{
|
{
|
||||||
|
fill_profile_color();
|
||||||
|
setBackgroundBrush(profile_color[BACKGROUND].at(0));
|
||||||
setMouseTracking(true);
|
setMouseTracking(true);
|
||||||
setScene(new QGraphicsScene());
|
setScene(new QGraphicsScene());
|
||||||
scene()->setSceneRect(0,0,200,200);
|
scene()->setSceneRect(0,0,200,200);
|
||||||
|
|
|
@ -43,8 +43,10 @@ extern int evn_used;
|
||||||
ProfileGraphicsView::ProfileGraphicsView(QWidget* parent) : QGraphicsView(parent), toolTip(0) , dive(0), diveDC(0)
|
ProfileGraphicsView::ProfileGraphicsView(QWidget* parent) : QGraphicsView(parent), toolTip(0) , dive(0), diveDC(0)
|
||||||
{
|
{
|
||||||
gc.printer = false;
|
gc.printer = false;
|
||||||
|
fill_profile_color();
|
||||||
setScene(new QGraphicsScene());
|
setScene(new QGraphicsScene());
|
||||||
setBackgroundBrush(QColor("#F3F3E6"));
|
|
||||||
|
setBackgroundBrush(profile_color[BACKGROUND].at(0));
|
||||||
scene()->installEventFilter(this);
|
scene()->installEventFilter(this);
|
||||||
|
|
||||||
setRenderHint(QPainter::Antialiasing);
|
setRenderHint(QPainter::Antialiasing);
|
||||||
|
@ -59,7 +61,7 @@ ProfileGraphicsView::ProfileGraphicsView(QWidget* parent) : QGraphicsView(parent
|
||||||
setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
|
setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
|
||||||
setVerticalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
|
setVerticalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
|
||||||
|
|
||||||
fill_profile_color();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileGraphicsView::wheelEvent(QWheelEvent* event)
|
void ProfileGraphicsView::wheelEvent(QWheelEvent* event)
|
||||||
|
|
Loading…
Add table
Reference in a new issue