follow Fitt's Law when dock is inFullJustify

--improvements in order to follow Fitt's Law when
the dock is in Justify mode and 100% maximum length
pull/1/head
Michail Vourlakos 8 years ago
parent e89afafab2
commit 9760ef2a5e

@ -63,6 +63,8 @@ Item {
property bool isZoomed: false
property bool isSeparator: applet && applet.pluginName === "audoban.applet.separator"
property bool firstChildOfStartLayout: (index === layoutsContainer.startLayout.beginIndex)
property bool lastChildOfEndLayout: ((index === layoutsContainer.endLayout.beginIndex+layoutsContainer.endLayout.count-1)&&(layoutsContainer.endLayout.count>1))
//applet is in starting edge
/*property bool startEdge: index < layoutsContainer.endLayout.beginIndex ? (index === 0)&&(layoutsContainer.mainLayout.count > 1) :
(index === layoutsContainer.endLayout.beginIndex)&&(layoutsContainer.endLayout.count > 1)*/

@ -111,10 +111,10 @@ Item{
property int marginWidth: root.isVertical ?
(applet && (applet.pluginName === "org.kde.plasma.systemtray") ? root.thickMarginBase : root.thickMargin ) :
root.iconMargin
(root.inFullJustify && (container.firstChildOfStartLayout || container.lastChildOfEndLayout ) ? 0 : root.iconMargin) //Fitt's Law
property int marginHeight: root.isHorizontal ?
(applet && (applet.pluginName === "org.kde.plasma.systemtray") ? root.thickMarginBase : root.thickMargin ) :
root.iconMargin
(root.inFullJustify && (container.firstChildOfStartLayout || container.lastChildOfEndLayout ) ? 0 : root.iconMargin) //Fitt's Law
property real scaledWidth: zoomScaleWidth * (layoutWidth + marginWidth)
property real scaledHeight: zoomScaleHeight * (layoutHeight + marginHeight)

@ -85,6 +85,7 @@ DragDrop.DropArea {
property bool immutable: plasmoid.immutable
property bool indicateAudioStreams: plasmoid.configuration.indicateAudioStreams
property bool inFullJustify: (plasmoid.configuration.panelPosition === Latte.Dock.Justify) && (plasmoid.configuration.maxLength===100)
property bool inStartup: true
property bool isHalfShown: false //is used to disable the zoom hovering effect at sliding in-out the dock
property bool isHorizontal: plasmoid.formFactor === PlasmaCore.Types.Horizontal
@ -188,8 +189,8 @@ 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(0.06 * iconSize)
property int thickMarginHigh: shrinkThickMargins ? 1 : Math.ceil(0.06 * iconSize)
property int thickMarginBase: shrinkThickMargins ? 0 : Math.ceil(0.06 * iconSize)
property int thickMarginHigh: shrinkThickMargins ? 0 : Math.ceil(0.06 * iconSize)
property int thickMargin: thickMarginBase + thickMarginHigh
//it is used in order to not break the calculations for the thickness placement

Loading…
Cancel
Save