summaryrefslogtreecommitdiffstats
path: root/qt-ui/profilegraphics.h
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-07-13 18:18:26 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-07-18 12:00:12 -0700
commit9de15dec6073aa668d41f7d8727606e05e4c3f6e (patch)
tree03b74839de840e199735d58cd6bf5ba96bbb609e /qt-ui/profilegraphics.h
parent17c97b921fb96d2849a027abe259230c336f1d83 (diff)
downloadsubsurface-9de15dec6073aa668d41f7d8727606e05e4c3f6e.tar.gz
Profile: support grayscale plotting
This patch adds the getColor() helper function to ProfileGraphicsView and EventItem so that retrieving a certain color can depend on a 'isGrayscale' flag. This flag is private and only set by ProfileGraphicsView::setPrintMode() at this point. EventItem also now accepts 'grayscale' as a constructor argument. A couple of side modifications are: - move setBackgroundBrush() to ProfileGraphicsView::plot() - set the same pen color as brush color for the dot in the '!' symbol inside EventItem::EventItem(). TODO: look for color issues when printing using the custom grayscale table Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'qt-ui/profilegraphics.h')
-rw-r--r--qt-ui/profilegraphics.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/qt-ui/profilegraphics.h b/qt-ui/profilegraphics.h
index 04a057bdc..f030ff1a8 100644
--- a/qt-ui/profilegraphics.h
+++ b/qt-ui/profilegraphics.h
@@ -1,6 +1,7 @@
#ifndef PROFILEGRAPHICS_H
#define PROFILEGRAPHICS_H
+#include "graphicsview-common.h"
#include "../display.h"
#include <QGraphicsView>
#include <QGraphicsItem>
@@ -60,12 +61,15 @@ private:
class EventItem : public QGraphicsPolygonItem
{
public:
- explicit EventItem(QGraphicsItem* parent = 0);
+ explicit EventItem(QGraphicsItem* parent = 0, bool grayscale = FALSE);
private:
ToolTipItem *controller;
QString text;
QIcon icon;
+ bool isGrayscale;
+
+ QColor getColor(const color_indice_t i);
};
class GraphicsTextEditor : public QGraphicsTextItem{
@@ -125,6 +129,7 @@ private:
void plot_pp_text();
void plot_depth_scale();
+ QColor getColor(const color_indice_t i);
QColor get_sac_color(int sac, int avg_sac);
void scrollViewTo(const QPoint pos);