add option to enable/disable active window dragging

pull/5/head
Michail Vourlakos 6 years ago
parent 243ece638c
commit 86c7e72abf

@ -155,6 +155,10 @@
<entry name="offset" type="Int">
<default>0</default>
</entry>
<entry name="dragActiveWindowEnabled" type="Bool">
<default>false</default>
<label>Drag and maximize/restore active window from empty areas</label>
</entry>
<entry name="leftClickAction" type="Enum">
<choices>
<choice name="None"/>

@ -166,7 +166,7 @@ Item{
onYChanged: root.updateEffectsArea();
EnvironmentActions {
active: true //root.scrollAction !== Latte.Types.ScrollNone // it should have an option to activate/deactivate the dragging active window etc.
active: root.scrollAction !== Latte.Types.ScrollNone || root.dragActiveWindowEnabled
}
Grid{

@ -65,6 +65,10 @@ Loader {
}
onPressed: {
if (!root.dragActiveWindowEnabled) {
return;
}
if (latteView.windowsTracker.activeWindowCanBeDragged()) {
lastPressX = mouse.x;
lastPressY = mouse.y;
@ -78,6 +82,10 @@ Loader {
}
onPositionChanged: {
if (!root.dragActiveWindowEnabled) {
return;
}
var stepX = Math.abs(lastPressX-mouse.x);
var stepY = Math.abs(lastPressY-mouse.y);
var threshold = 5;
@ -91,6 +99,10 @@ Loader {
}
onDoubleClicked: {
if (!root.dragActiveWindowEnabled) {
return;
}
dragWindowTimer.stop();
restoreGrabberTimer.stop();
latteView.windowsTracker.requestToggleMaximizeForActiveWindow();

@ -151,6 +151,7 @@ DragDrop.DropArea {
readonly property bool parabolicEffectEnabled: zoomFactor>1 && !inConfigureAppletsMode
property bool dockIsShownCompletely: !(dockIsHidden || inSlidingIn || inSlidingOut) && !root.editMode
property bool dragActiveWindowEnabled: plasmoid.configuration.dragActiveWindowEnabled
property bool immutable: plasmoid.immutable
property bool inFullJustify: (plasmoid.configuration.panelPosition === Latte.Types.Justify) && (plasmoid.configuration.maxLength===100)
property bool inSlidingIn: visibilityManager ? visibilityManager.inSlidingIn : false

@ -530,40 +530,53 @@ PlasmaComponents.Page {
text: i18n("Empty Area")
}
RowLayout {
Layout.topMargin: units.smallSpacing
ColumnLayout {
RowLayout {
Layout.topMargin: units.smallSpacing
PlasmaComponents.Label {
text: i18n("Mouse wheel")
}
PlasmaComponents.Label {
text: i18n("Mouse wheel")
}
LatteComponents.ComboBox {
id: scrollAction
Layout.fillWidth: true
model: [i18nc("none scroll actions", "None Action"),
i18n("Cycle Through Desktops"),
i18n("Cycle Through Activities"),
i18n("Cycle Through Tasks")]
currentIndex: plasmoid.configuration.scrollAction
onCurrentIndexChanged: {
switch(currentIndex) {
case Latte.Types.ScrollNone:
plasmoid.configuration.scrollAction = Latte.Types.ScrollNone;
break;
case Latte.Types.ScrollDesktops:
plasmoid.configuration.scrollAction = Latte.Types.ScrollDesktops;
break;
case Latte.Types.ScrollActivities:
plasmoid.configuration.scrollAction = Latte.Types.ScrollActivities;
break;
case Latte.Types.ScrollTasks:
plasmoid.configuration.scrollAction = Latte.Types.ScrollTasks;
break;
LatteComponents.ComboBox {
id: scrollAction
Layout.fillWidth: true
model: [i18nc("none scroll actions", "None Action"),
i18n("Cycle Through Desktops"),
i18n("Cycle Through Activities"),
i18n("Cycle Through Tasks")]
currentIndex: plasmoid.configuration.scrollAction
onCurrentIndexChanged: {
switch(currentIndex) {
case Latte.Types.ScrollNone:
plasmoid.configuration.scrollAction = Latte.Types.ScrollNone;
break;
case Latte.Types.ScrollDesktops:
plasmoid.configuration.scrollAction = Latte.Types.ScrollDesktops;
break;
case Latte.Types.ScrollActivities:
plasmoid.configuration.scrollAction = Latte.Types.ScrollActivities;
break;
case Latte.Types.ScrollTasks:
plasmoid.configuration.scrollAction = Latte.Types.ScrollTasks;
break;
}
}
}
}
PlasmaComponents.CheckBox {
text: i18n("Drag and maximize/restore active window")
checked: plasmoid.configuration.dragActiveWindowEnabled
tooltip: i18n("Drag/Maximize/Restore active window with double-click and dragging actions")
visible: dialog.highLevel
onClicked: {
plasmoid.configuration.dragActiveWindowEnabled = !plasmoid.configuration.dragActiveWindowEnabled;
}
}
}
LatteComponents.SubHeader {
@ -622,7 +635,6 @@ PlasmaComponents.Page {
text: i18n("Environment")
}
LatteComponents.CheckBoxesColumn {
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2

@ -80,6 +80,10 @@ Grid {
plasmoid.configuration.activeIndicator = Latte.Types.InternalsIndicator;
//plasmoid.configuration.autoDecreaseIconSize = true;
//! Empty Areas
plasmoid.configuration.dragActiveWindowEnabled = false;
plasmoid.configuration.scrollAction = Latte.Types.ScrollNone;
//! Animations
plasmoid.configuration.animationLauncherBouncing = true;
plasmoid.configuration.animationWindowInAttention = true;
@ -119,6 +123,9 @@ Grid {
plasmoid.configuration.activeIndicator = Latte.Types.NoneIndicator;
//plasmoid.configuration.autoDecreaseIconSize = false;
//! Empty Areas
plasmoid.configuration.dragActiveWindowEnabled = true;
//! Animations
plasmoid.configuration.animationLauncherBouncing = false;
plasmoid.configuration.animationWindowInAttention = false;

Loading…
Cancel
Save