diff --git a/containment/package/contents/config/main.xml b/containment/package/contents/config/main.xml index 3826405d5..de1fb9670 100644 --- a/containment/package/contents/config/main.xml +++ b/containment/package/contents/config/main.xml @@ -63,6 +63,10 @@ false + + false + + false diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index fdb941c2c..079f08bad 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -167,11 +167,7 @@ Item { && latteView.windowsTracker.currentScreen.isTouchingBusyVerticalView && plasmoid.configuration.backgroundOnlyOnMaximized) - property bool hideThickScreenGap: screenEdgeMarginEnabled - && plasmoid.configuration.hideFloatingGapForMaximized - && latteView && latteView.windowsTracker - && latteView.windowsTracker.currentScreen.existsWindowMaximized - + property bool hideThickScreenGap: false /*set through binding*/ property bool hideLengthScreenGaps: false /*set through binding*/ property bool mirrorScreenGap: screenEdgeMarginEnabled @@ -400,6 +396,17 @@ Item { //////////////START OF BINDINGS + //! Wait until the mouse leaves the view + Binding { + target: root + property: "hideThickScreenGap" + when: !(plasmoid.configuration.floatingGapHidingWaitsMouse && dockContainsMouse) + value: screenEdgeMarginEnabled + && plasmoid.configuration.hideFloatingGapForMaximized + && latteView && latteView.windowsTracker + && latteView.windowsTracker.currentScreen.existsWindowMaximized + } + //! Binding is needed in order for hideLengthScreenGaps to be activated or not only after //! View sliding in/out has finished. This way the animation is smoother for behaveAsPlasmaPanels Binding{ @@ -408,6 +415,7 @@ Item { when: latteView && latteView.positioner && latteView.visibility && ((root.behaveAsPlasmaPanel && latteView.positioner.slideOffset === 0) || root.behaveAsDockWithMask) + && !(plasmoid.configuration.floatingGapHidingWaitsMouse && dockContainsMouse) value: (hideThickScreenGap && (latteView.visibility.mode === LatteCore.Types.AlwaysVisible || latteView.visibility.mode === LatteCore.Types.WindowsGoBelow) @@ -918,6 +926,14 @@ Item { } } + Behavior on maxLengthPerCentage { + enabled: root.behaveAsDockWithMask && plasmoid.configuration.floatingGapHidingWaitsMouse && dockContainsMouse + NumberAnimation { + duration: animations.duration.short + easing.type: Easing.InQuad + } + } + ///////////////END UI elements ///////////////BEGIN ABILITIES diff --git a/shell/package/contents/configuration/pages/BehaviorConfig.qml b/shell/package/contents/configuration/pages/BehaviorConfig.qml index 01dbf55b9..9afe29df9 100644 --- a/shell/package/contents/configuration/pages/BehaviorConfig.qml +++ b/shell/package/contents/configuration/pages/BehaviorConfig.qml @@ -881,6 +881,18 @@ PlasmaComponents.Page { } } + LatteComponents.CheckBox { + Layout.maximumWidth: dialog.optionsWidth + enabled: plasmoid.configuration.alignment === LatteCore.Types.Justify && plasmoid.configuration.hideFloatingGapForMaximized + text: i18n("Delay floating gap hiding until mouse leaves") + tooltip: i18n("to avoid clicking on adjacent items accidentally in some cases") + value: plasmoid.configuration.floatingGapHidingWaitsMouse + + onClicked: { + plasmoid.configuration.floatingGapHidingWaitsMouse = !plasmoid.configuration.floatingGapHidingWaitsMouse; + } + } + LatteComponents.CheckBox { Layout.maximumWidth: dialog.optionsWidth enabled: latteView.visibility.mode === LatteCore.Types.AlwaysVisible