1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-26 23:21:37 +03:00

hidden internal separator at the edges

--The internal separator can be hidden when it is
found at the edges of Tasks Plasmoid, it creates a
more pleasant result. If the user wants separators at
the edges can always use the Separator plasmoid from
audoban. This fix would fix also the overlap
of internal sepator with external applet separator.
This commit is contained in:
Michail Vourlakos 2017-10-14 22:05:58 +03:00
parent f6e4bd205a
commit 0df95400d8
4 changed files with 20 additions and 6 deletions

View File

@ -433,7 +433,7 @@ Item {
property bool neighbourSeparator: false;
//in case there is a neighbour internal separator
property int separatorSpace: ((root.latteApplet && root.latteApplet.hasInternalSeparator
property int separatorSpace: ((root.latteApplet && root.latteApplet.hasInternalSeparator && !root.latteApplet.internalSeparatorHidden
&& (root.latteApplet.internalSeparatorPos === root.tasksCount-1) && index===root.latteAppletPos+1)
|| neighbourSeparator) && !container.isSeparator && !container.latteApplet ? (2+root.iconMargin/2) : 0
property real nHiddenSize: (nScale > 0) ? (container.spacersMaxSize * nScale) + separatorSpace : separatorSpace
@ -494,7 +494,7 @@ Item {
property bool neighbourSeparator: false;
//in case there is a neighbour internal separator
property int separatorSpace: ((root.latteApplet && root.latteApplet.hasInternalSeparator
property int separatorSpace: ((root.latteApplet && root.latteApplet.hasInternalSeparator && !root.latteApplet.internalSeparatorHidden
&& root.latteApplet.internalSeparatorPos === 0 && index===root.latteAppletPos-1)
|| neighbourSeparator) && !container.isSeparator && !container.latteApplet ? (2+root.iconMargin/2) : 0
property real nHiddenSize: (nScale > 0) ? (container.spacersMaxSize * nScale) + separatorSpace : separatorSpace

View File

@ -29,6 +29,7 @@ Item {
id: parManager
property bool hasInternalSeparator: false
property bool internalSeparatorHidden: (internalSeparatorPos === 0) || (internalSeparatorPos === root.tasksCount - 1)
property int internalSeparatorPos: -1
onInternalSeparatorPosChanged: {

View File

@ -61,6 +61,7 @@ Item {
property bool disableRestoreZoom: false //blocks restore animation in rightClick
property bool dropNewLauncher: false
readonly property bool hasInternalSeparator: parabolicManager.hasInternalSeparator
readonly property bool internalSeparatorHidden: parabolicManager.internalSeparatorHidden
property bool initializationStep: false //true
property bool initializatedBuffers: true // noInitCreatedBuffers >= tasksStarting ? true : false
property bool isHovered: false

View File

@ -226,7 +226,7 @@ MouseArea{
anchors.top: root.position === PlasmaCore.Types.TopPositioned ? parent.top : undefined;
anchors.bottom: root.position === PlasmaCore.Types.BottomPositioned ? parent.bottom : undefined;
opacity: separatorShadow.active ? 0 : 0.4
opacity: separatorShadow.active || root.internalSeparatorHidden ? 0 : 0.4
visible: mainItemContainer.isSeparator
width: root.vertical ? root.iconSize : (root.dragSource) ? 5+root.iconMargin: 1
@ -234,6 +234,10 @@ MouseArea{
property int localThickMargin: root.statesLineSize + root.thickMarginBase + 4
Behavior on opacity {
NumberAnimation { duration: root.durationTime*units.longDuration }
}
Rectangle {
anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined
anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined
@ -255,7 +259,11 @@ MouseArea{
id: separatorShadow
anchors.fill: separatorItem
active: root.enableShadows && isSeparator
opacity: 0.4
opacity: root.internalSeparatorHidden ? 0 : 0.4
Behavior on opacity {
NumberAnimation { duration: root.durationTime*units.longDuration }
}
sourceComponent: DropShadow{
anchors.fill: parent
@ -293,7 +301,9 @@ MouseArea{
//in case there is a neighbour separator, lastValidIndex is used in order to protect from false
//when the task is removed
property int indexUsed: index === -1 ? lastValidIndex : index
property int separatorSpace: ((parabolicManager.internalSeparatorPos !== -1 && parabolicManager.internalSeparatorPos === indexUsed-1)
property int separatorSpace: ((parabolicManager.internalSeparatorPos !== -1
&& !root.internalSeparatorHidden
&& parabolicManager.internalSeparatorPos === indexUsed-1)
|| neighbourSeparator) && !isSeparator && !showWindowAnimation.running ?
(2+root.iconMargin/2) : 0
@ -366,7 +376,9 @@ MouseArea{
//in case there is a neighbour separator, lastValidIndex is used in order to protect from false
//when the task is removed
property int indexUsed: index === -1 ? lastValidIndex : index
property int separatorSpace: ((parabolicManager.internalSeparatorPos !== -1 && parabolicManager.internalSeparatorPos === indexUsed+1)
property int separatorSpace: ((parabolicManager.internalSeparatorPos !== -1
&& !root.internalSeparatorHidden
&& parabolicManager.internalSeparatorPos === indexUsed+1)
|| neighbourSeparator) && !isSeparator && !showWindowAnimation.running ?
(2+root.iconMargin/2) : 0