projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
TimeMarker: Removed Offset
[pulseview.git]
/
pv
/
view
/
timemarker.cpp
diff --git
a/pv/view/timemarker.cpp
b/pv/view/timemarker.cpp
index ed9df36064f74407b1a1ee81f80d11378adbc81c..2b17184408a4ba8a5fb5f44f03320d832afdca8f 100644
(file)
--- a/
pv/view/timemarker.cpp
+++ b/
pv/view/timemarker.cpp
@@
-40,7
+40,6
@@
namespace pv {
namespace view {
const int TimeMarker::ArrowSize = 4;
namespace view {
const int TimeMarker::ArrowSize = 4;
-const int TimeMarker::Offset = 1;
TimeMarker::TimeMarker(View &view, const QColor &colour, double time) :
TimeItem(view),
TimeMarker::TimeMarker(View &view, const QColor &colour, double time) :
TimeItem(view),
@@
-87,20
+86,20
@@
QRectF TimeMarker::label_rect(const QRectF &rect) const
QFontMetrics m(QApplication::font());
const float text_width =
max(m.boundingRect(get_text()).size().width(), ArrowSize);
QFontMetrics m(QApplication::font());
const float text_width =
max(m.boundingRect(get_text()).size().width(), ArrowSize);
- const float text_height = m.
boundingRect("Tg").size().
height();
+ const float text_height = m.height();
const QSizeF label_size(
text_width + View::LabelPadding.width() * 2,
text_height + View::LabelPadding.height() * 2);
const float top = rect.height() - label_size.height() -
const QSizeF label_size(
text_width + View::LabelPadding.width() * 2,
text_height + View::LabelPadding.height() * 2);
const float top = rect.height() - label_size.height() -
- TimeMarker::
Offset - TimeMarker::
ArrowSize - 0.5f;
+ TimeMarker::ArrowSize - 0.5f;
const float height = label_size.height();
return QRectF(x - label_size.width() / 2, top,
label_size.width(), height);
}
const float height = label_size.height();
return QRectF(x - label_size.width() / 2, top,
label_size.width(), height);
}
-void TimeMarker::paint_label(QPainter &p, const QRect &rect)
+void TimeMarker::paint_label(QPainter &p, const QRect &rect
, bool hover
)
{
if (!enabled())
return;
{
if (!enabled())
return;
@@
-136,7
+135,7
@@
void TimeMarker::paint_label(QPainter &p, const QRect &rect)
}
p.setPen(Qt::transparent);
}
p.setPen(Qt::transparent);
- p.setBrush(colour_);
+ p.setBrush(
hover ? colour_.lighter() :
colour_);
p.drawPolygon(points, countof(points));
p.setPen(colour_.lighter());
p.drawPolygon(points, countof(points));
p.setPen(colour_.lighter());