diff --git a/containment/package/contents/ui/abilities/Indicators.qml b/containment/package/contents/ui/abilities/Indicators.qml index ff72ed987..51ee6fde9 100644 --- a/containment/package/contents/ui/abilities/Indicators.qml +++ b/containment/package/contents/ui/abilities/Indicators.qml @@ -82,6 +82,14 @@ Ability.IndicatorsPrivate { return -1; } + backgroundCornerMargin: { + if (indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("backgroundCornerMargin")) { + return indicatorLevel.item.backgroundCornerMargin; + } + + return 1.00; + } + svgPaths: indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("svgImagePaths") ? indicatorLevel.item.svgImagePaths : [] } diff --git a/containment/package/contents/ui/background/MultiLayered.qml b/containment/package/contents/ui/background/MultiLayered.qml index 45bc2dff7..2d041be62 100644 --- a/containment/package/contents/ui/background/MultiLayered.qml +++ b/containment/package/contents/ui/background/MultiLayered.qml @@ -60,7 +60,7 @@ BackgroundProperties{ if (root.isVertical) { var expected = customRadiusIsEnabled ? customAppliedRadius : Math.max(themePadding, solidBackgroundPadding); expected = Math.max(0, expected - metrics.margin.length); //! remove from roundness padding the applied margins - return expected; + return expected * indicators.info.backgroundCornerMargin; } else { return Math.max(themePadding, solidBackgroundPadding); } @@ -77,7 +77,7 @@ BackgroundProperties{ if (root.isVertical) { var expected = customRadiusIsEnabled ? customAppliedRadius : Math.max(themePadding, solidBackgroundPadding); expected = Math.max(0, expected - metrics.margin.length); //! remove from roundness padding the applied margins - return expected; + return expected * indicators.info.backgroundCornerMargin; } else { return Math.max(themePadding, solidBackgroundPadding); } @@ -95,7 +95,7 @@ BackgroundProperties{ if (root.isHorizontal) { var expected = customRadiusIsEnabled ? customAppliedRadius : Math.max(themePadding, solidBackgroundPadding); expected = Math.max(0, expected - metrics.margin.length); //! remove from roundness padding the applied margins - return expected; + return expected * indicators.info.backgroundCornerMargin; } else { return Math.max(themePadding, solidBackgroundPadding); } @@ -113,7 +113,7 @@ BackgroundProperties{ if (root.isHorizontal) { var expected = customRadiusIsEnabled ? customAppliedRadius : Math.max(themePadding, solidBackgroundPadding); expected = Math.max(0, expected - metrics.margin.length); //! remove from roundness padding the applied margins - return expected; + return expected * indicators.info.backgroundCornerMargin; } else { return Math.max(themePadding, solidBackgroundPadding); } diff --git a/declarativeimports/abilities/client/Indicators.qml b/declarativeimports/abilities/client/Indicators.qml index 34fd74f40..012839a52 100644 --- a/declarativeimports/abilities/client/Indicators.qml +++ b/declarativeimports/abilities/client/Indicators.qml @@ -34,6 +34,7 @@ AbilityDefinition.Indicators { info.providesHoveredAnimation: false info.providesClickedAnimation: false info.extraMaskThickness: 0 + info.backgroundCornerMargin: 1.00 info.lengthPadding: 0.08 info.minThicknessPadding: 0 info.minLengthPadding:0 diff --git a/declarativeimports/abilities/definition/Indicators.qml b/declarativeimports/abilities/definition/Indicators.qml index 22976abb2..79d487c02 100644 --- a/declarativeimports/abilities/definition/Indicators.qml +++ b/declarativeimports/abilities/definition/Indicators.qml @@ -33,6 +33,7 @@ Item{ minThicknessPadding: 0 minLengthPadding: 0 + backgroundCornerMargin: 1.00 lengthPadding: 0.08 appletLengthPadding: -1 diff --git a/declarativeimports/abilities/definition/indicators/IndicatorInfo.qml b/declarativeimports/abilities/definition/indicators/IndicatorInfo.qml index 7b2b0d714..1d528b3d3 100644 --- a/declarativeimports/abilities/definition/indicators/IndicatorInfo.qml +++ b/declarativeimports/abilities/definition/indicators/IndicatorInfo.qml @@ -21,6 +21,7 @@ Item{ property real lengthPadding: 0.08 property real appletLengthPadding: -1 + property real backgroundCornerMargin: 1.00 property variant svgPaths: [] } diff --git a/declarativeimports/components/IndicatorItem.qml b/declarativeimports/components/IndicatorItem.qml index 0d2fcf8c9..92ae02eb0 100644 --- a/declarativeimports/components/IndicatorItem.qml +++ b/declarativeimports/components/IndicatorItem.qml @@ -64,6 +64,12 @@ Item { //! [since v0.10.0] property real lengthPadding: 0.08 + //! this indicator specifies how far would like to be from panel background edge + //! it is totally panel background roundness related. By altering that value, indicators + //! can get inside panel background big roundnesses. This value is a percentage, + //! e.g 0.06 -> 6% + //! [since v0.10.3] + property real backgroundCornerMargin: 1.00 //! svg image paths either from plasma theme or local files relevant to indicator "ui" directory //! in order to reduce resources usage diff --git a/indicators/default/package/config/config.qml b/indicators/default/package/config/config.qml index 7a6d1d96c..9100e54b5 100644 --- a/indicators/default/package/config/config.qml +++ b/indicators/default/package/config/config.qml @@ -109,6 +109,42 @@ ColumnLayout { } } + RowLayout { + Layout.fillWidth: true + spacing: units.smallSpacing + + PlasmaComponents.Label { + text: i18n("Position") + horizontalAlignment: Text.AlignLeft + } + + LatteComponents.Slider { + id: thickMarginSlider + Layout.fillWidth: true + + value: Math.round(indicator.configuration.thickMargin * 100) + from: 0 + to: 30 + stepSize: 1 + wheelEnabled: false + + onPressedChanged: { + if (!pressed) { + indicator.configuration.thickMargin = value / 100; + } + } + } + + PlasmaComponents.Label { + text: i18nc("number in percentage, e.g. 85 %","%1 %", currentValue) + horizontalAlignment: Text.AlignRight + Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4 + Layout.maximumWidth: theme.mSize(theme.defaultFont).width * 4 + + readonly property int currentValue: thickMarginSlider.value + } + } + RowLayout { Layout.fillWidth: true spacing: units.smallSpacing @@ -152,23 +188,23 @@ ColumnLayout { spacing: units.smallSpacing PlasmaComponents.Label { - text: i18n("Position") + text: i18n("Corner Margin") horizontalAlignment: Text.AlignLeft } LatteComponents.Slider { - id: thickMarginSlider + id: backgroundCornerMarginSlider Layout.fillWidth: true - value: Math.round(indicator.configuration.thickMargin * 100) + value: Math.round(indicator.configuration.backgroundCornerMargin * 100) from: 0 - to: 30 - stepSize: 1 + to: 100 + stepSize: 2 wheelEnabled: false onPressedChanged: { if (!pressed) { - indicator.configuration.thickMargin = value / 100; + indicator.configuration.backgroundCornerMargin = value / 100; } } } @@ -179,11 +215,10 @@ ColumnLayout { Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4 Layout.maximumWidth: theme.mSize(theme.defaultFont).width * 4 - readonly property int currentValue: thickMarginSlider.value + readonly property int currentValue: backgroundCornerMarginSlider.value } } - LatteComponents.HeaderSwitch { id: glowEnabled Layout.fillWidth: true diff --git a/indicators/default/package/config/main.xml b/indicators/default/package/config/main.xml index 2790c6bad..b41b792fa 100644 --- a/indicators/default/package/config/main.xml +++ b/indicators/default/package/config/main.xml @@ -49,6 +49,9 @@ 0.0 + + 1.00 + false diff --git a/indicators/default/package/ui/main.qml b/indicators/default/package/ui/main.qml index be9a856ae..46ca706f3 100644 --- a/indicators/default/package/ui/main.qml +++ b/indicators/default/package/ui/main.qml @@ -20,6 +20,7 @@ LatteComponents.IndicatorItem{ enabledForApplets: indicator && indicator.configuration ? indicator.configuration.enabledForApplets : true lengthPadding: indicator && indicator.configuration ? indicator.configuration.lengthPadding : 0.08 + backgroundCornerMargin: indicator && indicator.configuration ? indicator.configuration.backgroundCornerMargin : 1.00 readonly property real factor: indicator.configuration.size readonly property int size: factor * indicator.currentIconSize diff --git a/indicators/org.kde.latte.plasma/package/config/config.qml b/indicators/org.kde.latte.plasma/package/config/config.qml index c0c6d5eb2..6f9e8fbef 100644 --- a/indicators/org.kde.latte.plasma/package/config/config.qml +++ b/indicators/org.kde.latte.plasma/package/config/config.qml @@ -18,7 +18,7 @@ ColumnLayout { Layout.fillWidth: true LatteComponents.SubHeader { - text: i18n("Padding") + text: i18n("Style") } RowLayout { @@ -26,7 +26,7 @@ ColumnLayout { spacing: units.smallSpacing PlasmaComponents.Label { - text: i18n("Length") + text: i18n("Padding") horizontalAlignment: Text.AlignLeft } @@ -59,6 +59,42 @@ ColumnLayout { } } + RowLayout { + Layout.fillWidth: true + spacing: units.smallSpacing + + PlasmaComponents.Label { + text: i18n("Corner Margin") + horizontalAlignment: Text.AlignLeft + } + + LatteComponents.Slider { + id: backgroundCornerMarginSlider + Layout.fillWidth: true + + value: Math.round(indicator.configuration.backgroundCornerMargin * 100) + from: 0 + to: 100 + stepSize: 1 + wheelEnabled: false + + onPressedChanged: { + if (!pressed) { + indicator.configuration.backgroundCornerMargin = value / 100; + } + } + } + + PlasmaComponents.Label { + text: i18nc("number in percentage, e.g. 85 %","%1 %", currentValue) + horizontalAlignment: Text.AlignRight + Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4 + Layout.maximumWidth: theme.mSize(theme.defaultFont).width * 4 + + readonly property int currentValue: backgroundCornerMarginSlider.value + } + } + LatteComponents.SubHeader { text: i18n("Options") } diff --git a/indicators/org.kde.latte.plasma/package/config/main.xml b/indicators/org.kde.latte.plasma/package/config/main.xml index 22eb5c57a..5d223b5b0 100644 --- a/indicators/org.kde.latte.plasma/package/config/main.xml +++ b/indicators/org.kde.latte.plasma/package/config/main.xml @@ -17,6 +17,9 @@ 0.08 + + 1.00 + diff --git a/indicators/org.kde.latte.plasma/package/ui/main.qml b/indicators/org.kde.latte.plasma/package/ui/main.qml index 8c45a9a82..7c2d49e33 100644 --- a/indicators/org.kde.latte.plasma/package/ui/main.qml +++ b/indicators/org.kde.latte.plasma/package/ui/main.qml @@ -23,6 +23,9 @@ LatteComponents.IndicatorItem { lengthPadding: configurationIsReady && indicator.configuration.clickedAnimationEnabled !== undefined ? indicator.configuration.lengthPadding : 0.08 + backgroundCornerMargin: configurationIsReady && indicator.configuration.backgroundCornerMargin !== undefined ? + indicator.configuration.backgroundCornerMargin : 1.00 + //! config options readonly property bool clickedAnimationEnabled: configurationIsReady && indicator.configuration.clickedAnimationEnabled !== undefined