Skip to content

Commit

Permalink
- Graph: Ctrl+left or middle-button click-dragging for panning, is
Browse files Browse the repository at this point in the history
  now a lot smoother, hopefully. (EXPERIMENTAL)
  • Loading branch information
rncbc committed Jul 19, 2023
1 parent fac5c00 commit 7dfe3a9
Show file tree
Hide file tree
Showing 14 changed files with 73 additions and 49 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ ChangeLog

GIT HEAD

- Graph: Ctrl+left or middle-button click-dragging for panning, is
now a lot smoother, hopefully. (EXPERIMENTAL)

- Graph: Click-dragging with the mouse middle-button is now used
for panning only, not to start a selection anymore. (EXPERIMENTAL)

Expand Down
23 changes: 22 additions & 1 deletion src/qjackctlGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1629,7 +1629,18 @@ void qjackctlGraphCanvas::mousePressEvent ( QMouseEvent *event )
&& (event->modifiers() & Qt::ControlModifier))
|| (event->button() == Qt::MiddleButton))
&& m_scene->selectedItems().isEmpty()) {
QGraphicsView::setCursor(Qt::ClosedHandCursor);
#if 1//NEW_DRAG_SCROLL_MODE
// HACK: When about to drag-scroll,
// always fake a left-button press...
QGraphicsView::setDragMode(ScrollHandDrag);
QMouseEvent event2(event->type(),
event->position(), event->globalPosition(),
Qt::LeftButton, Qt::LeftButton,
event->modifiers() | Qt::ControlModifier);
QGraphicsView::mousePressEvent(&event2);
#else
QGraphicsView::setCursor(Qt::ClosedHandCursor)
#endif
m_state = DragScroll;
}
}
Expand Down Expand Up @@ -1778,12 +1789,16 @@ void qjackctlGraphCanvas::mouseMoveEvent ( QMouseEvent *event )
}
break;
case DragScroll: {
#if 1//NEW_DRAG_SCROLL_MODE
QGraphicsView::mouseMoveEvent(event);
#else
QScrollBar *hbar = QGraphicsView::horizontalScrollBar();
QScrollBar *vbar = QGraphicsView::verticalScrollBar();
const QPoint delta = (pos - m_pos).toPoint();
hbar->setValue(hbar->value() - delta.x());
vbar->setValue(vbar->value() - delta.y());
m_pos = pos;
#endif
break;
}
default:
Expand Down Expand Up @@ -1897,6 +1912,12 @@ void qjackctlGraphCanvas::mouseReleaseEvent ( QMouseEvent *event )
break;
}

#if 1//NEW_DRAG_SCROLL_MODE
if (QGraphicsView::dragMode() == ScrollHandDrag) {
QGraphicsView::mouseReleaseEvent(event);
QGraphicsView::setDragMode(NoDrag);
}
#endif
m_state = DragNone;
m_item = nullptr;

Expand Down
8 changes: 4 additions & 4 deletions src/translations/qjackctl_cs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
<context>
<name>qjackctlApplication</name>
<message>
<location filename="../qjackctl.cpp" line="124"/>
<location filename="../qjackctl.cpp" line="127"/>
<source>JACK: %1</source>
<translation>JACK: %1</translation>
</message>
Expand Down Expand Up @@ -479,13 +479,13 @@ Jste si jistý?</translation>
<context>
<name>qjackctlGraphCanvas</name>
<message>
<location filename="../qjackctlGraph.cpp" line="1856"/>
<location filename="../qjackctlGraph.cpp" line="1983"/>
<location filename="../qjackctlGraph.cpp" line="1868"/>
<location filename="../qjackctlGraph.cpp" line="2001"/>
<source>Connect</source>
<translation>Spojit</translation>
</message>
<message>
<location filename="../qjackctlGraph.cpp" line="2055"/>
<location filename="../qjackctlGraph.cpp" line="2073"/>
<source>Disconnect</source>
<translation>Rozpojit</translation>
</message>
Expand Down
8 changes: 4 additions & 4 deletions src/translations/qjackctl_de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
<context>
<name>qjackctlApplication</name>
<message>
<location filename="../qjackctl.cpp" line="124"/>
<location filename="../qjackctl.cpp" line="127"/>
<source>JACK: %1</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -478,13 +478,13 @@ Sind Sie sicher?</translation>
<context>
<name>qjackctlGraphCanvas</name>
<message>
<location filename="../qjackctlGraph.cpp" line="1856"/>
<location filename="../qjackctlGraph.cpp" line="1983"/>
<location filename="../qjackctlGraph.cpp" line="1868"/>
<location filename="../qjackctlGraph.cpp" line="2001"/>
<source>Connect</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qjackctlGraph.cpp" line="2055"/>
<location filename="../qjackctlGraph.cpp" line="2073"/>
<source>Disconnect</source>
<translation type="unfinished"></translation>
</message>
Expand Down
8 changes: 4 additions & 4 deletions src/translations/qjackctl_es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
<context>
<name>qjackctlApplication</name>
<message>
<location filename="../qjackctl.cpp" line="124"/>
<location filename="../qjackctl.cpp" line="127"/>
<source>JACK: %1</source>
<translation>JACK: %1</translation>
</message>
Expand Down Expand Up @@ -478,13 +478,13 @@ Está seguro?</translation>
<context>
<name>qjackctlGraphCanvas</name>
<message>
<location filename="../qjackctlGraph.cpp" line="1856"/>
<location filename="../qjackctlGraph.cpp" line="1983"/>
<location filename="../qjackctlGraph.cpp" line="1868"/>
<location filename="../qjackctlGraph.cpp" line="2001"/>
<source>Connect</source>
<translation>Conectar</translation>
</message>
<message>
<location filename="../qjackctlGraph.cpp" line="2055"/>
<location filename="../qjackctlGraph.cpp" line="2073"/>
<source>Disconnect</source>
<translation>Desconectar</translation>
</message>
Expand Down
8 changes: 4 additions & 4 deletions src/translations/qjackctl_fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
<context>
<name>qjackctlApplication</name>
<message>
<location filename="../qjackctl.cpp" line="124"/>
<location filename="../qjackctl.cpp" line="127"/>
<source>JACK: %1</source>
<translation>JACK : %1</translation>
</message>
Expand Down Expand Up @@ -479,13 +479,13 @@ de toutes les applications clientes.
<context>
<name>qjackctlGraphCanvas</name>
<message>
<location filename="../qjackctlGraph.cpp" line="1856"/>
<location filename="../qjackctlGraph.cpp" line="1983"/>
<location filename="../qjackctlGraph.cpp" line="1868"/>
<location filename="../qjackctlGraph.cpp" line="2001"/>
<source>Connect</source>
<translation>Connecter</translation>
</message>
<message>
<location filename="../qjackctlGraph.cpp" line="2055"/>
<location filename="../qjackctlGraph.cpp" line="2073"/>
<source>Disconnect</source>
<translation>Déconnecter</translation>
</message>
Expand Down
8 changes: 4 additions & 4 deletions src/translations/qjackctl_it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
<context>
<name>qjackctlApplication</name>
<message>
<location filename="../qjackctl.cpp" line="124"/>
<location filename="../qjackctl.cpp" line="127"/>
<source>JACK: %1</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -488,13 +488,13 @@ Sei sicuro?</translation>
<context>
<name>qjackctlGraphCanvas</name>
<message>
<location filename="../qjackctlGraph.cpp" line="1856"/>
<location filename="../qjackctlGraph.cpp" line="1983"/>
<location filename="../qjackctlGraph.cpp" line="1868"/>
<location filename="../qjackctlGraph.cpp" line="2001"/>
<source>Connect</source>
<translation>Connetti</translation>
</message>
<message>
<location filename="../qjackctlGraph.cpp" line="2055"/>
<location filename="../qjackctlGraph.cpp" line="2073"/>
<source>Disconnect</source>
<translation>Disconnetti</translation>
</message>
Expand Down
8 changes: 4 additions & 4 deletions src/translations/qjackctl_ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
<context>
<name>qjackctlApplication</name>
<message>
<location filename="../qjackctl.cpp" line="124"/>
<location filename="../qjackctl.cpp" line="127"/>
<source>JACK: %1</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -479,13 +479,13 @@ Are you sure?</source>
<context>
<name>qjackctlGraphCanvas</name>
<message>
<location filename="../qjackctlGraph.cpp" line="1856"/>
<location filename="../qjackctlGraph.cpp" line="1983"/>
<location filename="../qjackctlGraph.cpp" line="1868"/>
<location filename="../qjackctlGraph.cpp" line="2001"/>
<source>Connect</source>
<translation>接続</translation>
</message>
<message>
<location filename="../qjackctlGraph.cpp" line="2055"/>
<location filename="../qjackctlGraph.cpp" line="2073"/>
<source>Disconnect</source>
<translation>切断</translation>
</message>
Expand Down
8 changes: 4 additions & 4 deletions src/translations/qjackctl_ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
<context>
<name>qjackctlApplication</name>
<message>
<location filename="../qjackctl.cpp" line="124"/>
<location filename="../qjackctl.cpp" line="127"/>
<source>JACK: %1</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -479,13 +479,13 @@ Are you sure?</source>
<context>
<name>qjackctlGraphCanvas</name>
<message>
<location filename="../qjackctlGraph.cpp" line="1856"/>
<location filename="../qjackctlGraph.cpp" line="1983"/>
<location filename="../qjackctlGraph.cpp" line="1868"/>
<location filename="../qjackctlGraph.cpp" line="2001"/>
<source>Connect</source>
<translation>연결하기</translation>
</message>
<message>
<location filename="../qjackctlGraph.cpp" line="2055"/>
<location filename="../qjackctlGraph.cpp" line="2073"/>
<source>Disconnect</source>
<translation>연결해제</translation>
</message>
Expand Down
8 changes: 4 additions & 4 deletions src/translations/qjackctl_nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
<context>
<name>qjackctlApplication</name>
<message>
<location filename="../qjackctl.cpp" line="124"/>
<location filename="../qjackctl.cpp" line="127"/>
<source>JACK: %1</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -488,13 +488,13 @@ Bent u zeker?</translation>
<context>
<name>qjackctlGraphCanvas</name>
<message>
<location filename="../qjackctlGraph.cpp" line="1856"/>
<location filename="../qjackctlGraph.cpp" line="1983"/>
<location filename="../qjackctlGraph.cpp" line="1868"/>
<location filename="../qjackctlGraph.cpp" line="2001"/>
<source>Connect</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qjackctlGraph.cpp" line="2055"/>
<location filename="../qjackctlGraph.cpp" line="2073"/>
<source>Disconnect</source>
<translation type="unfinished"></translation>
</message>
Expand Down
8 changes: 4 additions & 4 deletions src/translations/qjackctl_pt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
<context>
<name>qjackctlApplication</name>
<message>
<location filename="../qjackctl.cpp" line="124"/>
<location filename="../qjackctl.cpp" line="127"/>
<source>JACK: %1</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -479,13 +479,13 @@ Tem certeza?</translation>
<context>
<name>qjackctlGraphCanvas</name>
<message>
<location filename="../qjackctlGraph.cpp" line="1856"/>
<location filename="../qjackctlGraph.cpp" line="1983"/>
<location filename="../qjackctlGraph.cpp" line="1868"/>
<location filename="../qjackctlGraph.cpp" line="2001"/>
<source>Connect</source>
<translation>Conectar</translation>
</message>
<message>
<location filename="../qjackctlGraph.cpp" line="2055"/>
<location filename="../qjackctlGraph.cpp" line="2073"/>
<source>Disconnect</source>
<translation>Disconnectar</translation>
</message>
Expand Down
8 changes: 4 additions & 4 deletions src/translations/qjackctl_ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
<context>
<name>qjackctlApplication</name>
<message>
<location filename="../qjackctl.cpp" line="124"/>
<location filename="../qjackctl.cpp" line="127"/>
<source>JACK: %1</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -480,13 +480,13 @@ Are you sure?</source>
<context>
<name>qjackctlGraphCanvas</name>
<message>
<location filename="../qjackctlGraph.cpp" line="1856"/>
<location filename="../qjackctlGraph.cpp" line="1983"/>
<location filename="../qjackctlGraph.cpp" line="1868"/>
<location filename="../qjackctlGraph.cpp" line="2001"/>
<source>Connect</source>
<translation>Соединить</translation>
</message>
<message>
<location filename="../qjackctlGraph.cpp" line="2055"/>
<location filename="../qjackctlGraph.cpp" line="2073"/>
<source>Disconnect</source>
<translation>Отсоединить</translation>
</message>
Expand Down
8 changes: 4 additions & 4 deletions src/translations/qjackctl_sk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
<context>
<name>qjackctlApplication</name>
<message>
<location filename="../qjackctl.cpp" line="124"/>
<location filename="../qjackctl.cpp" line="127"/>
<source>JACK: %1</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -479,13 +479,13 @@ Ste si istý?</translation>
<context>
<name>qjackctlGraphCanvas</name>
<message>
<location filename="../qjackctlGraph.cpp" line="1856"/>
<location filename="../qjackctlGraph.cpp" line="1983"/>
<location filename="../qjackctlGraph.cpp" line="1868"/>
<location filename="../qjackctlGraph.cpp" line="2001"/>
<source>Connect</source>
<translation>Spojiť</translation>
</message>
<message>
<location filename="../qjackctlGraph.cpp" line="2055"/>
<location filename="../qjackctlGraph.cpp" line="2073"/>
<source>Disconnect</source>
<translation>Rozpojiť</translation>
</message>
Expand Down
8 changes: 4 additions & 4 deletions src/translations/qjackctl_uk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
<context>
<name>qjackctlApplication</name>
<message>
<location filename="../qjackctl.cpp" line="124"/>
<location filename="../qjackctl.cpp" line="127"/>
<source>JACK: %1</source>
<translation>JACK: %1</translation>
</message>
Expand Down Expand Up @@ -478,13 +478,13 @@ Are you sure?</source>
<context>
<name>qjackctlGraphCanvas</name>
<message>
<location filename="../qjackctlGraph.cpp" line="1856"/>
<location filename="../qjackctlGraph.cpp" line="1983"/>
<location filename="../qjackctlGraph.cpp" line="1868"/>
<location filename="../qjackctlGraph.cpp" line="2001"/>
<source>Connect</source>
<translation&apos;єднати</translation>
</message>
<message>
<location filename="../qjackctlGraph.cpp" line="2055"/>
<location filename="../qjackctlGraph.cpp" line="2073"/>
<source>Disconnect</source>
<translation>Від’єднати</translation>
</message>
Expand Down

0 comments on commit 7dfe3a9

Please sign in to comment.