From b7c8d50941bc6e6c3351e2df573523a7c16ef946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C5=A0pirk?= Date: Wed, 4 Oct 2023 10:52:18 +0200 Subject: [PATCH] show open hand cursor above graph header --- libshvvisu/src/timeline/graphwidget.cpp | 8 ++++++++ libshvvisu/src/timeline/graphwidget.h | 1 + 2 files changed, 9 insertions(+) diff --git a/libshvvisu/src/timeline/graphwidget.cpp b/libshvvisu/src/timeline/graphwidget.cpp index 9de126fe7..a8623f52f 100644 --- a/libshvvisu/src/timeline/graphwidget.cpp +++ b/libshvvisu/src/timeline/graphwidget.cpp @@ -338,6 +338,9 @@ void GraphWidget::mouseMoveEvent(QMouseEvent *event) else if((isMouseAboveChannelResizeHandle(pos)) || (m_mouseOperation == MouseOperation::ChannelHeaderResize)) { setCursor(QCursor(Qt::SizeVerCursor)); } + else if (isMouseAboveChannelHeader(pos)) { + setCursor(QCursor(Qt::OpenHandCursor)); + } else { setCursor(QCursor(Qt::ArrowCursor)); } @@ -833,6 +836,11 @@ void GraphWidget::removeProbes(qsizetype channel_ix) } } +bool GraphWidget::isMouseAboveChannelHeader(const QPoint &mouse_pos) const +{ + return graph()->posToChannelHeader(mouse_pos) > -1; +} + bool GraphWidget::isMouseAboveChannelResizeHandle(const QPoint &mouse_pos) const { const Graph *gr = graph(); diff --git a/libshvvisu/src/timeline/graphwidget.h b/libshvvisu/src/timeline/graphwidget.h index 24ae5736b..366747971 100644 --- a/libshvvisu/src/timeline/graphwidget.h +++ b/libshvvisu/src/timeline/graphwidget.h @@ -62,6 +62,7 @@ class SHVVISU_DECL_EXPORT GraphWidget : public QWidget void createProbe(qsizetype channel_ix, timemsec_t time); void removeProbes(qsizetype channel_ix); bool isMouseAboveChannelResizeHandle(const QPoint &mouse_pos) const; + bool isMouseAboveChannelHeader(const QPoint &mouse_pos) const; bool isMouseAboveMiniMap(const QPoint &mouse_pos) const; bool isMouseAboveMiniMapHandle(const QPoint &mouse_pos, bool left) const; bool isMouseAboveLeftMiniMapHandle(const QPoint &pos) const;