mirror of
https://github.com/KDE/latte-dock.git
synced 2025-03-09 00:58:15 +03:00
fix #103,fixes in calculations and orchestration
This commit is contained in:
parent
fb6baeeb71
commit
7dae6e6c3d
@ -258,7 +258,15 @@ Window{
|
||||
}
|
||||
|
||||
Text{
|
||||
text: "Panel Background Size(user)"+space
|
||||
text: "Panel Background Length"+space
|
||||
}
|
||||
|
||||
Text{
|
||||
text: root.realPanelLength
|
||||
}
|
||||
|
||||
Text{
|
||||
text: "Panel Background Thickness(user)"+space
|
||||
}
|
||||
|
||||
Text{
|
||||
@ -266,7 +274,7 @@ Window{
|
||||
}
|
||||
|
||||
Text{
|
||||
text: "Panel Background Size(automatic)"+space
|
||||
text: "Panel Background Thickness(automatic)"+space
|
||||
}
|
||||
|
||||
Text{
|
||||
|
@ -34,14 +34,13 @@ Item{
|
||||
id:barLine
|
||||
|
||||
opacity: root.useThemePanel ? 1 : 0
|
||||
// parent: root
|
||||
|
||||
property int panelWidth: root.drawShadowsExternal ? root.width :
|
||||
(root.panelAlignment === Latte.Dock.Justify) && root.isHorizontal && !root.editMode ?
|
||||
layoutsContainer.width + spacing : mainLayout.width + spacing
|
||||
layoutsContainer.contentWidth + spacing : mainLayout.width + spacing
|
||||
property int panelHeight: root.drawShadowsExternal ? root.height :
|
||||
(root.panelAlignment === Latte.Dock.Justify) && root.isVertical && !root.editMode ?
|
||||
layoutsContainer.height + spacing : mainLayout.height + spacing
|
||||
layoutsContainer.contentHeight + spacing : mainLayout.height + spacing
|
||||
|
||||
width: root.isHorizontal ? panelWidth : smallSize
|
||||
height: root.isVertical ? panelHeight : smallSize
|
||||
@ -55,6 +54,12 @@ Item{
|
||||
NumberAnimation { duration: 150 }
|
||||
}
|
||||
|
||||
Binding {
|
||||
target: root
|
||||
property: "realPanelLength"
|
||||
value: root.isVertical ? barLine.height : barLine.width
|
||||
}
|
||||
|
||||
/// plasmoid's default panel
|
||||
/* BorderImage{
|
||||
anchors.fill:parent
|
||||
|
@ -43,8 +43,12 @@ Item{
|
||||
property bool panelIsBiggerFromIconSize: root.useThemePanel && (root.themePanelSize >= root.iconSize)
|
||||
|
||||
property int animationSpeed: root.durationTime * 1.2 * units.longDuration
|
||||
property bool inSlidingIn: false //necessary because of its init structure
|
||||
property alias inSlidingOut: slidingAnimationAutoHiddenOut.running
|
||||
property int length: root.isVertical ? Screen.height : Screen.width //screenGeometry.height : screenGeometry.width
|
||||
|
||||
property int slidingOutToPos: ((plasmoid.location===PlasmaCore.Types.LeftEdge)||(plasmoid.location===PlasmaCore.Types.TopEdge)) ? -thicknessNormal : thicknessNormal
|
||||
|
||||
//it is used in order to not break the calculations for the thickness placement
|
||||
//especially in automatic icon sizes calculations
|
||||
property real iconMarginOriginal: 0.12*plasmoid.configuration.iconSize
|
||||
@ -138,7 +142,8 @@ Item{
|
||||
var localY = 0;
|
||||
|
||||
normalState = ((root.animationsNeedBothAxis === 0) && (root.animationsNeedLength === 0))
|
||||
|| !windowSystem.compositingActive;
|
||||
|| !windowSystem.compositingActive
|
||||
|| (dock.visibility.isHidden && !dock.visibility.containsMouse && root.animationsNeedThickness == 0);
|
||||
|
||||
// debug maskArea criteria
|
||||
if (debugMagager) {
|
||||
@ -354,7 +359,7 @@ Item{
|
||||
PropertyAnimation {
|
||||
target: layoutsContainer
|
||||
property: root.isVertical ? "x" : "y"
|
||||
to: ((plasmoid.location===PlasmaCore.Types.LeftEdge)||(plasmoid.location===PlasmaCore.Types.TopEdge)) ? -thicknessNormal : thicknessNormal
|
||||
to: slidingOutToPos
|
||||
duration: manager.animationSpeed
|
||||
easing.type: Easing.OutQuad
|
||||
}
|
||||
@ -397,15 +402,16 @@ Item{
|
||||
}
|
||||
|
||||
onStopped: {
|
||||
inSlidingIn = false;
|
||||
if (manager.debugMagager) {
|
||||
console.log("showing animation ended...");
|
||||
}
|
||||
}
|
||||
|
||||
function init() {
|
||||
if (!dock.visibility.blockHiding)
|
||||
dock.visibility.isHidden = false;
|
||||
|
||||
// if (!dock.visibility.blockHiding)
|
||||
inSlidingIn = true;
|
||||
dock.visibility.isHidden = false;
|
||||
updateMaskArea();
|
||||
|
||||
if (slidingAnimationAutoHiddenOut.running) {
|
||||
|
@ -83,6 +83,7 @@ DragDrop.DropArea {
|
||||
property int previousAllTasks: -1 //is used to forbit updateAutomaticIconSize when hovering
|
||||
property int realSize: iconSize + iconMargin
|
||||
property int realPanelSize
|
||||
property int realPanelLength: 0
|
||||
//this is set by the PanelBox
|
||||
property int panelShadow: 0 //shadowsSize
|
||||
property int editShadow: Math.ceil(iconSize / 5)
|
||||
@ -1047,16 +1048,20 @@ DragDrop.DropArea {
|
||||
z: root.drawShadowsExternal ? 1 : 0
|
||||
}
|
||||
|
||||
Loader{
|
||||
anchors.fill: layoutsContainer
|
||||
|
||||
// FIX IT && TEST IT: it is crashing Plasma with two Now Docks one of which has only
|
||||
// task manager (small)
|
||||
//active: root.useThemePanel
|
||||
active: windowSystem.compositingActive
|
||||
|
||||
sourceComponent: PanelBox{}
|
||||
Item{
|
||||
anchors.fill:layoutsContainer
|
||||
z: root.drawShadowsExternal ? 0 : 1
|
||||
|
||||
Loader{
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
// FIX IT && TEST IT: it is crashing Plasma with two Now Docks one of which has only
|
||||
// task manager (small)
|
||||
//active: root.useThemePanel
|
||||
active: windowSystem.compositingActive
|
||||
sourceComponent: PanelBox{}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
@ -1119,12 +1124,40 @@ DragDrop.DropArea {
|
||||
property int currentSpot: -1000
|
||||
property int hoveredIndex: -1
|
||||
|
||||
x: (plasmoid.configuration.panelPosition === Latte.Dock.Justify) && root.isHorizontal
|
||||
&& !root.editMode && windowSystem.compositingActive && !root.drawShadowsExternal ?
|
||||
(dock.width/2) - (root.maxLength/2): 0
|
||||
y: (plasmoid.configuration.panelPosition === Latte.Dock.Justify) && root.isVertical
|
||||
&& !root.editMode && windowSystem.compositingActive && !root.drawShadowsExternal ?
|
||||
(dock.height/2) - (root.maxLength/2): 0
|
||||
x: {
|
||||
if ( (plasmoid.configuration.panelPosition === Latte.Dock.Justify) && root.isHorizontal
|
||||
&& !root.editMode && windowSystem.compositingActive && !root.drawShadowsExternal ){
|
||||
return ((dock.width/2) - (root.maxLength/2))
|
||||
} else {
|
||||
if (visibilityManager.inSlidingIn && root.isVertical){
|
||||
return;
|
||||
}
|
||||
|
||||
if (dock.visibility.isHidden && windowSystem.compositingActive) {
|
||||
return visibilityManager.slidingOutToPos;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
y: {
|
||||
if ( (plasmoid.configuration.panelPosition === Latte.Dock.Justify) && root.isVertical
|
||||
&& !root.editMode && windowSystem.compositingActive && !root.drawShadowsExternal ) {
|
||||
return ((dock.height/2) - (root.maxLength/2));
|
||||
} else {
|
||||
if (visibilityManager.inSlidingIn && root.isHorizontal){
|
||||
return;
|
||||
}
|
||||
|
||||
if (dock.visibility.isHidden && windowSystem.compositingActive) {
|
||||
return visibilityManager.slidingOutToPos;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
width: (plasmoid.configuration.panelPosition === Latte.Dock.Justify) && root.isHorizontal && !root.editMode && !root.drawShadowsExternal ?
|
||||
root.maxLength : parent.width
|
||||
height: (plasmoid.configuration.panelPosition === Latte.Dock.Justify) && root.isVertical && !root.editMode && !root.drawShadowsExternal ?
|
||||
|
Loading…
x
Reference in New Issue
Block a user