Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Disable left-click scrolling on animation curves

Carsten Hartenfels7007bb990a37
diff --git a/plugins/dockers/animation/KisAnimCurvesView.cpp b/plugins/dockers/animation/KisAnimCurvesView.cpp
index 9f4def34f4..1083da80a7 100644
--- a/plugins/dockers/animation/KisAnimCurvesView.cpp
+++ b/plugins/dockers/animation/KisAnimCurvesView.cpp
@@ -122,15 +122,22 @@ KisAnimCurvesView::KisAnimCurvesView(QWidget *parent)
viewport()->update();
});
- QScroller *scroller = KisKineticScroller::createPreconfiguredScroller(this);
- if (scroller){
- connect(scroller, SIGNAL(stateChanged(QScroller::State)),
- this, SLOT(slotScrollerStateChanged(QScroller::State)));
-
- QScrollerProperties props = scroller->scrollerProperties();
- props.setScrollMetric(QScrollerProperties::VerticalOvershootPolicy, QScrollerProperties::OvershootAlwaysOff);
- props.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, QScrollerProperties::OvershootAlwaysOff);
- scroller->setScrollerProperties(props);
+ // Kinetic scrolling via left-click completely breaks everything, it somehow
+ // ends up reporting left clicks as right clicks and makes the whole curves
+ // view behave erratically with regards to when it wants to scroll and when
+ // you're dragging pints. So we don't enable kinetic scrolling in that case
+ // and require the use of the scrollbar instead, like on the timeline.
+ if (KisKineticScroller::getConfiguredGestureType() != QScroller::LeftMouseButtonGesture) {
+ QScroller *scroller = KisKineticScroller::createPreconfiguredScroller(this);
+ if (scroller){
+ connect(scroller, SIGNAL(stateChanged(QScroller::State)),
+ this, SLOT(slotScrollerStateChanged(QScroller::State)));
+
+ QScrollerProperties props = scroller->scrollerProperties();
+ props.setScrollMetric(QScrollerProperties::VerticalOvershootPolicy, QScrollerProperties::OvershootAlwaysOff);
+ props.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, QScrollerProperties::OvershootAlwaysOff);
+ scroller->setScrollerProperties(props);
+ }
}
}