Skip to content

Commit

Permalink
ui/show manager: handle CTRL+mouse wheel to zoom in/out (fix #1629)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcallegari committed Nov 4, 2024
1 parent df3ccdd commit 8a5a946
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ qlcplus (4.13.2) stable; urgency=low
* engine: add stopOnExit, waitFunctionStart and waitFunctionStop commands to Script - see documentation (thanks to ldebs)
* UI/Fixture Manager: limit the number of RGB panel columns for RGBW to avoid crash
* UI/Show Manager: show step notes on the timeline (thanks to anarchid)
* UI/Show Manager: handle CTRL+mouse wheel to zoom in/out
* Plugins/OS2L: fix receiving multiple messages at once
* Web Access: fix grand master stopping running functions
* Web Access: fix simple desk not resetting the current universe
Expand Down
17 changes: 17 additions & 0 deletions ui/src/showmanager/multitrackview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,23 @@ void MultiTrackView::mouseReleaseEvent(QMouseEvent * e)
//qDebug() << Q_FUNC_INFO << "View clicked at pos: " << e->pos().x() << e->pos().y();
}

void MultiTrackView::wheelEvent(QWheelEvent *event)
{
if (event->modifiers() & Qt::ControlModifier)
{
int zoomValue = m_timeSlider->value();
if (event->pixelDelta().y() > 0)
zoomValue++;
else
zoomValue--;

if (zoomValue >= m_timeSlider->minimum() && zoomValue <= m_timeSlider->maximum())
m_timeSlider->setValue(zoomValue);
return;
}
QGraphicsView::wheelEvent(event);
}

void MultiTrackView::slotHeaderClicked(QGraphicsSceneMouseEvent *event)
{
m_cursor->setPos(TRACK_WIDTH + event->pos().toPoint().x(), 0);
Expand Down
3 changes: 2 additions & 1 deletion ui/src/showmanager/multitrackview.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ class MultiTrackView : public QGraphicsView
bool m_snapToGrid;

public slots:
void mouseReleaseEvent(QMouseEvent * e);
void mouseReleaseEvent(QMouseEvent *e);
void wheelEvent(QWheelEvent *event);

protected slots:
void slotHeaderClicked(QGraphicsSceneMouseEvent *event);
Expand Down

0 comments on commit 8a5a946

Please sign in to comment.