From 5d62df25b98dd3f4aee255265ddd529164326a14 Mon Sep 17 00:00:00 2001 From: Belka Date: Sat, 25 Jun 2022 01:54:29 +0100 Subject: [PATCH 1/5] Add an option to fill the widget in panels --- package/contents/ui/config/ConfigGeneral.qml | 5 +++++ package/contents/ui/main.qml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/package/contents/ui/config/ConfigGeneral.qml b/package/contents/ui/config/ConfigGeneral.qml index edd13ddc..35415ef1 100644 --- a/package/contents/ui/config/ConfigGeneral.qml +++ b/package/contents/ui/config/ConfigGeneral.qml @@ -337,6 +337,11 @@ ConfigPage { Layout.fillWidth: true text: i18n("Desktop Widget: Show background") } + ConfigCheckBox { + configKey: 'fillPanel' + Layout.fillWidth: true + text: i18n("Fill the widget in the panel") + } } HeaderText { diff --git a/package/contents/ui/main.qml b/package/contents/ui/main.qml index de4ea25e..e1d6c1fb 100644 --- a/package/contents/ui/main.qml +++ b/package/contents/ui/main.qml @@ -194,7 +194,7 @@ Item { Plasmoid.backgroundHints: plasmoid.configuration.showBackground ? PlasmaCore.Types.DefaultBackground : PlasmaCore.Types.NoBackground property bool isDesktopContainment: plasmoid.location == PlasmaCore.Types.Floating - Plasmoid.preferredRepresentation: isDesktopContainment ? Plasmoid.fullRepresentation : Plasmoid.compactRepresentation + Plasmoid.preferredRepresentation: plasmoid.configuration.fillPanel ? Plasmoid.fullRepresentation : Plasmoid.compactRepresentation Plasmoid.compactRepresentation: clockComponent Plasmoid.fullRepresentation: popupComponent From e8dedc30241fb5a1d6b2e52fe17fa32de145c486 Mon Sep 17 00:00:00 2001 From: Belka Date: Sat, 25 Jun 2022 02:02:04 +0100 Subject: [PATCH 2/5] Hide pin button when the widget fills a panel --- package/contents/ui/main.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/contents/ui/main.qml b/package/contents/ui/main.qml index e1d6c1fb..1548ba23 100644 --- a/package/contents/ui/main.qml +++ b/package/contents/ui/main.qml @@ -129,7 +129,7 @@ Item { // * the timer widget is enabled since there's room in the top right property bool isPinVisible: { // plasmoid.location == PlasmaCore.Types.Floating when using plasmawindowed and when used as a desktop widget. - return plasmoid.location != PlasmaCore.Types.Floating // && plasmoid.configuration.widget_show_pin + return plasmoid.location != PlasmaCore.Types.Floating && !plasmoid.configuration.fillPanel // && plasmoid.configuration.widget_show_pin } padding: { if (isPinVisible && !(plasmoid.configuration.widgetShowTimer || plasmoid.configuration.widgetShowMeteogram)) { From fe255f78c71a2ddb605a3ef3e08dd5e233b5a7de Mon Sep 17 00:00:00 2001 From: Belka Date: Fri, 1 Jul 2022 17:08:08 +0100 Subject: [PATCH 3/5] - Add persistence to the setting - Change setting name and description (Can be applied to desktop view) - Add experimental flag to description (Can be clunky depending on the panel/widget height & size) --- package/contents/config/main.xml | 3 +++ package/contents/ui/config/ConfigGeneral.qml | 4 ++-- package/contents/ui/main.qml | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/package/contents/config/main.xml b/package/contents/config/main.xml index 0d33bc78..e6cc89bc 100644 --- a/package/contents/config/main.xml +++ b/package/contents/config/main.xml @@ -72,6 +72,9 @@ true + + false + 100 diff --git a/package/contents/ui/config/ConfigGeneral.qml b/package/contents/ui/config/ConfigGeneral.qml index 35415ef1..c8515adc 100644 --- a/package/contents/ui/config/ConfigGeneral.qml +++ b/package/contents/ui/config/ConfigGeneral.qml @@ -338,9 +338,9 @@ ConfigPage { text: i18n("Desktop Widget: Show background") } ConfigCheckBox { - configKey: 'fillPanel' + configKey: 'forceExpanded' Layout.fillWidth: true - text: i18n("Fill the widget in the panel") + text: i18n("Always keep expanded (Experimental)") } } diff --git a/package/contents/ui/main.qml b/package/contents/ui/main.qml index 1548ba23..923272f6 100644 --- a/package/contents/ui/main.qml +++ b/package/contents/ui/main.qml @@ -129,7 +129,7 @@ Item { // * the timer widget is enabled since there's room in the top right property bool isPinVisible: { // plasmoid.location == PlasmaCore.Types.Floating when using plasmawindowed and when used as a desktop widget. - return plasmoid.location != PlasmaCore.Types.Floating && !plasmoid.configuration.fillPanel // && plasmoid.configuration.widget_show_pin + return plasmoid.location != PlasmaCore.Types.Floating && !plasmoid.configuration.forceExpanded // && plasmoid.configuration.widget_show_pin } padding: { if (isPinVisible && !(plasmoid.configuration.widgetShowTimer || plasmoid.configuration.widgetShowMeteogram)) { @@ -194,7 +194,7 @@ Item { Plasmoid.backgroundHints: plasmoid.configuration.showBackground ? PlasmaCore.Types.DefaultBackground : PlasmaCore.Types.NoBackground property bool isDesktopContainment: plasmoid.location == PlasmaCore.Types.Floating - Plasmoid.preferredRepresentation: plasmoid.configuration.fillPanel ? Plasmoid.fullRepresentation : Plasmoid.compactRepresentation + Plasmoid.preferredRepresentation: plasmoid.configuration.forceExpanded ? Plasmoid.fullRepresentation : Plasmoid.compactRepresentation Plasmoid.compactRepresentation: clockComponent Plasmoid.fullRepresentation: popupComponent From 65c9c028bb3dc2b20eaeb2c384ab9bf89f0fa7f7 Mon Sep 17 00:00:00 2001 From: Belka Date: Mon, 4 Jul 2022 22:38:59 +0100 Subject: [PATCH 4/5] Add an option to fill the widget in panels --- package/contents/ui/config/ConfigGeneral.qml | 2 +- package/contents/ui/main.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/contents/ui/config/ConfigGeneral.qml b/package/contents/ui/config/ConfigGeneral.qml index c8515adc..1e152577 100644 --- a/package/contents/ui/config/ConfigGeneral.qml +++ b/package/contents/ui/config/ConfigGeneral.qml @@ -340,7 +340,7 @@ ConfigPage { ConfigCheckBox { configKey: 'forceExpanded' Layout.fillWidth: true - text: i18n("Always keep expanded (Experimental)") + text: i18n("Always keep expanded (panels)") } } diff --git a/package/contents/ui/main.qml b/package/contents/ui/main.qml index 923272f6..8074a9f0 100644 --- a/package/contents/ui/main.qml +++ b/package/contents/ui/main.qml @@ -194,7 +194,7 @@ Item { Plasmoid.backgroundHints: plasmoid.configuration.showBackground ? PlasmaCore.Types.DefaultBackground : PlasmaCore.Types.NoBackground property bool isDesktopContainment: plasmoid.location == PlasmaCore.Types.Floating - Plasmoid.preferredRepresentation: plasmoid.configuration.forceExpanded ? Plasmoid.fullRepresentation : Plasmoid.compactRepresentation + Plasmoid.preferredRepresentation: isDesktopContainment ? Plasmoid.fullRepresentation : plasmoid.configuration.forceExpanded ? Plasmoid.fullRepresentation : Plasmoid.compactRepresentation Plasmoid.compactRepresentation: clockComponent Plasmoid.fullRepresentation: popupComponent From 5756cc57ed41c61f9ee707a7564a8a9217fbb871 Mon Sep 17 00:00:00 2001 From: Belka Date: Mon, 4 Jul 2022 22:43:31 +0100 Subject: [PATCH 5/5] Lint changes --- package/contents/ui/main.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/contents/ui/main.qml b/package/contents/ui/main.qml index 8074a9f0..a15b9064 100644 --- a/package/contents/ui/main.qml +++ b/package/contents/ui/main.qml @@ -194,7 +194,8 @@ Item { Plasmoid.backgroundHints: plasmoid.configuration.showBackground ? PlasmaCore.Types.DefaultBackground : PlasmaCore.Types.NoBackground property bool isDesktopContainment: plasmoid.location == PlasmaCore.Types.Floating - Plasmoid.preferredRepresentation: isDesktopContainment ? Plasmoid.fullRepresentation : plasmoid.configuration.forceExpanded ? Plasmoid.fullRepresentation : Plasmoid.compactRepresentation + Plasmoid.preferredRepresentation: isDesktopContainment ? Plasmoid.fullRepresentation : + plasmoid.configuration.forceExpanded ? Plasmoid.fullRepresentation : Plasmoid.compactRepresentation Plasmoid.compactRepresentation: clockComponent Plasmoid.fullRepresentation: popupComponent