Tweak hover label a bit - remove it on leave and don't clip both sides

This commit is contained in:
baldurk
2017-07-14 13:09:03 +01:00
parent 57bdd0495b
commit 0aad2e9c03
2 changed files with 8 additions and 1 deletions
+7 -1
View File
@@ -231,6 +231,11 @@ void TimelineBar::wheelEvent(QWheelEvent *e)
layout();
}
void TimelineBar::leaveEvent(QEvent *e)
{
viewport()->update();
}
void TimelineBar::paintEvent(QPaintEvent *e)
{
QPainter p(viewport());
@@ -303,7 +308,8 @@ void TimelineBar::paintEvent(QPaintEvent *e)
p.drawLine(hoverRect.topLeft(), hoverRect.bottomLeft());
p.drawLine(hoverRect.topRight(), hoverRect.bottomRight());
// round down the width for clipping against labels below
// shrink the rect a bit for clipping against labels below
hoverRect.setX(qRound(hoverRect.x() + 0.5));
hoverRect.setWidth(int(hoverRect.width()));
}
else
+1
View File
@@ -52,6 +52,7 @@ protected:
void mouseReleaseEvent(QMouseEvent *e) override;
void mouseMoveEvent(QMouseEvent *e) override;
void wheelEvent(QWheelEvent *e) override;
void leaveEvent(QEvent *e) override;
void paintEvent(QPaintEvent *e) override;
void resizeEvent(QResizeEvent *e) override;