split animations and make par.effect independent

pull/5/head
Michail Vourlakos 6 years ago
parent 01e60370b0
commit 25b636465a

@ -286,15 +286,9 @@
<default>100</default>
<label>user set dock settings window height scale</label>
</entry>
<!-- Tasks properties -->
<entry name="threeColorsWindows" type="Bool">
<default>false</default>
</entry>
<entry name="dotsOnActive" type="Bool">
<default>false</default>
</entry>
<entry name="reverseLinesPosition" type="Bool">
<default>false</default>
<!-- Animations -->
<entry name="animationsEnabled" type="Bool">
<default>true</default>
</entry>
<entry name="durationTime" type="Enum">
<choices>
@ -305,6 +299,31 @@
</choices>
<default>2</default>
</entry>
<entry name="animationLauncherBouncing" type="Bool">
<default>true</default>
</entry>
<entry name="animationWindowInAttention" type="Bool">
<default>true</default>
</entry>
<entry name="animationNewWindowSliding" type="Bool">
<default>true</default>
</entry>
<entry name="animationWindowAddedInGroup" type="Bool">
<default>true</default>
</entry>
<entry name="animationWindowRemovedFromGroup" type="Bool">
<default>true</default>
</entry>
<!-- Tasks properties -->
<entry name="threeColorsWindows" type="Bool">
<default>false</default>
</entry>
<entry name="dotsOnActive" type="Bool">
<default>false</default>
</entry>
<entry name="reverseLinesPosition" type="Bool">
<default>false</default>
</entry>
<entry name="launchersGroup" type="Enum">
<choices>
<choice name="Unique"/>

@ -41,7 +41,7 @@ Item{
property bool previousNormalState : false // this is only for debugging purposes
property bool panelIsBiggerFromIconSize: root.useThemePanel && (root.themePanelThickness >= (root.iconSize + root.thickMargin))
property int animationSpeed: Latte.WindowSystem.compositingActive ? root.durationTime * 1.2 * units.longDuration : 0
property int animationSpeed: Latte.WindowSystem.compositingActive ? root.appliedDurationTime * 1.2 * units.longDuration : 0
property bool inSlidingIn: false //necessary because of its init structure
property alias inSlidingOut: slidingAnimationAutoHiddenOut.running
property bool inTempHiding: false
@ -51,17 +51,17 @@ Item{
-thicknessNormal : thicknessNormal;
property int thicknessAutoHidden: Latte.WindowSystem.compositingActive ? 2 : 1
property int thicknessMid: (1 + (0.65 * (root.zoomFactor-1)))*(root.iconSize+root.thickMargins+extraThickMask) //needed in some animations
property int thicknessMid: (1 + (0.65 * (root.maxZoomFactor-1)))*(root.iconSize+root.thickMargins+extraThickMask) //needed in some animations
property int thicknessNormal: Math.max(root.iconSize + root.thickMargins + extraThickMask + 1,
root.realPanelSize + root.panelShadow)
property int thicknessZoom: ((root.iconSize+root.thickMargins+extraThickMask) * root.zoomFactor) + 2
property int thicknessZoom: ((root.iconSize+root.thickMargins+extraThickMask) * root.maxZoomFactor) + 2
//it is used to keep thickness solid e.g. when iconSize changes from auto functions
property int thicknessMidOriginal: Math.max(thicknessNormalOriginal,extraThickMask + (1 + (0.65 * (root.zoomFactor-1)))*(root.maxIconSize+root.maxThickMargin)) //needed in some animations
property int thicknessMidOriginal: Math.max(thicknessNormalOriginal,extraThickMask + (1 + (0.65 * (root.maxZoomFactor-1)))*(root.maxIconSize+root.maxThickMargin)) //needed in some animations
property int thicknessNormalOriginal: !root.behaveAsPlasmaPanel || root.editMode ?
thicknessNormalOriginalValue : root.realPanelSize + root.panelShadow
property int thicknessNormalOriginalValue: root.maxIconSize + (root.maxThickMargin * 2) + extraThickMask + 1
property int thicknessZoomOriginal: Math.max( ((root.maxIconSize+(root.maxThickMargin * 2)) * root.zoomFactor) + extraThickMask + 2,
property int thicknessZoomOriginal: Math.max( ((root.maxIconSize+(root.maxThickMargin * 2)) * root.maxZoomFactor) + extraThickMask + 2,
root.realPanelSize + root.panelShadow,
(Latte.WindowSystem.compositingActive ? thicknessEditMode + root.editShadow : thicknessEditMode))
@ -634,7 +634,7 @@ Item{
if (!manager.inTempHiding) {
updateMaskArea();
} else if (plasmoid.configuration.durationTime === 0) {
} else {
sendHideDockDuringLocationChangeFinished();
}
}
@ -649,7 +649,7 @@ Item{
id: slidingAnimationAutoHiddenIn
PauseAnimation{
duration: manager.inTempHiding && root.durationTime>0 ? 500 : 0
duration: manager.inTempHiding && animationsEnabled ? 500 : 0
}
PropertyAnimation {

@ -94,7 +94,7 @@ Item {
||((index === layoutsContainer.mainLayout.beginIndex+layoutsContainer.mainLayout.count-2)&&(layoutsContainer.mainLayout.count>2))
||((index === layoutsContainer.endLayout.beginIndex+layoutsContainer.endLayout.count-1)&&(layoutsContainer.endLayout.count>1)))
property int animationTime: root.durationTime* (1.2 *units.shortDuration) // 70
property int animationTime: appliedDurationTime * (1.2 *units.shortDuration)
property int hoveredIndex: layoutsContainer.hoveredIndex
property int index: -1
property int maxWidth: root.isHorizontal ? root.height : root.width

@ -627,7 +627,7 @@ Item{
}
function calculateScales( currentMousePosition ){
if (root.zoomFactor===1 || root.durationTime===0) {
if (root.zoomFactor===1) {
return;
}

@ -76,7 +76,7 @@ DragDrop.DropArea {
if (!latteView || !latteView.visibility)
return false;
return (visibilityManager.panelIsBiggerFromIconSize && (zoomFactor === 1.0)
return (visibilityManager.panelIsBiggerFromIconSize && (maxZoomFactor === 1.0)
&& (latteView.visibility.mode === Latte.Types.AlwaysVisible || latteView.visibility.mode === Latte.Types.WindowsGoBelow)
&& (plasmoid.configuration.panelPosition === Latte.Types.Justify) && !(root.solidStylePanel && panelShadowsActive));
}
@ -331,7 +331,6 @@ DragDrop.DropArea {
//! to be always correctly centered
property int thickMargins: 2 * thickMargin
//it is used in order to not break the calculations for the thickness placement
//especially in automatic icon sizes calculations
property int maxThickMargin: thickMarginFactor * maxIconSize
@ -347,7 +346,7 @@ DragDrop.DropArea {
( plasmoid.configuration.panelPosition === Latte.Types.Justify ?
Latte.Types.Center : plasmoid.configuration.panelPosition )
property real zoomFactor: (Latte.WindowSystem.compositingActive && durationTime>0) ? ( 1 + (plasmoid.configuration.zoomLevel / 20) ) : 1
property real zoomFactor: Latte.WindowSystem.compositingActive ? ( 1 + (plasmoid.configuration.zoomLevel / 20) ) : 1
readonly property string plasmoidName: "org.kde.latte.plasmoid"
@ -424,11 +423,25 @@ DragDrop.DropArea {
property int launchersGroup: plasmoid.configuration.launchersGroup
property int tasksCount: latteApplet ? latteApplet.tasksCount : 0
//! Animations
property bool animationsEnabled: plasmoid.configuration.animationsEnabled && Latte.WindowSystem.compositingActive
property bool animationLauncherBouncing: animationsEnabled && latteApplet && plasmoid.configuration.animationLauncherBouncing
property bool animationWindowInAttention: animationsEnabled && latteApplet && plasmoid.configuration.animationWindowInAttention
property bool animationNewWindowSliding: animationsEnabled && latteApplet && plasmoid.configuration.animationNewWindowSliding
property bool animationWindowAddedInGroup: animationsEnabled && latteApplet && plasmoid.configuration.animationWindowAddedInGrou
property bool animationWindowRemovedFromGroup: animationsEnabled && latteApplet && plasmoid.configuration.animationWindowRemovedFromGroup
property real appliedDurationTime: animationsEnabled ? durationTime : 2
property real durationTime: {
if ((latteView && latteView.effects && latteView.effects.animationsBlocked) || !Latte.WindowSystem.compositingActive) {
if (!animationsEnabled) {
return 0;
}
/*if ((latteView && latteView.effects && latteView.effects.animationsBlocked)
|| !animationsEnabled) {
return 0;
}*/
if (plasmoid.configuration.durationTime === 0 || plasmoid.configuration.durationTime === 2 )
return plasmoid.configuration.durationTime;
@ -440,6 +453,20 @@ DragDrop.DropArea {
return 2;
}
property real animationsZoomFactor : {
if (!animationsEnabled) {
return 1;
}
if (latteApplet && (animationLauncherBouncing || animationWindowInAttention || animationWindowAddedInGroup)) {
return 1.65;
}
return 1;
}
property real maxZoomFactor: Math.max(zoomFactor, animationsZoomFactor)
property rect screenGeometry: latteView ? latteView.screenGeometry : plasmoid.screenGeometry
readonly property color minimizedDotColor: colorizerManager.minimizedDotColor

@ -217,6 +217,18 @@ Item {
property int tasksWidth: mouseHandler.width
property int userPanelPosition: latteView ? latteView.panelAlignment : plasmoid.configuration.plasmoidPosition
//! Animations
property bool animationsEnabled: latteView ? latteView.animationsEnabled : durationTime !== 0
property bool animationLauncherBouncing: latteView ? latteView.animationLauncherBouncing : durationTime !== 0
property bool animationWindowInAttention: latteView ? latteView.animationWindowInAttention : durationTime !== 0
property bool animationNewWindowSliding: latteView ? latteView.animationNewWindowSliding : durationTime !== 0
property bool animationWindowAddedInGroup: latteView ? latteView.animationWindowAddedInGrou : durationTime !== 0
property bool animationWindowRemovedFromGroup: latteView ? latteView.animationWindowRemovedFromGroup : durationTime !== 0
property real animationsZoomFactor: latteView ? latteView.animationsZoomFactor : durationTime === 0 ? 1 : 1.65
property real maxZoomFactor: latteView ? latteView.maxZoomFactor : Math.max(zoomFactor, animationsZoomFactor)
property real appliedDurationTime: animationsEnabled ? durationTime : 2
property real durationTime: latteView ? latteView.durationTime : plasmoid.configuration.durationTime
property real zoomFactor: latteView ? latteView.zoomFactor : ( 1 + (plasmoid.configuration.zoomLevel / 20) )

@ -126,7 +126,7 @@ MouseArea{
property bool pressed: false
property bool wheelIsBlocked: false
property int animationTime: root.durationTime * 1.2 * units.shortDuration
property int animationTime: (animationsEnabled ? root.durationTime : 2) * (1.2 *units.shortDuration)
property int badgeIndicator: 0 //it is used from external apps
property int hoveredIndex: icList.hoveredIndex
property int itemIndex: index

@ -142,7 +142,7 @@ Item{
}
function calculateScales( currentMousePosition ){
if (root.zoomFactor===1 || root.durationTime===0) {
if (root.zoomFactor===1) {
return;
}

@ -312,66 +312,82 @@ PlasmaComponents.Page {
Layout.rightMargin: units.smallSpacing * 2
spacing: units.smallSpacing
LatteExtraControls.Header {
LatteExtraControls.HeaderSwitch {
id: animationsHeader
Layout.fillWidth: true
Layout.minimumHeight: implicitHeight
Layout.topMargin: units.smallSpacing
checked: plasmoid.configuration.animationsEnabled
text: i18n("Animations")
}
tooltip: i18n("Enable/disable all animations")
LatteExtraControls.SubHeader {
Layout.leftMargin: units.smallSpacing * 2
isFirstSubCategory: true
text: i18n("Duration")
onPressed: {
plasmoid.configuration.animationsEnabled = !plasmoid.configuration.animationsEnabled;
}
}
RowLayout {
Layout.fillWidth: true
Layout.leftMargin: units.smallSpacing * 2
spacing: 2
property int duration: plasmoid.configuration.durationTime
ColumnLayout {
spacing: 0
enabled: plasmoid.configuration.animationsEnabled
ExclusiveGroup {
id: animationsGroup
onCurrentChanged: {
if (current.checked)
plasmoid.configuration.durationTime = current.duration
}
LatteExtraControls.SubHeader {
Layout.leftMargin: units.smallSpacing * 2
isFirstSubCategory: true
text: i18n("Speed")
}
PlasmaComponents.Button {
RowLayout {
Layout.fillWidth: true
text: i18n("Instant")
checked: parent.duration === duration
checkable: true
exclusiveGroup: animationsGroup
Layout.leftMargin: units.smallSpacing * 2
spacing: 2
readonly property int duration: 0
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("x1")
checked: parent.duration === duration
checkable: true
exclusiveGroup: animationsGroup
property int duration: plasmoid.configuration.durationTime
readonly property int duration: 1
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("x2")
checked: parent.duration === duration
checkable: true
exclusiveGroup: animationsGroup
ExclusiveGroup {
id: animationsGroup
onCurrentChanged: {
if (current.checked)
plasmoid.configuration.durationTime = current.duration
}
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("x1")
checked: parent.duration === duration
checkable: true
exclusiveGroup: animationsGroup
readonly property int duration: 2
readonly property int duration: 3
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("x2")
checked: parent.duration === duration
checkable: true
exclusiveGroup: animationsGroup
readonly property int duration: 2
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("x3")
checked: parent.duration === duration
checkable: true
exclusiveGroup: animationsGroup
readonly property int duration: 1
}
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("x3")
checked: parent.duration === duration
checkable: true
exclusiveGroup: animationsGroup
readonly property int duration: 3
ColumnLayout {
spacing: 0
LatteExtraControls.SubHeader {
Layout.leftMargin: units.smallSpacing * 2
isFirstSubCategory: true
text: i18n("Tasks")
}
}
}
}

Loading…
Cancel
Save