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++

fixup: remove setDisableOnTouchPainting

Dmitry Kazakov3053a22924e0
diff --git a/libs/ui/input/kis_input_manager_p.cpp b/libs/ui/input/kis_input_manager_p.cpp
index a299a8616f..0762f6f108 100644
--- a/libs/ui/input/kis_input_manager_p.cpp
+++ b/libs/ui/input/kis_input_manager_p.cpp
@@ -570,12 +570,6 @@ void KisInputManager::Private::addTouchShortcut(KisAbstractInputAction* action,
#ifndef Q_OS_MACOS
case KisShortcutConfiguration::OneFingerTap:
case KisShortcutConfiguration::OneFingerDrag:
- // Touch painting takes precedence over one-finger touch shortcuts, so
- // disable this type of shortcut when touch painting is active. Except
- // touch hold shortcuts, since touching and holding in one spot does
- // nothing otherwise and is therefore unambiguous.
- //shortcut->setDisableOnTouchPainting(true);
- Q_FALLTHROUGH();
case KisShortcutConfiguration::OneFingerHold:
shortcut->setMinimumTouchPoints(1);
shortcut->setMaximumTouchPoints(1);
diff --git a/libs/ui/input/kis_touch_shortcut.cpp b/libs/ui/input/kis_touch_shortcut.cpp
index 2957308daf..b83bff58d9 100644
--- a/libs/ui/input/kis_touch_shortcut.cpp
+++ b/libs/ui/input/kis_touch_shortcut.cpp
@@ -21,7 +21,6 @@ public:
: minTouchPoints(0)
, maxTouchPoints(0)
, type(type)
- , disableOnTouchPainting(false)
, isTouchPainting(false)
, minDragThreshold(16)
{ }
@@ -29,7 +28,6 @@ public:
int minTouchPoints;
int maxTouchPoints;
GestureAction type;
- bool disableOnTouchPainting;
bool isTouchPainting;
qreal minDragThreshold;
};
@@ -80,11 +78,6 @@ void KisTouchShortcut::setMaximumTouchPoints(int max)
d->maxTouchPoints = max;
}
-void KisTouchShortcut::setDisableOnTouchPainting(bool disableOnTouchPainting)
-{
- d->disableOnTouchPainting = disableOnTouchPainting;
-}
-
void KisTouchShortcut::setIsTouchPainting(bool value)
{
d->isTouchPainting = value;
@@ -96,10 +89,6 @@ bool KisTouchShortcut::isAvailable(KisInputActionGroupsMask mask) const
return false;
}
- // if (d->disableOnTouchPainting && !KisConfig(true).disableTouchOnCanvas()) {
- // return false;
- // }
-
return KisAbstractShortcut::isAvailable(mask);
}
@@ -171,6 +160,5 @@ bool KisTouchShortcut::matchTouchPoint(QTouchEvent *event, Qt::TouchPointStates
{
const int numStillActivePoints = countTouchPoints(event, allowedStates);
- return /*(!d->disableOnTouchPainting || KisConfig(true).disableTouchOnCanvas())
- &&*/ numStillActivePoints >= d->minTouchPoints && numStillActivePoints <= d->maxTouchPoints;
+ return numStillActivePoints >= d->minTouchPoints && numStillActivePoints <= d->maxTouchPoints;
}
diff --git a/libs/ui/input/kis_touch_shortcut.h b/libs/ui/input/kis_touch_shortcut.h
index 1f9b114749..04994e39e7 100644
--- a/libs/ui/input/kis_touch_shortcut.h
+++ b/libs/ui/input/kis_touch_shortcut.h
@@ -32,7 +32,6 @@ class KRITAUI_EXPORT KisTouchShortcut : public KisAbstractShortcut
void setMinimumTouchPoints( int min );
void setMaximumTouchPoints( int max );
- void setDisableOnTouchPainting(bool disableOnTouchPainting);
void setIsTouchPainting(bool value);
diff --git a/libs/ui/tests/kis_input_manager_test.cpp b/libs/ui/tests/kis_input_manager_test.cpp
index f41ab26063..4de38cda8b 100644
--- a/libs/ui/tests/kis_input_manager_test.cpp
+++ b/libs/ui/tests/kis_input_manager_test.cpp
@@ -196,12 +196,6 @@ KisTouchShortcut* createTouchShortcut(KisAbstractInputAction *action,
#ifndef Q_OS_MACOS
case KisShortcutConfiguration::OneFingerTap:
case KisShortcutConfiguration::OneFingerDrag:
- // Touch painting takes precedence over one-finger touch shortcuts, so
- // disable this type of shortcut when touch painting is active. Except
- // touch hold shortcuts, since touching and holding in one spot does
- // nothing otherwise and is therefore unambiguous.
- //s->setDisableOnTouchPainting(true);
- Q_FALLTHROUGH();
case KisShortcutConfiguration::OneFingerHold:
s->setMinimumTouchPoints(1);
s->setMaximumTouchPoints(1);