mirror of
https://github.com/KDE/latte-dock.git
synced 2025-08-15 21:49:28 +03:00
fix #259,user can set distance between applets
This commit is contained in:
@ -28,9 +28,14 @@
|
||||
<entry name="iconSize" type="Int">
|
||||
<default>64</default>
|
||||
</entry>
|
||||
<!-- this is percentage -->
|
||||
<entry name="iconMargin" type="Int">
|
||||
<default>0</default>
|
||||
</entry>
|
||||
<entry name="shrinkThickMargins" type="Bool">
|
||||
<default>false</default>
|
||||
</entry>
|
||||
<!-- this is percentage -->
|
||||
<entry name="proportionIconSize" type="Double">
|
||||
<default>-1</default>
|
||||
</entry>
|
||||
|
@ -331,13 +331,21 @@ Window{
|
||||
}
|
||||
|
||||
Text{
|
||||
text: "Icon Margin"+space
|
||||
text: "Icon Margin (pixels)"+space
|
||||
}
|
||||
|
||||
Text{
|
||||
text: root.iconMargin
|
||||
}
|
||||
|
||||
Text{
|
||||
text: "Icon Margin (user set)"+space
|
||||
}
|
||||
|
||||
Text{
|
||||
text: plasmoid.configuration.iconMargin+"%"
|
||||
}
|
||||
|
||||
Text{
|
||||
text: "Thick Margin Base"+space
|
||||
}
|
||||
|
@ -118,15 +118,18 @@ DragDrop.DropArea {
|
||||
|
||||
//decouple iconMargin which now is used only for length calculations with thickMargins
|
||||
//which are used for thickness calculations
|
||||
property int thickMarginBase: shrinkThickMargins ? 1 : Math.ceil(iconMargin/2)
|
||||
property int thickMarginHigh: shrinkThickMargins ? 1 : Math.ceil(iconMargin/2)
|
||||
property int thickMarginBase: shrinkThickMargins ? 1 : Math.ceil(0.06 * iconSize)
|
||||
property int thickMarginHigh: shrinkThickMargins ? 1 : Math.ceil(0.06 * iconSize)
|
||||
property int thickMargin: thickMarginBase + thickMarginHigh
|
||||
|
||||
//it is used in order to not break the calculations for the thickness placement
|
||||
//especially in automatic icon sizes calculations
|
||||
property int thickMarginOriginal: Math.ceil(0.12 * maxIconSize)
|
||||
|
||||
property int iconMargin: Math.ceil(0.12 * iconSize)
|
||||
//! iconMargin from configuration is a percentage. The calculation provides a length
|
||||
//! for that value between 0.12 - 0.5 of iconSize, this way 100% iconMargin means
|
||||
//! equal to the iconSize
|
||||
property int iconMargin: Math.ceil( (0.12 + (0.38 * (plasmoid.configuration.iconMargin)/100)) * iconSize)
|
||||
property int statesLineSize: latteApplet ? Math.ceil( root.iconSize/13 ) : 0
|
||||
|
||||
|
||||
|
@ -145,6 +145,41 @@ PlasmaComponents.Page {
|
||||
enabled: proportionSizeSlider.value >= proportionSizeSlider.realMinimum
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: units.smallSpacing * 2
|
||||
Layout.rightMargin: units.smallSpacing * 2
|
||||
spacing: units.smallSpacing
|
||||
|
||||
PlasmaComponents.Label {
|
||||
text: i18n("Applets Distance:")
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
enabled: iconMarginSlider.value > 0
|
||||
}
|
||||
|
||||
PlasmaComponents.Slider {
|
||||
id: iconMarginSlider
|
||||
Layout.fillWidth: true
|
||||
value: plasmoid.configuration.iconMargin
|
||||
minimumValue: 0
|
||||
maximumValue: 100
|
||||
stepSize: 5
|
||||
|
||||
onPressedChanged: {
|
||||
if (!pressed) {
|
||||
plasmoid.configuration.iconMargin = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaComponents.Label {
|
||||
text: iconMarginSlider.value.toFixed(1) + "%"
|
||||
horizontalAlignment: Text.AlignRight
|
||||
Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4
|
||||
enabled: iconMarginSlider.value > 0
|
||||
}
|
||||
}
|
||||
}
|
||||
//! END: Applet Size
|
||||
|
||||
|
Reference in New Issue
Block a user