From 5dc2522af5ad59082c347a216d6959d067aabde6 Mon Sep 17 00:00:00 2001 From: Vladyslav Andreichykov Date: Sat, 19 Nov 2022 11:03:27 +0200 Subject: [PATCH] Added option for transparent background #61 --- package/contents/config/main.xml | 3 +++ package/contents/ui/config/ConfigAppearance.qml | 7 +++++++ package/contents/ui/main.qml | 12 ++++++++++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/package/contents/config/main.xml b/package/contents/config/main.xml index a940c99..474ed2c 100644 --- a/package/contents/config/main.xml +++ b/package/contents/config/main.xml @@ -36,6 +36,9 @@ false + + false + diff --git a/package/contents/ui/config/ConfigAppearance.qml b/package/contents/ui/config/ConfigAppearance.qml index 45be00a..d8920b5 100644 --- a/package/contents/ui/config/ConfigAppearance.qml +++ b/package/contents/ui/config/ConfigAppearance.qml @@ -10,6 +10,7 @@ Item { property alias cfg_temperatureRightMargin: temperatureRightMargin.value property alias cfg_iconBottomMargin: iconBottomMargin.value property alias cfg_enableLabelDropShadow: enableLabelDropShadow.checked + property alias cfg_transparentBackground: transparentBackground.checked GridLayout { columns: 2 @@ -87,6 +88,12 @@ Item { Layout.columnSpan: 2 text: i18n('Enable label drop shadow') } + + CheckBox { + id: transparentBackground + Layout.columnSpan: 2 + text: i18n('Transparent background') + } } } diff --git a/package/contents/ui/main.qml b/package/contents/ui/main.qml index 3c362f1..1f6aaf0 100644 --- a/package/contents/ui/main.qml +++ b/package/contents/ui/main.qml @@ -32,7 +32,11 @@ Item { property bool initialized: false + // configuration + + + property int temperatureUnit: plasmoid.configuration.temperatureUnit property string configuredResources: plasmoid.configuration.resources property int baseWarningTemperature: plasmoid.configuration.warningTemperature @@ -46,14 +50,14 @@ Item { property color warningColor: Qt.tint(theme.textColor, '#60FF0000') property var textFontFamily: theme.defaultFont.family - Plasmoid.preferredRepresentation: Plasmoid.fullRepresentation - property double aliasFontSize: itemHeight * plasmoid.configuration.aliasFontSize * 0.01 property double temperatureFontSize: itemHeight * plasmoid.configuration.temperatureFontSize * 0.01 property double iconFontSize: itemHeight * plasmoid.configuration.iconFontSize * 0.01 property double temperatureRightMargin: itemHeight * plasmoid.configuration.temperatureRightMargin * 0.01 property double iconBottomMargin: itemHeight * plasmoid.configuration.iconBottomMargin * 0.01 + property bool enableLabelDropShadow: plasmoid.configuration.enableLabelDropShadow + property bool transparentBackground: plasmoid.configuration.transparentBackground property var systemmonitorAvailableSources: [] property var systemmonitorSourcesToAdd: [] @@ -71,6 +75,10 @@ Item { property bool debugLogging: false + Plasmoid.preferredRepresentation: Plasmoid.fullRepresentation + Plasmoid.backgroundHints: transparentBackground ? "NoBackground":"StandardBackground"; + + function dbgprint(msg) { if (!debugLogging) { return