Gui: Gesture: add option to disable tilt

On Qt5, using pinch will inevitably cause tilt. It's annoying, so it is disabled by default.

In the future, it's best to introduce some kind of threshold to overcome for the tilt to be triggered.
This commit is contained in:
DeepSOIC
2018-11-27 14:33:47 +03:00
committed by Yorik van Havre
parent 8ba6df2548
commit 47ae980fa2
6 changed files with 74 additions and 18 deletions

View File

@@ -42,6 +42,8 @@
#include <qgesture.h>
#include <Base/Exception.h>
#include <App/Application.h>
#include <Base/Parameter.h>
QT_BEGIN_NAMESPACE
@@ -257,8 +259,16 @@ void WinNativeGestureRecognizerPinch::TuneWindowsGestures(QWidget* target)
cfgs[0].dwID = GID_PAN;
cfgs[0].dwWant = GC_PAN;
cfgs[0].dwBlock = GC_PAN_WITH_GUTTER;//disables stickiness to pure vertical/pure horizontal pans
cfgs[1].dwID = GID_ROTATE;
cfgs[1].dwWant = GC_ROTATE;
bool enableGestureTilt = !(App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/View")->GetBool("DisableTouchTilt",true));
if(enableGestureTilt){
cfgs[1].dwID = GID_ROTATE;
cfgs[1].dwWant = GC_ROTATE;
} else {
cfgs[1].dwID = GID_ROTATE;
cfgs[1].dwBlock = GC_ROTATE;
}
//set the options
bool ret = dllSetGestureConfig(w, 0, nCfg, cfgs, sizeof(GESTURECONFIG));