diff --git a/containment/contents/config/main.xml b/containment/contents/config/main.xml index 05009e8ce..6672c5ad4 100644 --- a/containment/contents/config/main.xml +++ b/containment/contents/config/main.xml @@ -28,6 +28,9 @@ 64 + + -1 + true diff --git a/containment/contents/ui/DebugWindow.qml b/containment/contents/ui/DebugWindow.qml index 9db198081..283f3e47c 100644 --- a/containment/contents/ui/DebugWindow.qml +++ b/containment/contents/ui/DebugWindow.qml @@ -296,6 +296,14 @@ Window{ text: plasmoid.configuration.iconSize } + Text{ + text: "Proportion Icon Size "+space + } + + Text{ + text: root.proportionIconSize + } + Text{ text: "Icon Size (automatic)"+space } diff --git a/containment/contents/ui/main.qml b/containment/contents/ui/main.qml index 694e5f557..2c588ca51 100644 --- a/containment/contents/ui/main.qml +++ b/containment/contents/ui/main.qml @@ -77,6 +77,11 @@ DragDrop.DropArea { property int automaticIconSizeBasedSize: -1 //it is not set, this is the defautl property int iconSize: automaticIconSizeBasedSize > 0 ? Math.min(automaticIconSizeBasedSize, plasmoid.configuration.iconSize) : plasmoid.configuration.iconSize + + property int proportionIconSize: { + return (plasmoid.configuration.proportionIconSize===-1) ? -1 : Math.round(Screen.height * plasmoid.configuration.proportionIconSize/100/8)*8; + } + property int iconStep: 8 property int latteAppletPos: -1 property int maxLength: root.isHorizontal ? width * (plasmoid.configuration.maxLength/100) diff --git a/shell/contents/configuration/AppearanceConfig.qml b/shell/contents/configuration/AppearanceConfig.qml index a90905824..b8d7ee3ef 100644 --- a/shell/contents/configuration/AppearanceConfig.qml +++ b/shell/contents/configuration/AppearanceConfig.qml @@ -64,6 +64,7 @@ PlasmaComponents.Page { Layout.leftMargin: units.smallSpacing * 2 Layout.rightMargin: units.smallSpacing * 2 spacing: units.smallSpacing + enabled: plasmoid.configuration.proportionIconSize === -1 PlasmaComponents.Slider { id: appletsSizeSlider @@ -95,6 +96,55 @@ PlasmaComponents.Page { Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4 } } + + RowLayout { + Layout.fillWidth: true + Layout.leftMargin: units.smallSpacing * 2 + Layout.rightMargin: units.smallSpacing * 2 + spacing: units.smallSpacing + + PlasmaComponents.Label { + text: i18n("Screen Height Proportion:") + horizontalAlignment: Text.AlignLeft + enabled: proportionSizeSlider.value >= proportionSizeSlider.realMinimum + } + + PlasmaComponents.Slider { + id: proportionSizeSlider + Layout.fillWidth: true + value: plasmoid.configuration.proportionIconSize + minimumValue: 2.5 + maximumValue: 8 + stepSize: 0.5 + property real realMinimum: minimumValue + 0.5 + + function updateProportionIconSize() { + if (!pressed) { + if(value=proportionSizeSlider.realMinimum ? + proportionSizeSlider.value.toFixed(1) + "%" : "---%" + horizontalAlignment: Text.AlignRight + Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4 + enabled: proportionSizeSlider.value >= proportionSizeSlider.realMinimum + } + } } //! END: Applet Size