From ddb7dfdf5eca04addfe1b1a473e7c3b4b4439d10 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 21 Feb 2021 12:26:16 +0200 Subject: [PATCH] use bool for floatingInternalGapIsForced --do not use CheckBox three states in order to make things simpler for the user --- containment/package/contents/config/main.xml | 6 +++--- containment/package/contents/ui/main.qml | 12 +----------- .../contents/configuration/pages/BehaviorConfig.qml | 5 ++--- shell/package/contents/controls/TypeSelection.qml | 4 ++-- shell/package/contents/templates/Panel.view.latte | 1 + 5 files changed, 9 insertions(+), 19 deletions(-) diff --git a/containment/package/contents/config/main.xml b/containment/package/contents/config/main.xml index 24320ef30..3826405d5 100644 --- a/containment/package/contents/config/main.xml +++ b/containment/package/contents/config/main.xml @@ -55,9 +55,9 @@ 0 - - 1 - + + true + false diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index 41ded0dcd..334f3d94f 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -131,17 +131,7 @@ Item { || latteView.windowsTracker.currentScreen.activeWindowTouchingEdge || hasExpandedApplet) - property bool floatingInternalGapIsForced: { - if (plasmoid.configuration.floatingInternalGapIsForced === Qt.UnChecked) { - return false; - } else if (plasmoid.configuration.floatingInternalGapIsForced === Qt.Checked) { - return true; - } else if (plasmoid.configuration.floatingInternalGapIsForced === Qt.PartiallyChecked /*Auto*/) { - return viewTypeInQuestion === LatteCore.Types.PanelView ? false : true; - } - - return true; - } + property bool floatingInternalGapIsForced: plasmoid.configuration.floatingInternalGapIsForced property bool forceSolidPanel: (latteView && latteView.visibility && LatteCore.WindowSystem.compositingActive diff --git a/shell/package/contents/configuration/pages/BehaviorConfig.qml b/shell/package/contents/configuration/pages/BehaviorConfig.qml index 5de789e49..6c79bceae 100644 --- a/shell/package/contents/configuration/pages/BehaviorConfig.qml +++ b/shell/package/contents/configuration/pages/BehaviorConfig.qml @@ -861,12 +861,11 @@ PlasmaComponents.Page { LatteComponents.CheckBox { Layout.maximumWidth: dialog.optionsWidth text: i18n("Always use floating gap for user interaction") - tooltip: i18n("Floating gap is always used from applets and any relevant user interaction when \nthat option is enabled. Default option is auto selecting that behavior.") - partiallyCheckedEnabled: true + tooltip: i18n("Floating gap is always used for applets and window interaction") value: plasmoid.configuration.floatingInternalGapIsForced onClicked: { - plasmoid.configuration.floatingInternalGapIsForced = checkedState; + plasmoid.configuration.floatingInternalGapIsForced = !plasmoid.configuration.floatingInternalGapIsForced; } } diff --git a/shell/package/contents/controls/TypeSelection.qml b/shell/package/contents/controls/TypeSelection.qml index 3987b3430..3062c715d 100644 --- a/shell/package/contents/controls/TypeSelection.qml +++ b/shell/package/contents/controls/TypeSelection.qml @@ -98,7 +98,7 @@ Grid { plasmoid.configuration.plasmaBackgroundForPopups = false; //! Floating - plasmoid.configuration.floatingInternalGapIsForced = Qt.PartiallyChecked; + plasmoid.configuration.floatingInternalGapIsForced = true; } } } @@ -143,7 +143,7 @@ Grid { plasmoid.configuration.plasmaBackgroundForPopups = true; //! Floating - plasmoid.configuration.floatingInternalGapIsForced = Qt.PartiallyChecked; + plasmoid.configuration.floatingInternalGapIsForced = false; //! Custom Background that overrides Plasma Theme metrics plasmoid.configuration.backgroundRadius = -1; diff --git a/shell/package/contents/templates/Panel.view.latte b/shell/package/contents/templates/Panel.view.latte index 08883e21b..4a7d59703 100644 --- a/shell/package/contents/templates/Panel.view.latte +++ b/shell/package/contents/templates/Panel.view.latte @@ -3,6 +3,7 @@ activityId= byPassWM=false dockWindowBehavior=true enableKWinEdges=true +floatingInternalGapIsForced=false formfactor=2 immutability=1 isPreferredForShortcuts=false