Skip to content

Commit

Permalink
Merge pull request #358 from silicon-heaven/show-open-hand-cursor-abo…
Browse files Browse the repository at this point in the history
…ve-graph-header

show open hand cursor above graph header
  • Loading branch information
fvacek authored Oct 6, 2023
2 parents a430d1e + b7c8d50 commit 87ce515
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libshvvisu/src/timeline/graphwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,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));
}
Expand Down Expand Up @@ -849,6 +852,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();
Expand Down
1 change: 1 addition & 0 deletions libshvvisu/src/timeline/graphwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 87ce515

Please sign in to comment.