Improve 2d view navigation

- Get rid of lag when two-finger-swiping
- Enable one finger swipe and scroll gestures for the magic mouse
- Fixed a bug where the toolbar zoom slider from the transition.-
and timeline editor where not updated when zooming with a gesture.
- When scrolling the curve editor, its toolbar was scrolling together
with the rest of the view. This is now fixed in order to be
consistent with the timeline view and transition editor.

Change-Id: I611015af134976588fbcada0bc5ccfdcf8039c27
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Knud Dollereder
2021-10-25 14:48:07 +02:00
parent 73405cc089
commit 6d32550459
15 changed files with 111 additions and 341 deletions

View File

@@ -32,6 +32,7 @@
#include <QDoubleSpinBox>
#include <QHBoxLayout>
#include <QLabel>
#include <QScrollArea>
#include <QSplitter>
#include <QVBoxLayout>
@@ -40,16 +41,20 @@ namespace QmlDesigner {
CurveEditor::CurveEditor(CurveEditorModel *model, QWidget *parent)
: QWidget(parent)
, m_tree(new TreeView(model, this))
, m_view(new GraphicsView(model))
, m_view(new GraphicsView(model, this))
{
auto *splitter = new QSplitter;
splitter->addWidget(m_tree);
splitter->addWidget(m_view);
splitter->setStretchFactor(1, 2);
QScrollArea* area = new QScrollArea;
area->setWidget(splitter);
area->setWidgetResizable(true);
auto *box = new QVBoxLayout;
box->addWidget(createToolBar(model));
box->addWidget(splitter);
box->addWidget(area);
setLayout(box);
connect(m_tree, &TreeView::treeItemLocked, model, &CurveEditorModel::setLocked);