Skip to content

Commit

Permalink
Added option for transparent background kotelnik#61
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladdrako committed Nov 19, 2022
1 parent 1e039c9 commit 5dc2522
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
3 changes: 3 additions & 0 deletions package/contents/config/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
<entry name="enableLabelDropShadow" type="Bool">
<default>false</default>
</entry>
<entry name="transparentBackground" type="Bool">
<default>false</default>
</entry>
</group>

<group name="Misc">
Expand Down
7 changes: 7 additions & 0 deletions package/contents/ui/config/ConfigAppearance.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -87,6 +88,12 @@ Item {
Layout.columnSpan: 2
text: i18n('Enable label drop shadow')
}

CheckBox {
id: transparentBackground
Layout.columnSpan: 2
text: i18n('Transparent background')
}
}

}
12 changes: 10 additions & 2 deletions package/contents/ui/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: []
Expand All @@ -71,6 +75,10 @@ Item {

property bool debugLogging: false

Plasmoid.preferredRepresentation: Plasmoid.fullRepresentation
Plasmoid.backgroundHints: transparentBackground ? "NoBackground":"StandardBackground";


function dbgprint(msg) {
if (!debugLogging) {
return
Expand Down

0 comments on commit 5dc2522

Please sign in to comment.