fix #191,use percentage to calculate panel size

v0.6
Michail Vourlakos 8 years ago
parent 8f3b1cbe66
commit 7eb2012048

@ -92,7 +92,14 @@ DragDrop.DropArea {
property int panelMargin: 0
property int panelShadow: 0 //shadowsSize
property int editShadow: Math.ceil(iconSize / 5)
property int themePanelSize: plasmoid.configuration.panelSize
property int themePanelSize: {
//root.statesLineSize + root.iconSize + root.iconMargin + 1
var panelBase = root.statesLineSize + root.panelMargin;
var iconMarginUsed = latteApplet ? root.iconMargin : 0;
var maxPanelSize = (root.statesLineSize + root.iconSize + iconMarginUsed + 1) - panelBase;
var percentage = plasmoid.configuration.panelSize/100;
return Math.max(panelBase, panelBase + percentage*maxPanelSize);
}
property int iconMargin: Math.ceil(0.12 * iconSize)
property int statesLineSize: latteApplet ? Math.ceil( root.iconSize/13 ) : 0

@ -250,8 +250,8 @@ PlasmaComponents.Page {
value: plasmoid.configuration.panelSize
minimumValue: 0
maximumValue: Number(1.2 * plasmoid.configuration.iconSize).toFixed(0) //0.12*iconSize is the iconMargin, 0.08 for statesLine
stepSize: 2
maximumValue: 100
stepSize: 5
function updatePanelSize() {
if (!pressed)
@ -259,7 +259,7 @@ PlasmaComponents.Page {
}
onPressedChanged: {
updatePanelSize()
updatePanelSize();
}
Component.onCompleted: {
@ -269,7 +269,7 @@ PlasmaComponents.Page {
PlasmaComponents.Label {
enabled: showBackground.checked
text: panelSizeSlider.value + " px."
text: panelSizeSlider.value + " %"
horizontalAlignment: Text.AlignRight
Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4
}

Loading…
Cancel
Save