projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
pulseview.qrc: Add missing application-exit.png entry.
[pulseview.git]
/
pv
/
view
/
signal.cpp
diff --git
a/pv/view/signal.cpp
b/pv/view/signal.cpp
index 3e951b339bc261c319e3807249c2a4d91ae35462..33cfef2d418839a588bc269ac36729b30e67ae2b 100644
(file)
--- a/
pv/view/signal.cpp
+++ b/
pv/view/signal.cpp
@@
-20,6
+20,8
@@
#include <extdef.h>
#include <extdef.h>
+#include <QApplication>
+
#include "signal.h"
#include "view.h"
#include "signal.h"
#include "view.h"
@@
-27,9
+29,12
@@
namespace pv {
namespace view {
const int Signal::LabelHitPadding = 2;
namespace view {
const int Signal::LabelHitPadding = 2;
+const int Signal::LabelHighlightRadius = 6;
Signal::Signal(QString name) :
Signal::Signal(QString name) :
- _name(name)
+ _name(name),
+ _v_offset(0),
+ _selected(false)
{
}
{
}
@@
-53,6
+58,26
@@
void Signal::set_colour(QColor colour)
_colour = colour;
}
_colour = colour;
}
+int Signal::get_v_offset() const
+{
+ return _v_offset;
+}
+
+void Signal::set_v_offset(int v_offset)
+{
+ _v_offset = v_offset;
+}
+
+bool Signal::selected() const
+{
+ return _selected;
+}
+
+void Signal::select(bool select)
+{
+ _selected = select;
+}
+
void Signal::paint_label(QPainter &p, const QRect &rect, bool hover)
{
p.setBrush(_colour);
void Signal::paint_label(QPainter &p, const QRect &rect, bool hover)
{
p.setBrush(_colour);
@@
-80,6
+105,14
@@
void Signal::paint_label(QPainter &p, const QRect &rect, bool hover)
QPointF(label_rect.left() + 1, label_rect.bottom() - 1)
};
QPointF(label_rect.left() + 1, label_rect.bottom() - 1)
};
+ if (_selected) {
+ p.setPen(QPen(QApplication::palette().brush(
+ QPalette::Highlight), LabelHighlightRadius,
+ Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
+ p.setBrush(Qt::transparent);
+ p.drawPolygon(points, countof(points));
+ }
+
p.setPen(Qt::transparent);
p.setBrush(hover ? colour.lighter() : colour);
p.drawPolygon(points, countof(points));
p.setPen(Qt::transparent);
p.setBrush(hover ? colour.lighter() : colour);
p.drawPolygon(points, countof(points));