add proportion icon size

--this icon size is calculated based on the
screen's height
pull/1/head
Michail Vourlakos 8 years ago
parent 49d3a4c811
commit 0e5cf91a81

@ -28,6 +28,9 @@
<entry name="iconSize" type="Int">
<default>64</default>
</entry>
<entry name="proportionIconSize" type="Double">
<default>-1</default>
</entry>
<entry name="useThemePanel" type="Bool">
<default>true</default>
</entry>

@ -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
}

@ -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)

@ -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<realMinimum) {
plasmoid.configuration.proportionIconSize = -1;
} else {
plasmoid.configuration.proportionIconSize = value;
}
}
}
onPressedChanged: {
updateProportionIconSize();
}
Component.onCompleted: {
valueChanged.connect(updateProportionIconSize)
}
}
PlasmaComponents.Label {
text: proportionSizeSlider.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

Loading…
Cancel
Save