Commit 0db31fb3 authored by Sharaf Zaman's avatar Sharaf Zaman 💬 Committed by Boudewijn Rempt

Add option for disabling touch-rotation

Maniphest: T10784
parent 9bf9cd4a
...@@ -188,6 +188,7 @@ GeneralTab::GeneralTab(QWidget *_parent, const char *_name) ...@@ -188,6 +188,7 @@ GeneralTab::GeneralTab(QWidget *_parent, const char *_name)
cmbFlowMode->setCurrentIndex((int)!cfg.readEntry<bool>("useCreamyAlphaDarken", true)); cmbFlowMode->setCurrentIndex((int)!cfg.readEntry<bool>("useCreamyAlphaDarken", true));
m_chkSwitchSelectionCtrlAlt->setChecked(cfg.switchSelectionCtrlAlt()); m_chkSwitchSelectionCtrlAlt->setChecked(cfg.switchSelectionCtrlAlt());
chkEnableTouch->setChecked(!cfg.disableTouchOnCanvas()); chkEnableTouch->setChecked(!cfg.disableTouchOnCanvas());
chkEnableTouchRotation->setChecked(!cfg.disableTouchRotation());
chkEnableTranformToolAfterPaste->setChecked(cfg.activateTransformToolAfterPaste()); chkEnableTranformToolAfterPaste->setChecked(cfg.activateTransformToolAfterPaste());
m_groupBoxKineticScrollingSettings->setChecked(cfg.kineticScrollingEnabled()); m_groupBoxKineticScrollingSettings->setChecked(cfg.kineticScrollingEnabled());
...@@ -305,6 +306,7 @@ void GeneralTab::setDefault() ...@@ -305,6 +306,7 @@ void GeneralTab::setDefault()
m_chkKineticScrollingHideScrollbars->setChecked(cfg.kineticScrollingHiddenScrollbars(true)); m_chkKineticScrollingHideScrollbars->setChecked(cfg.kineticScrollingHiddenScrollbars(true));
m_chkSwitchSelectionCtrlAlt->setChecked(cfg.switchSelectionCtrlAlt(true)); m_chkSwitchSelectionCtrlAlt->setChecked(cfg.switchSelectionCtrlAlt(true));
chkEnableTouch->setChecked(!cfg.disableTouchOnCanvas(true)); chkEnableTouch->setChecked(!cfg.disableTouchOnCanvas(true));
chkEnableTouchRotation->setChecked(!cfg.disableTouchRotation(true));
chkEnableTranformToolAfterPaste->setChecked(cfg.activateTransformToolAfterPaste(true)); chkEnableTranformToolAfterPaste->setChecked(cfg.activateTransformToolAfterPaste(true));
m_chkConvertOnImport->setChecked(cfg.convertToImageColorspaceOnImport(true)); m_chkConvertOnImport->setChecked(cfg.convertToImageColorspaceOnImport(true));
...@@ -1637,6 +1639,7 @@ bool KisDlgPreferences::editPreferences() ...@@ -1637,6 +1639,7 @@ bool KisDlgPreferences::editPreferences()
cfg.setSwitchSelectionCtrlAlt(dialog->m_general->switchSelectionCtrlAlt()); cfg.setSwitchSelectionCtrlAlt(dialog->m_general->switchSelectionCtrlAlt());
cfg.setDisableTouchOnCanvas(!dialog->m_general->chkEnableTouch->isChecked()); cfg.setDisableTouchOnCanvas(!dialog->m_general->chkEnableTouch->isChecked());
cfg.setDisableTouchRotation(!dialog->m_general->chkEnableTouchRotation->isChecked());
cfg.setActivateTransformToolAfterPaste(dialog->m_general->chkEnableTranformToolAfterPaste->isChecked()); cfg.setActivateTransformToolAfterPaste(dialog->m_general->chkEnableTranformToolAfterPaste->isChecked());
cfg.setConvertToImageColorspaceOnImport(dialog->m_general->convertToImageColorspaceOnImport()); cfg.setConvertToImageColorspaceOnImport(dialog->m_general->convertToImageColorspaceOnImport());
cfg.setUndoStackLimit(dialog->m_general->undoStackSize()); cfg.setUndoStackLimit(dialog->m_general->undoStackSize());
......
...@@ -445,6 +445,13 @@ ...@@ -445,6 +445,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="chkEnableTouchRotation">
<property name="text">
<string>Enable Touch Rotation</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QGroupBox" name="m_groupBoxKineticScrollingSettings"> <widget class="QGroupBox" name="m_groupBoxKineticScrollingSettings">
<property name="title"> <property name="title">
......
...@@ -51,7 +51,7 @@ KisTouchShortcut::~KisTouchShortcut() ...@@ -51,7 +51,7 @@ KisTouchShortcut::~KisTouchShortcut()
int KisTouchShortcut::priority() const int KisTouchShortcut::priority() const
{ {
return d->maxTouchPoints; return action()->priority();
} }
void KisTouchShortcut::setMinimumTouchPoints(int min) void KisTouchShortcut::setMinimumTouchPoints(int min)
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
#include <klocalizedstring.h> #include <klocalizedstring.h>
#include <kis_config.h>
#include "kis_zoom_and_rotate_action.h" #include "kis_zoom_and_rotate_action.h"
#include "kis_zoom_action.h" #include "kis_zoom_action.h"
...@@ -39,7 +40,8 @@ KisZoomAndRotateAction::KisZoomAndRotateAction() ...@@ -39,7 +40,8 @@ KisZoomAndRotateAction::KisZoomAndRotateAction()
int KisZoomAndRotateAction::priority() const int KisZoomAndRotateAction::priority() const
{ {
return 5; // if rotation is disabled, we set the lowest priority, so that, this action isn't triggered
return KisConfig(true).disableTouchRotation() ? 0 : 5;
} }
void KisZoomAndRotateAction::activate(int shortcut) void KisZoomAndRotateAction::activate(int shortcut)
......
...@@ -87,6 +87,16 @@ void KisConfig::setDisableTouchOnCanvas(bool value) const ...@@ -87,6 +87,16 @@ void KisConfig::setDisableTouchOnCanvas(bool value) const
m_cfg.writeEntry("disableTouchOnCanvas", value); m_cfg.writeEntry("disableTouchOnCanvas", value);
} }
bool KisConfig::disableTouchRotation(bool defaultValue) const
{
return (defaultValue ? false : m_cfg.readEntry("disableTouchRotation", false));
}
void KisConfig::setDisableTouchRotation(bool value) const
{
m_cfg.writeEntry("disableTouchRotation", value);
}
bool KisConfig::useProjections(bool defaultValue) const bool KisConfig::useProjections(bool defaultValue) const
{ {
return (defaultValue ? true : m_cfg.readEntry("useProjections", true)); return (defaultValue ? true : m_cfg.readEntry("useProjections", true));
......
...@@ -51,6 +51,9 @@ public: ...@@ -51,6 +51,9 @@ public:
bool disableTouchOnCanvas(bool defaultValue = false) const; bool disableTouchOnCanvas(bool defaultValue = false) const;
void setDisableTouchOnCanvas(bool value) const; void setDisableTouchOnCanvas(bool value) const;
bool disableTouchRotation(bool defaultValue = false) const;
void setDisableTouchRotation(bool value) const;
bool useProjections(bool defaultValue = false) const; bool useProjections(bool defaultValue = false) const;
void setUseProjections(bool useProj) const; void setUseProjections(bool useProj) const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment