mirror of
https://github.com/KDE/latte-dock.git
synced 2025-01-26 02:04:12 +03:00
plasmoid:expose AppletAbilities container item
--use a single central Item in order to provide the various applet abilities for consumption from the user
This commit is contained in:
parent
81e4b19b59
commit
b2aa7038a9
@ -122,7 +122,7 @@ function insertIndexAt(above, x, y) {
|
|||||||
} else {
|
} else {
|
||||||
var distance = root.vertical ? y : x;
|
var distance = root.vertical ? y : x;
|
||||||
//var step = root.vertical ? LayoutManager.taskWidth() : LayoutManager.taskHeight();
|
//var step = root.vertical ? LayoutManager.taskWidth() : LayoutManager.taskHeight();
|
||||||
var step = metrics.totals.length;
|
var step = appletAbilities.metrics.totals.length;
|
||||||
var stripe = Math.ceil(distance / step);
|
var stripe = Math.ceil(distance / step);
|
||||||
|
|
||||||
/* if (stripe === LayoutManager.calculateStripes()) {
|
/* if (stripe === LayoutManager.calculateStripes()) {
|
||||||
|
94
plasmoid/package/contents/ui/AppletAbilities.qml
Normal file
94
plasmoid/package/contents/ui/AppletAbilities.qml
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 Michail Vourlakos <mvourlakos@gmail.com>
|
||||||
|
*
|
||||||
|
* This file is part of Latte-Dock
|
||||||
|
*
|
||||||
|
* Latte-Dock is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
* published by the Free Software Foundation; either version 2 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Latte-Dock is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import QtQuick 2.7
|
||||||
|
|
||||||
|
import org.kde.plasma.plasmoid 2.0
|
||||||
|
|
||||||
|
import org.kde.latte.core 0.2 as LatteCore
|
||||||
|
import org.kde.latte.abilities.client 0.1 as ClientAbility
|
||||||
|
|
||||||
|
import "abilities" as Ability
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: _abilityContainer
|
||||||
|
|
||||||
|
property Item bridge: null
|
||||||
|
property Item layout: null
|
||||||
|
property QtObject tasksModel: null
|
||||||
|
|
||||||
|
readonly property alias animations: _animations
|
||||||
|
readonly property alias debug: _debug
|
||||||
|
readonly property alias indexer: _indexer
|
||||||
|
readonly property alias launchers: _launchers
|
||||||
|
readonly property alias metrics: _metrics
|
||||||
|
readonly property alias parabolic: _parabolic
|
||||||
|
readonly property alias shortcuts: _shortcuts
|
||||||
|
readonly property alias requires: _requires
|
||||||
|
readonly property alias userRequests: _userRequests
|
||||||
|
|
||||||
|
Ability.Animations {
|
||||||
|
id: _animations
|
||||||
|
bridge: _abilityContainer.bridge
|
||||||
|
}
|
||||||
|
|
||||||
|
ClientAbility.Debug {
|
||||||
|
id: _debug
|
||||||
|
bridge: _abilityContainer.bridge
|
||||||
|
}
|
||||||
|
|
||||||
|
Ability.Indexer {
|
||||||
|
id: _indexer
|
||||||
|
bridge: _abilityContainer.bridge
|
||||||
|
layout: _abilityContainer.layout
|
||||||
|
}
|
||||||
|
|
||||||
|
Ability.Launchers {
|
||||||
|
id: _launchers
|
||||||
|
bridge: _abilityContainer.bridge
|
||||||
|
layout: _abilityContainer.layout
|
||||||
|
tasksModel: _abilityContainer.tasksModel
|
||||||
|
}
|
||||||
|
|
||||||
|
Ability.Metrics {
|
||||||
|
id: _metrics
|
||||||
|
bridge: _abilityContainer.bridge
|
||||||
|
}
|
||||||
|
|
||||||
|
Ability.ParabolicEffect {
|
||||||
|
id: _parabolic
|
||||||
|
bridge: _abilityContainer.bridge
|
||||||
|
layout: _abilityContainer.layout
|
||||||
|
}
|
||||||
|
|
||||||
|
Ability.PositionShortcuts {
|
||||||
|
id: _shortcuts
|
||||||
|
bridge: _abilityContainer.bridge
|
||||||
|
}
|
||||||
|
|
||||||
|
ClientAbility.Requirements{
|
||||||
|
id: _requires
|
||||||
|
bridge: _abilityContainer.bridge
|
||||||
|
}
|
||||||
|
|
||||||
|
Ability.UserRequests {
|
||||||
|
id: _userRequests
|
||||||
|
bridge: _abilityContainer.bridge
|
||||||
|
}
|
||||||
|
}
|
@ -718,9 +718,9 @@ PlasmaComponents.ContextMenu {
|
|||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (tasksModel.launcherPosition(get(atm.LauncherUrlWithoutIcon)) !== -1) {
|
if (tasksModel.launcherPosition(get(atm.LauncherUrlWithoutIcon)) !== -1) {
|
||||||
launchers.removeLauncher(get(atm.LauncherUrl));
|
appletAbilities.launchers.removeLauncher(get(atm.LauncherUrl));
|
||||||
} else {
|
} else {
|
||||||
launchers.addLauncher(get(atm.LauncherUrl))
|
appletAbilities.launchers.addLauncher(get(atm.LauncherUrl))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -763,9 +763,9 @@ PlasmaComponents.ContextMenu {
|
|||||||
result.clicked.connect(
|
result.clicked.connect(
|
||||||
function() {
|
function() {
|
||||||
if (result.checked) {
|
if (result.checked) {
|
||||||
launchers.addLauncherToActivity(url,id);
|
appletAbilities.launchers.addLauncherToActivity(url,id);
|
||||||
} else {
|
} else {
|
||||||
launchers.removeLauncherFromActivity(url, id);
|
appletAbilities.launchers.removeLauncherFromActivity(url, id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -813,7 +813,7 @@ PlasmaComponents.ContextMenu {
|
|||||||
icon: "window-unpin"
|
icon: "window-unpin"
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
launchers.removeLauncher(get(atm.LauncherUrlWithoutIcon));
|
appletAbilities.launchers.removeLauncher(get(atm.LauncherUrlWithoutIcon));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -835,9 +835,9 @@ PlasmaComponents.ContextMenu {
|
|||||||
var pos=visualParent.itemIndex;
|
var pos=visualParent.itemIndex;
|
||||||
|
|
||||||
if (!visualParent.tailItemIsSeparator) {
|
if (!visualParent.tailItemIsSeparator) {
|
||||||
launchers.addInternalSeparatorAtPos(pos);
|
appletAbilities.launchers.addInternalSeparatorAtPos(pos);
|
||||||
} else {
|
} else {
|
||||||
launchers.addInternalSeparatorAtPos(pos+1);
|
appletAbilities.launchers.addInternalSeparatorAtPos(pos+1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -851,9 +851,9 @@ PlasmaComponents.ContextMenu {
|
|||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (visualParent.tailItemIsSeparator) {
|
if (visualParent.tailItemIsSeparator) {
|
||||||
launchers.removeInternalSeparatorAtPos(visualParent.itemIndex - 1);
|
appletAbilities.launchers.removeInternalSeparatorAtPos(visualParent.itemIndex - 1);
|
||||||
} else if (visualParent.headItemIsSeparator) {
|
} else if (visualParent.headItemIsSeparator) {
|
||||||
launchers.removeInternalSeparatorAtPos(visualParent.itemIndex + 1);
|
appletAbilities.launchers.removeInternalSeparatorAtPos(visualParent.itemIndex + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -947,7 +947,7 @@ PlasmaComponents.ContextMenu {
|
|||||||
icon: "window-close"
|
icon: "window-close"
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (parabolic.factor.zoom>1) {
|
if (appletAbilities.parabolic.factor.zoom>1) {
|
||||||
delayWindowRemovalTimer.modelIndex = menu.modelIndex;
|
delayWindowRemovalTimer.modelIndex = menu.modelIndex;
|
||||||
delayWindowRemovalTimer.start();
|
delayWindowRemovalTimer.start();
|
||||||
} else {
|
} else {
|
||||||
|
@ -343,7 +343,7 @@ Item {
|
|||||||
|
|
||||||
//! Connections
|
//! Connections
|
||||||
Connections {
|
Connections {
|
||||||
target: launchers
|
target: appletAbilities.launchers
|
||||||
onLauncherInRemoving: tasksExtManager.addToBeRemovedLauncher(launcherUrl);
|
onLauncherInRemoving: tasksExtManager.addToBeRemovedLauncher(launcherUrl);
|
||||||
onLauncherInAdding: tasksExtManager.addToBeAddedLauncher(launcherUrl);
|
onLauncherInAdding: tasksExtManager.addToBeAddedLauncher(launcherUrl);
|
||||||
onLauncherInMoving: tasksExtManager.addLauncherToBeMoved(launcherUrl, pos);
|
onLauncherInMoving: tasksExtManager.addLauncherToBeMoved(launcherUrl, pos);
|
||||||
|
@ -28,22 +28,28 @@ ClientAbility.Indexer {
|
|||||||
id: _indexer
|
id: _indexer
|
||||||
property Item layout: null
|
property Item layout: null
|
||||||
|
|
||||||
readonly property bool tailAppletIsSeparator: isActive ? bridge.indexer.tailAppletIsSeparator : false
|
|
||||||
readonly property bool headAppletIsSeparator: isActive ? bridge.indexer.headAppletIsSeparator : false
|
|
||||||
|
|
||||||
property bool updateIsBlocked: false
|
property bool updateIsBlocked: false
|
||||||
|
|
||||||
property int visibleItemsCount: 0
|
|
||||||
property int itemsCount: 0 /*is needed to be set from consumer developer in order to avoid binding loops warnings*/
|
property int itemsCount: 0 /*is needed to be set from consumer developer in order to avoid binding loops warnings*/
|
||||||
|
|
||||||
property int firstVisibleItemIndex: -1
|
readonly property bool tailAppletIsSeparator: isActive ? bridge.indexer.tailAppletIsSeparator : false
|
||||||
property int lastVisibleItemIndex: -1
|
readonly property bool headAppletIsSeparator: isActive ? bridge.indexer.headAppletIsSeparator : false
|
||||||
|
|
||||||
readonly property bool isReady: (layout && layout.children.length >= itemsCount) && !updateIsBlocked
|
readonly property bool isReady: (layout && layout.children.length >= itemsCount) && !updateIsBlocked
|
||||||
readonly property int maxIndex: 99999
|
readonly property int maxIndex: 99999
|
||||||
|
|
||||||
|
readonly property alias visibleItemsCount: _privates.visibleItemsCount
|
||||||
|
readonly property alias firstVisibleItemIndex: _privates.firstVisibleItemIndex
|
||||||
|
readonly property alias lastVisibleItemIndex: _privates.lastVisibleItemIndex
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: _privates
|
||||||
|
property int firstVisibleItemIndex: -1
|
||||||
|
property int lastVisibleItemIndex: -1
|
||||||
|
property int visibleItemsCount: 0
|
||||||
|
}
|
||||||
|
|
||||||
Binding {
|
Binding {
|
||||||
target: _indexer
|
target: _privates
|
||||||
property: "firstVisibleItemIndex"
|
property: "firstVisibleItemIndex"
|
||||||
when: isReady
|
when: isReady
|
||||||
value: {
|
value: {
|
||||||
@ -63,7 +69,7 @@ ClientAbility.Indexer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Binding {
|
Binding {
|
||||||
target: _indexer
|
target: _privates
|
||||||
property: "lastVisibleItemIndex"
|
property: "lastVisibleItemIndex"
|
||||||
when: isReady
|
when: isReady
|
||||||
value: {
|
value: {
|
||||||
@ -86,7 +92,7 @@ ClientAbility.Indexer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Binding {
|
Binding {
|
||||||
target: _indexer
|
target: _privates
|
||||||
property: "visibleItemsCount"
|
property: "visibleItemsCount"
|
||||||
value: {
|
value: {
|
||||||
var count = 0;
|
var count = 0;
|
||||||
|
@ -107,7 +107,8 @@ LatteComponents.IndicatorItem{
|
|||||||
|
|
||||||
size: root.size
|
size: root.size
|
||||||
glow3D: glow3D
|
glow3D: glow3D
|
||||||
animation: Math.max(1.65*3*animations.duration.large,indicator.durationTime*3*animations.duration.large)
|
animation: Math.max(1.65 * 3 * appletAbilities.animations.duration.large,
|
||||||
|
3 * indicator.durationTime * appletAbilities.animations.duration.large)
|
||||||
location: plasmoid.location
|
location: plasmoid.location
|
||||||
glowOpacity: root.glowOpacity
|
glowOpacity: root.glowOpacity
|
||||||
contrastColor: indicator.shadowColor
|
contrastColor: indicator.shadowColor
|
||||||
@ -128,7 +129,7 @@ LatteComponents.IndicatorItem{
|
|||||||
property int stateWidth: indicator.isGroup ? root.width - secondPoint.width : root.width - spacer.width
|
property int stateWidth: indicator.isGroup ? root.width - secondPoint.width : root.width - spacer.width
|
||||||
property int stateHeight: indicator.isGroup ? root.height - secondPoint.height : root.width - spacer.height
|
property int stateHeight: indicator.isGroup ? root.height - secondPoint.height : root.width - spacer.height
|
||||||
|
|
||||||
property int animationTime: indicator.durationTime* (0.7*animations.duration.large)
|
property int animationTime: indicator.durationTime* (0.7 * appletAbilities.animations.duration.large)
|
||||||
|
|
||||||
property bool isActive: indicator.hasActive || indicator.isActive
|
property bool isActive: indicator.hasActive || indicator.isActive
|
||||||
|
|
||||||
@ -222,7 +223,8 @@ LatteComponents.IndicatorItem{
|
|||||||
|
|
||||||
size: root.size
|
size: root.size
|
||||||
glow3D: glow3D
|
glow3D: glow3D
|
||||||
animation: Math.max(1.65*3*animations.duration.large,indicator.durationTime*3*animations.duration.large)
|
animation: Math.max(1.65 * 3 * appletAbilities.animations.duration.large,
|
||||||
|
3 * indicator.durationTime * appletAbilities.animations.duration.large)
|
||||||
location: plasmoid.location
|
location: plasmoid.location
|
||||||
glowOpacity: root.glowOpacity
|
glowOpacity: root.glowOpacity
|
||||||
contrastColor: indicator.shadowColor
|
contrastColor: indicator.shadowColor
|
||||||
|
@ -100,11 +100,11 @@ Item {
|
|||||||
property int tasksStarting: 0
|
property int tasksStarting: 0
|
||||||
|
|
||||||
///Don't use Math.floor it adds one pixel in animations and creates glitches
|
///Don't use Math.floor it adds one pixel in animations and creates glitches
|
||||||
property int widthMargins: root.vertical ? metrics.totals.thicknessEdges : metrics.totals.lengthEdges
|
property int widthMargins: root.vertical ? appletAbilities.metrics.totals.thicknessEdges : appletAbilities.metrics.totals.lengthEdges
|
||||||
property int heightMargins: !root.vertical ? metrics.totals.thicknessEdges : metrics.totals.lengthEdges
|
property int heightMargins: !root.vertical ? appletAbilities.metrics.totals.thicknessEdges : appletAbilities.metrics.totals.lengthEdges
|
||||||
|
|
||||||
property int internalWidthMargins: root.vertical ? metrics.totals.thicknessEdges : metrics.totals.lengthPaddings
|
property int internalWidthMargins: root.vertical ? appletAbilities.metrics.totals.thicknessEdges : appletAbilities.metrics.totals.lengthPaddings
|
||||||
property int internalHeightMargins: !root.vertical ? metrics.totals.thicknessEdges : metrics.totals.lengthPaddings
|
property int internalHeightMargins: !root.vertical ? appletAbilities.metrics.totals.thicknessEdges : appletAbilities.metrics.totals.lengthPaddings
|
||||||
|
|
||||||
property real textColorBrightness: ColorizerTools.colorBrightness(themeTextColor)
|
property real textColorBrightness: ColorizerTools.colorBrightness(themeTextColor)
|
||||||
|
|
||||||
@ -125,13 +125,7 @@ Item {
|
|||||||
property Item dragSource: null
|
property Item dragSource: null
|
||||||
|
|
||||||
property Item tasksExtendedManager: _tasksExtendedManager
|
property Item tasksExtendedManager: _tasksExtendedManager
|
||||||
readonly property alias animations: _animations
|
readonly property alias appletAbilities: _appletAbilities
|
||||||
readonly property alias debug: _debug
|
|
||||||
readonly property alias indexer: _indexer
|
|
||||||
readonly property alias launchers: _launchers
|
|
||||||
readonly property alias metrics: _metrics
|
|
||||||
readonly property alias parabolic: _parabolic
|
|
||||||
readonly property alias shortcuts: _shortcuts
|
|
||||||
|
|
||||||
readonly property alias containsDrag: mouseHandler.containsDrag
|
readonly property alias containsDrag: mouseHandler.containsDrag
|
||||||
readonly property bool dragAreaEnabled: latteView ? (root.dragSource !== null
|
readonly property bool dragAreaEnabled: latteView ? (root.dragSource !== null
|
||||||
@ -208,7 +202,7 @@ Item {
|
|||||||
|
|
||||||
readonly property real currentPanelOpacity: latteView ? latteView.currentPanelTransparency / 100 : 1
|
readonly property real currentPanelOpacity: latteView ? latteView.currentPanelTransparency / 100 : 1
|
||||||
|
|
||||||
property int appShadowSize: latteView ? latteView.appShadowSize : Math.ceil(0.12*metrics.iconSize)
|
property int appShadowSize: latteView ? latteView.appShadowSize : Math.ceil(0.12*appletAbilities.metrics.iconSize)
|
||||||
property string appShadowColor: latteView ? latteView.appShadowColor : "#ff080808"
|
property string appShadowColor: latteView ? latteView.appShadowColor : "#ff080808"
|
||||||
property string appShadowColorSolid: latteView ? latteView.appShadowColorSolid : "#ff080808"
|
property string appShadowColorSolid: latteView ? latteView.appShadowColorSolid : "#ff080808"
|
||||||
|
|
||||||
@ -423,7 +417,7 @@ Item {
|
|||||||
//! triggered together.
|
//! triggered together.
|
||||||
if (containsMouse) {
|
if (containsMouse) {
|
||||||
hidePreviewWinTimer.stop();
|
hidePreviewWinTimer.stop();
|
||||||
parabolic.setDirectRenderingEnabled(false);
|
appletAbilities.parabolic.setDirectRenderingEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
hide(7.3);
|
hide(7.3);
|
||||||
}
|
}
|
||||||
@ -522,14 +516,14 @@ Item {
|
|||||||
Timer{
|
Timer{
|
||||||
id: delayWindowRemovalTimer
|
id: delayWindowRemovalTimer
|
||||||
//this is the animation time needed in order for tasks to restore their zoom first
|
//this is the animation time needed in order for tasks to restore their zoom first
|
||||||
interval: 7 * (animations.speedFactor.current * animations.duration.small)
|
interval: 7 * (appletAbilities.animations.speedFactor.current * appletAbilities.animations.duration.small)
|
||||||
|
|
||||||
property var modelIndex
|
property var modelIndex
|
||||||
|
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
tasksModel.requestClose(delayWindowRemovalTimer.modelIndex)
|
tasksModel.requestClose(delayWindowRemovalTimer.modelIndex)
|
||||||
|
|
||||||
if (debug.timersEnabled) {
|
if (appletAbilities.debug.timersEnabled) {
|
||||||
console.log("plasmoid timer: delayWindowRemovalTimer called...");
|
console.log("plasmoid timer: delayWindowRemovalTimer called...");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -543,7 +537,7 @@ Item {
|
|||||||
root.publishTasksGeometries();
|
root.publishTasksGeometries();
|
||||||
activityInfo.previousActivity = activityInfo.currentActivity;
|
activityInfo.previousActivity = activityInfo.currentActivity;
|
||||||
|
|
||||||
if (debug.timersEnabled) {
|
if (appletAbilities.debug.timersEnabled) {
|
||||||
console.log("plasmoid timer: activityChangeDelayer called...");
|
console.log("plasmoid timer: activityChangeDelayer called...");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -584,11 +578,11 @@ Item {
|
|||||||
property bool anyTaskDemandsAttentionInValidTime: false
|
property bool anyTaskDemandsAttentionInValidTime: false
|
||||||
|
|
||||||
function updateLaunchersList(){
|
function updateLaunchersList(){
|
||||||
if (latteView && !launchers.inUniqueGroup()) {
|
if (latteView && !appletAbilities.launchers.inUniqueGroup()) {
|
||||||
if (launchers.inLayoutGroup()) {
|
if (appletAbilities.launchers.inLayoutGroup()) {
|
||||||
console.log("Tasks: Applying LAYOUT Launchers List...");
|
console.log("Tasks: Applying LAYOUT Launchers List...");
|
||||||
tasksModel.launcherList = latteView.viewLayout.launchers;
|
tasksModel.launcherList = latteView.viewLayout.launchers;
|
||||||
} else if (launchers.inGlobalGroup()) {
|
} else if (appletAbilities.launchers.inGlobalGroup()) {
|
||||||
console.log("Tasks: Applying GLOBAL Launchers List...");
|
console.log("Tasks: Applying GLOBAL Launchers List...");
|
||||||
tasksModel.launcherList = latteView.universalSettings.launchers;
|
tasksModel.launcherList = latteView.universalSettings.launchers;
|
||||||
}
|
}
|
||||||
@ -626,10 +620,10 @@ Item {
|
|||||||
//var loadedLaunchers = ActivitiesTools.restoreLaunchers();
|
//var loadedLaunchers = ActivitiesTools.restoreLaunchers();
|
||||||
ActivitiesTools.importLaunchersToNewArchitecture();
|
ActivitiesTools.importLaunchersToNewArchitecture();
|
||||||
|
|
||||||
if (viewLayout && latteView.universalSettings && !launchers.inUniqueGroup()) {
|
if (viewLayout && latteView.universalSettings && !appletAbilities.launchers.inUniqueGroup()) {
|
||||||
if (launchers.inLayoutGroup()) {
|
if (appletAbilities.launchers.inLayoutGroup()) {
|
||||||
launcherList = latteView.viewLayout.launchers;
|
launcherList = latteView.viewLayout.launchers;
|
||||||
} else if (launchers.inGlobalGroup()) {
|
} else if (appletAbilities.launchers.inGlobalGroup()) {
|
||||||
launcherList = latteView.universalSettings.launchers;
|
launcherList = latteView.universalSettings.launchers;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -795,71 +789,38 @@ Item {
|
|||||||
id: _tasksExtendedManager
|
id: _tasksExtendedManager
|
||||||
}
|
}
|
||||||
|
|
||||||
Ability.Animations {
|
AppletAbilities {
|
||||||
id: _animations
|
id: _appletAbilities
|
||||||
bridge: latteBridge
|
bridge: latteBridge
|
||||||
}
|
|
||||||
|
|
||||||
ClientAbility.Debug {
|
|
||||||
id: _debug
|
|
||||||
bridge: latteBridge
|
|
||||||
}
|
|
||||||
|
|
||||||
Ability.Indexer {
|
|
||||||
id: _indexer
|
|
||||||
bridge: latteBridge
|
|
||||||
layout: icList.contentItem
|
|
||||||
itemsCount: tasksModel.count
|
|
||||||
updateIsBlocked: root.inDraggingPhase
|
|
||||||
}
|
|
||||||
|
|
||||||
Ability.Launchers {
|
|
||||||
id: _launchers
|
|
||||||
bridge: latteBridge
|
|
||||||
group: plasmoid.configuration.launchersGroup
|
|
||||||
layout: icList.contentItem
|
layout: icList.contentItem
|
||||||
tasksModel: tasksModel
|
tasksModel: tasksModel
|
||||||
syncer.isBlocked: inDraggingPhase
|
|
||||||
syncer.layoutName: viewLayoutName
|
|
||||||
}
|
|
||||||
|
|
||||||
Ability.Metrics {
|
indexer.itemsCount: tasksModel.count
|
||||||
id: _metrics
|
indexer.updateIsBlocked: root.inDraggingPhase
|
||||||
bridge: latteBridge
|
|
||||||
}
|
|
||||||
|
|
||||||
Ability.ParabolicEffect {
|
launchers.group: plasmoid.configuration.launchersGroup
|
||||||
id: _parabolic
|
launchers.syncer.isBlocked: inDraggingPhase
|
||||||
bridge: latteBridge
|
launchers.syncer.layoutName: viewLayoutName
|
||||||
itemsCount: tasksModel.count
|
|
||||||
layout: icList.contentItem
|
|
||||||
local.isEnabled: factor.zoom > 1
|
|
||||||
local.restoreZoomIsBlocked: root.contextMenu || windowsPreviewDlg.containsMouse
|
|
||||||
}
|
|
||||||
|
|
||||||
Ability.PositionShortcuts {
|
parabolic.itemsCount: tasksModel.count
|
||||||
id: _shortcuts
|
parabolic.local.isEnabled: parabolic.factor.zoom > 1
|
||||||
bridge: latteBridge
|
parabolic.local.restoreZoomIsBlocked: root.contextMenu || windowsPreviewDlg.containsMouse
|
||||||
isStealingGlobalPositionShortcuts: plasmoid.configuration.isPreferredForPositionShortcuts
|
|
||||||
|
shortcuts.isStealingGlobalPositionShortcuts: plasmoid.configuration.isPreferredForPositionShortcuts
|
||||||
|
|
||||||
|
requires.activeIndicatorEnabled: false
|
||||||
|
requires.lengthMarginsEnabled: false
|
||||||
|
requires.latteSideColoringEnabled: false
|
||||||
|
requires.screenEdgeMarginSupported: true
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: _appletAbilities.shortcuts
|
||||||
|
|
||||||
onDisabledIsStealingGlobalPositionShortcuts: {
|
onDisabledIsStealingGlobalPositionShortcuts: {
|
||||||
plasmoid.configuration.isPreferredForPositionShortcuts = false;
|
plasmoid.configuration.isPreferredForPositionShortcuts = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ClientAbility.Requirements{
|
|
||||||
id: _requires
|
|
||||||
bridge: latteBridge
|
|
||||||
|
|
||||||
activeIndicatorEnabled: false
|
|
||||||
lengthMarginsEnabled: false
|
|
||||||
latteSideColoringEnabled: false
|
|
||||||
screenEdgeMarginSupported: true
|
|
||||||
}
|
|
||||||
|
|
||||||
Ability.UserRequests {
|
|
||||||
id: _userRequests
|
|
||||||
bridge: latteBridge
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
@ -871,7 +832,7 @@ Item {
|
|||||||
tasksModel.anyTaskDemandsAttentionInValidTime = false;
|
tasksModel.anyTaskDemandsAttentionInValidTime = false;
|
||||||
destroy();
|
destroy();
|
||||||
|
|
||||||
if (debug.timersEnabled) {
|
if (appletAbilities.debug.timersEnabled) {
|
||||||
console.log("plasmoid timer: attentionTimer called...");
|
console.log("plasmoid timer: attentionTimer called...");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -896,15 +857,15 @@ Item {
|
|||||||
anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined
|
anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined
|
||||||
anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined
|
anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined
|
||||||
|
|
||||||
width: root.vertical ? 1 : 2 * metrics.iconSize
|
width: root.vertical ? 1 : 2 * appletAbilities.metrics.iconSize
|
||||||
height: root.vertical ? 2 * metrics.iconSize : 1
|
height: root.vertical ? 2 * appletAbilities.metrics.iconSize : 1
|
||||||
color: "red"
|
color: "red"
|
||||||
x: (root.location === PlasmaCore.Types.LeftEdge) ? neededSpace : parent.width - neededSpace
|
x: (root.location === PlasmaCore.Types.LeftEdge) ? neededSpace : parent.width - neededSpace
|
||||||
y: (root.location === PlasmaCore.Types.TopEdge) ? neededSpace : parent.height - neededSpace
|
y: (root.location === PlasmaCore.Types.TopEdge) ? neededSpace : parent.height - neededSpace
|
||||||
|
|
||||||
visible: plasmoid.configuration.zoomHelper
|
visible: plasmoid.configuration.zoomHelper
|
||||||
|
|
||||||
property int neededSpace: parabolic.factor.zoom*metrics.totals.length
|
property int neededSpace: appletAbilities.parabolic.factor.zoom*appletAbilities.metrics.totals.length
|
||||||
}
|
}
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
@ -920,11 +881,11 @@ Item {
|
|||||||
width: ( icList.orientation === Qt.Horizontal ) ? icList.width + spacing : smallSize
|
width: ( icList.orientation === Qt.Horizontal ) ? icList.width + spacing : smallSize
|
||||||
height: ( icList.orientation === Qt.Vertical ) ? icList.height + spacing : smallSize
|
height: ( icList.orientation === Qt.Vertical ) ? icList.height + spacing : smallSize
|
||||||
|
|
||||||
property int spacing: latteBridge ? 0 : metrics.iconSize / 2
|
property int spacing: latteBridge ? 0 : appletAbilities.metrics.iconSize / 2
|
||||||
property int smallSize: Math.max(0.10 * metrics.iconSize, 16)
|
property int smallSize: Math.max(0.10 * appletAbilities.metrics.iconSize, 16)
|
||||||
|
|
||||||
Behavior on opacity{
|
Behavior on opacity{
|
||||||
NumberAnimation { duration: animations.speedFactor.current*animations.duration.large }
|
NumberAnimation { duration: appletAbilities.animations.speedFactor.current * appletAbilities.animations.duration.large }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// plasmoid's default panel
|
/// plasmoid's default panel
|
||||||
@ -941,7 +902,7 @@ Item {
|
|||||||
verticalTileMode: BorderImage.Stretch
|
verticalTileMode: BorderImage.Stretch
|
||||||
|
|
||||||
Behavior on opacity{
|
Behavior on opacity{
|
||||||
NumberAnimation { duration: animations.speedFactor.current*animations.duration.large }
|
NumberAnimation { duration: appletAbilities.animations.speedFactor.current * appletAbilities.animations.duration.large }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -987,7 +948,7 @@ Item {
|
|||||||
plasmoid.configuration.panelSize + belower.width
|
plasmoid.configuration.panelSize + belower.width
|
||||||
|
|
||||||
Behavior on opacity{
|
Behavior on opacity{
|
||||||
NumberAnimation { duration: animations.speedFactor.current*animations.duration.large }
|
NumberAnimation { duration: appletAbilities.animations.speedFactor.current * appletAbilities.animations.duration.large }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1017,8 +978,8 @@ Item {
|
|||||||
|
|
||||||
visible: root.dragAreaEnabled
|
visible: root.dragAreaEnabled
|
||||||
|
|
||||||
property int maxThickness: (parabolic.isHovered || windowPreviewIsShown || animations.hasThicknessAnimation) ?
|
property int maxThickness: (appletAbilities.parabolic.isHovered || windowPreviewIsShown || appletAbilities.animations.hasThicknessAnimation) ?
|
||||||
metrics.mask.thickness.zoomedForItems : metrics.mask.thickness.normalForItems
|
appletAbilities.metrics.mask.thickness.zoomedForItems : appletAbilities.metrics.mask.thickness.normalForItems
|
||||||
|
|
||||||
function onlyLaunchersInDroppedList(list){
|
function onlyLaunchersInDroppedList(list){
|
||||||
return list.every(function (item) {
|
return list.every(function (item) {
|
||||||
@ -1029,7 +990,7 @@ Item {
|
|||||||
onUrlsDropped: {
|
onUrlsDropped: {
|
||||||
//! inform synced docks for new dropped launchers
|
//! inform synced docks for new dropped launchers
|
||||||
if (onlyLaunchersInDroppedList(urls)) {
|
if (onlyLaunchersInDroppedList(urls)) {
|
||||||
launchers.addDroppedLaunchers(urls);
|
appletAbilities.launchers.addDroppedLaunchers(urls);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1082,10 +1043,10 @@ Item {
|
|||||||
when: latteView && !latteView.maskManager.inRelocationHiding
|
when: latteView && !latteView.maskManager.inRelocationHiding
|
||||||
value: {
|
value: {
|
||||||
if (latteView) {
|
if (latteView) {
|
||||||
return animations.hasThicknessAnimation ? metrics.mask.thickness.zoomed : metrics.mask.thickness.normal;
|
return appletAbilities.animations.hasThicknessAnimation ? appletAbilities.metrics.mask.thickness.zoomed : appletAbilities.metrics.mask.thickness.normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
return metrics.totals.thickness * parabolic.factor.zoom;
|
return appletAbilities.metrics.totals.thickness * appletAbilities.parabolic.factor.zoom;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1120,14 +1081,14 @@ Item {
|
|||||||
boundsBehavior: Flickable.StopAtBounds
|
boundsBehavior: Flickable.StopAtBounds
|
||||||
orientation: plasmoid.formFactor === PlasmaCore.Types.Vertical ? Qt.Vertical : Qt.Horizontal
|
orientation: plasmoid.formFactor === PlasmaCore.Types.Vertical ? Qt.Vertical : Qt.Horizontal
|
||||||
delegate: Task.TaskItem{
|
delegate: Task.TaskItem{
|
||||||
animations: _animations
|
animations: appletAbilities.animations
|
||||||
debug: _debug
|
debug: appletAbilities.debug
|
||||||
indexer: _indexer
|
indexer: appletAbilities.indexer
|
||||||
launchers: _launchers
|
launchers: appletAbilities.launchers
|
||||||
metrics: _metrics
|
metrics: appletAbilities.metrics
|
||||||
parabolic: _parabolic
|
parabolic: appletAbilities.parabolic
|
||||||
requires: _requires
|
requires: appletAbilities.requires
|
||||||
shortcuts: _shortcuts
|
shortcuts: appletAbilities.shortcuts
|
||||||
}
|
}
|
||||||
|
|
||||||
property int currentSpot : -1000
|
property int currentSpot : -1000
|
||||||
@ -1142,7 +1103,7 @@ Item {
|
|||||||
|
|
||||||
//more of a trouble
|
//more of a trouble
|
||||||
moveDisplaced: Transition {
|
moveDisplaced: Transition {
|
||||||
NumberAnimation { properties: "x,y"; duration: animations.speedFactor.current*animations.duration.large; easing.type: Easing.Linear }
|
NumberAnimation { properties: "x,y"; duration: appletAbilities.animations.speedFactor.current * appletAbilities.animations.duration.large; easing.type: Easing.Linear }
|
||||||
}
|
}
|
||||||
|
|
||||||
///this transition can not be used with dragging !!!! I breaks
|
///this transition can not be used with dragging !!!! I breaks
|
||||||
@ -1200,13 +1161,13 @@ Item {
|
|||||||
|
|
||||||
LatteComponents.AddingArea {
|
LatteComponents.AddingArea {
|
||||||
id: newDroppedLauncherVisual
|
id: newDroppedLauncherVisual
|
||||||
width: root.vertical ? metrics.totals.thickness : scrollableList.width
|
width: root.vertical ? appletAbilities.metrics.totals.thickness : scrollableList.width
|
||||||
height: root.vertical ? scrollableList.height : metrics.totals.thickness
|
height: root.vertical ? scrollableList.height : appletAbilities.metrics.totals.thickness
|
||||||
|
|
||||||
visible: backgroundOpacity > 0
|
visible: backgroundOpacity > 0
|
||||||
radius: metrics.iconSize/10
|
radius: appletAbilities.metrics.iconSize/10
|
||||||
backgroundOpacity: root.dropNewLauncher && mouseHandler.onlyLaunchers && (root.dragSource == null)? 0.75 : 0
|
backgroundOpacity: root.dropNewLauncher && mouseHandler.onlyLaunchers && (root.dragSource == null)? 0.75 : 0
|
||||||
duration: animations.speedFactor.current
|
duration: appletAbilities.animations.speedFactor.current
|
||||||
|
|
||||||
title: i18n("Tasks Area")
|
title: i18n("Tasks Area")
|
||||||
|
|
||||||
@ -1224,7 +1185,7 @@ Item {
|
|||||||
|
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: newDroppedLauncherVisual
|
target: newDroppedLauncherVisual
|
||||||
anchors{ topMargin:0; bottomMargin:0; leftMargin:metrics.margin.screenEdge; rightMargin:0;}
|
anchors{ topMargin:0; bottomMargin:0; leftMargin: appletAbilities.metrics.margin.screenEdge; rightMargin:0;}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
@ -1239,7 +1200,7 @@ Item {
|
|||||||
|
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: newDroppedLauncherVisual
|
target: newDroppedLauncherVisual
|
||||||
anchors{ topMargin:0; bottomMargin:0; leftMargin:0; rightMargin:metrics.margin.screenEdge;}
|
anchors{ topMargin:0; bottomMargin:0; leftMargin:0; rightMargin: appletAbilities.metrics.margin.screenEdge;}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
@ -1254,7 +1215,7 @@ Item {
|
|||||||
|
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: newDroppedLauncherVisual
|
target: newDroppedLauncherVisual
|
||||||
anchors{ topMargin:metrics.margin.screenEdge; bottomMargin:0; leftMargin:0; rightMargin:0;}
|
anchors{ topMargin: appletAbilities.metrics.margin.screenEdge; bottomMargin:0; leftMargin:0; rightMargin:0;}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
@ -1271,7 +1232,7 @@ Item {
|
|||||||
|
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: newDroppedLauncherVisual
|
target: newDroppedLauncherVisual
|
||||||
anchors{ topMargin:0; bottomMargin:metrics.margin.screenEdge; leftMargin:0; rightMargin:0;}
|
anchors{ topMargin:0; bottomMargin: appletAbilities.metrics.margin.screenEdge; leftMargin:0; rightMargin:0;}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -1289,7 +1250,7 @@ Item {
|
|||||||
onTriggered: {
|
onTriggered: {
|
||||||
root.publishTasksGeometries();
|
root.publishTasksGeometries();
|
||||||
|
|
||||||
if (debug.timersEnabled) {
|
if (appletAbilities.debug.timersEnabled) {
|
||||||
console.log("plasmoid timer: iconGeometryTimer called...");
|
console.log("plasmoid timer: iconGeometryTimer called...");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1343,12 +1304,12 @@ Item {
|
|||||||
//// functions
|
//// functions
|
||||||
function activateTaskAtIndex(index) {
|
function activateTaskAtIndex(index) {
|
||||||
// This is called with Meta+number shortcuts by plasmashell when Tasks are in a plasma panel.
|
// This is called with Meta+number shortcuts by plasmashell when Tasks are in a plasma panel.
|
||||||
shortcuts.sglActivateEntryAtIndex(index);
|
appletAbilities.shortcuts.sglActivateEntryAtIndex(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
function newInstanceForTaskAtIndex(index) {
|
function newInstanceForTaskAtIndex(index) {
|
||||||
// This is called with Meta+Alt+number shortcuts by plasmashell when Tasks are in a plasma panel.
|
// This is called with Meta+Alt+number shortcuts by plasmashell when Tasks are in a plasma panel.
|
||||||
shortcuts.sglNewInstanceForEntryAtIndex(index);
|
appletAbilities.shortcuts.sglNewInstanceForEntryAtIndex(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getBadger(identifier) {
|
function getBadger(identifier) {
|
||||||
|
@ -66,8 +66,8 @@ Item {
|
|||||||
readonly property real panelOpacity: root.currentPanelOpacity
|
readonly property real panelOpacity: root.currentPanelOpacity
|
||||||
readonly property color shadowColor: root.appShadowColorSolid
|
readonly property color shadowColor: root.appShadowColorSolid
|
||||||
|
|
||||||
readonly property bool animationsEnabled: taskIsValid ? taskItem.animations.active : animations.active
|
readonly property bool animationsEnabled: taskIsValid ? taskItem.animations.active : appletAbilities.animations.active
|
||||||
readonly property real durationTime: taskIsValid ? taskItem.animations.speedFactor.current : animations.speedFactor.current
|
readonly property real durationTime: taskIsValid ? taskItem.animations.speedFactor.current : appletAbilities.animations.speedFactor.current
|
||||||
|
|
||||||
readonly property bool progressVisible: wrapper.progressVisible /*since 0.9.2*/
|
readonly property bool progressVisible: wrapper.progressVisible /*since 0.9.2*/
|
||||||
readonly property real progress: wrapper.progress /*since 0.9.2*/
|
readonly property real progress: wrapper.progress /*since 0.9.2*/
|
||||||
|
@ -210,9 +210,9 @@ Item {
|
|||||||
if (droppingSeparator) {
|
if (droppingSeparator) {
|
||||||
droppingSeparator = false;
|
droppingSeparator = false;
|
||||||
if (hoveredItem && hoveredItem.itemIndex >=0){
|
if (hoveredItem && hoveredItem.itemIndex >=0){
|
||||||
launchers.addInternalSeparatorAtPos(hoveredItem.itemIndex);
|
appletAbilities.launchers.addInternalSeparatorAtPos(hoveredItem.itemIndex);
|
||||||
} else {
|
} else {
|
||||||
launchers.addInternalSeparatorAtPos(0);
|
appletAbilities.launchers.addInternalSeparatorAtPos(0);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -26,8 +26,8 @@ Item {
|
|||||||
id: shadowsContainer
|
id: shadowsContainer
|
||||||
opacity: 0.4
|
opacity: 0.4
|
||||||
|
|
||||||
readonly property int gradientLength: metrics.iconSize / 3
|
readonly property int gradientLength: appletAbilities.metrics.iconSize / 3
|
||||||
readonly property int thickness: metrics.backgroundThickness
|
readonly property int thickness: appletAbilities.metrics.backgroundThickness
|
||||||
readonly property color appliedColor: root.appShadowColorSolid
|
readonly property color appliedColor: root.appShadowColorSolid
|
||||||
|
|
||||||
property Item flickable
|
property Item flickable
|
||||||
@ -81,7 +81,7 @@ Item {
|
|||||||
}
|
}
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: shadowsContainer
|
target: shadowsContainer
|
||||||
anchors.leftMargin: 0; anchors.rightMargin:0; anchors.topMargin: 0; anchors.bottomMargin: metrics.margin.screenEdge;
|
anchors.leftMargin: 0; anchors.rightMargin:0; anchors.topMargin: 0; anchors.bottomMargin: appletAbilities.metrics.margin.screenEdge;
|
||||||
anchors.horizontalCenterOffset: 0; anchors.verticalCenterOffset: 0;
|
anchors.horizontalCenterOffset: 0; anchors.verticalCenterOffset: 0;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -106,7 +106,7 @@ Item {
|
|||||||
}
|
}
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: shadowsContainer
|
target: shadowsContainer
|
||||||
anchors.leftMargin: 0; anchors.rightMargin:0; anchors.topMargin: metrics.margin.screenEdge; anchors.bottomMargin:0;
|
anchors.leftMargin: 0; anchors.rightMargin:0; anchors.topMargin: appletAbilities.metrics.margin.screenEdge; anchors.bottomMargin:0;
|
||||||
anchors.horizontalCenterOffset: 0; anchors.verticalCenterOffset: 0;
|
anchors.horizontalCenterOffset: 0; anchors.verticalCenterOffset: 0;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -131,7 +131,7 @@ Item {
|
|||||||
}
|
}
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: shadowsContainer
|
target: shadowsContainer
|
||||||
anchors.leftMargin: metrics.margin.screenEdge; anchors.rightMargin:0; anchors.topMargin: 0; anchors.bottomMargin:0;
|
anchors.leftMargin: appletAbilities.metrics.margin.screenEdge; anchors.rightMargin:0; anchors.topMargin: 0; anchors.bottomMargin:0;
|
||||||
anchors.horizontalCenterOffset: 0; anchors.verticalCenterOffset: 0;
|
anchors.horizontalCenterOffset: 0; anchors.verticalCenterOffset: 0;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -156,7 +156,7 @@ Item {
|
|||||||
}
|
}
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: shadowsContainer
|
target: shadowsContainer
|
||||||
anchors.leftMargin: 0; anchors.rightMargin: metrics.margin.screenEdge; anchors.topMargin: 0; anchors.bottomMargin:0;
|
anchors.leftMargin: 0; anchors.rightMargin: appletAbilities.metrics.margin.screenEdge; anchors.topMargin: 0; anchors.bottomMargin:0;
|
||||||
anchors.horizontalCenterOffset: 0; anchors.verticalCenterOffset: 0;
|
anchors.horizontalCenterOffset: 0; anchors.verticalCenterOffset: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ import org.kde.plasma.core 2.0 as PlasmaCore
|
|||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
||||||
readonly property int gradientLength: metrics.iconSize / 3
|
readonly property int gradientLength: appletAbilities.metrics.iconSize / 3
|
||||||
|
|
||||||
LinearGradient {
|
LinearGradient {
|
||||||
id: firstGradient
|
id: firstGradient
|
||||||
|
@ -56,10 +56,10 @@ Flickable{
|
|||||||
|
|
||||||
readonly property int scrollFirstPos: 0
|
readonly property int scrollFirstPos: 0
|
||||||
readonly property int scrollLastPos: contentsExtraSpace
|
readonly property int scrollLastPos: contentsExtraSpace
|
||||||
readonly property int scrollStep: metrics.totals.length * 3.5
|
readonly property int scrollStep: appletAbilities.metrics.totals.length * 3.5
|
||||||
readonly property int currentPos: !root.vertical ? contentX : contentY
|
readonly property int currentPos: !root.vertical ? contentX : contentY
|
||||||
|
|
||||||
readonly property int autoScrollTriggerLength: metrics.iconSize + metrics.totals.lengthEdge
|
readonly property int autoScrollTriggerLength: appletAbilities.metrics.iconSize + appletAbilities.metrics.totals.lengthEdge
|
||||||
|
|
||||||
readonly property int alignment: {
|
readonly property int alignment: {
|
||||||
if (root.location === PlasmaCore.Types.LeftEdge) {
|
if (root.location === PlasmaCore.Types.LeftEdge) {
|
||||||
@ -140,18 +140,18 @@ Flickable{
|
|||||||
|
|
||||||
if (!root.vertical) {
|
if (!root.vertical) {
|
||||||
if (cP.x < 0) {
|
if (cP.x < 0) {
|
||||||
distance = Math.abs(cP.x - metrics.iconSize);
|
distance = Math.abs(cP.x - appletAbilities.metrics.iconSize);
|
||||||
decreasePosWithStep(distance);
|
decreasePosWithStep(distance);
|
||||||
} else if ((cP.x+task.width) > scrollableList.width) {
|
} else if ((cP.x+task.width) > scrollableList.width) {
|
||||||
distance = Math.abs(cP.x - scrollableList.width + task.width + metrics.iconSize);
|
distance = Math.abs(cP.x - scrollableList.width + task.width + appletAbilities.metrics.iconSize);
|
||||||
increasePosWithStep(distance);
|
increasePosWithStep(distance);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (cP.y < 0) {
|
if (cP.y < 0) {
|
||||||
distance = Math.abs(cP.y - metrics.iconSize);
|
distance = Math.abs(cP.y - appletAbilities.metrics.iconSize);
|
||||||
decreasePosWithStep(distance);
|
decreasePosWithStep(distance);
|
||||||
} else if ((cP.y+task.height) > scrollableList.height) {
|
} else if ((cP.y+task.height) > scrollableList.height) {
|
||||||
distance = Math.abs(cP.y - scrollableList.height + task.height + metrics.iconSize);
|
distance = Math.abs(cP.y - scrollableList.height + task.height + appletAbilities.metrics.iconSize);
|
||||||
increasePosWithStep(distance);
|
increasePosWithStep(distance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -176,7 +176,7 @@ Flickable{
|
|||||||
|
|
||||||
var cP = task.mapToItem(scrollableList, 0, 0);
|
var cP = task.mapToItem(scrollableList, 0, 0);
|
||||||
|
|
||||||
var localStep = horizontalAnimation.running || verticalAnimation.running ? 3.5 * metrics.totals.length : metrics.totals.length;
|
var localStep = horizontalAnimation.running || verticalAnimation.running ? 3.5 * appletAbilities.metrics.totals.length : appletAbilities.metrics.totals.length;
|
||||||
|
|
||||||
if (!root.vertical) {
|
if (!root.vertical) {
|
||||||
if (currentPos !== scrollFirstPos && cP.x < autoScrollTriggerLength) {
|
if (currentPos !== scrollFirstPos && cP.x < autoScrollTriggerLength) {
|
||||||
@ -213,7 +213,7 @@ Flickable{
|
|||||||
Behavior on contentX {
|
Behavior on contentX {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
id: horizontalAnimation
|
id: horizontalAnimation
|
||||||
duration: animations.speedFactor.current*4.1*animations.duration.large
|
duration: appletAbilities.animations.speedFactor.current*4.1*appletAbilities.animations.duration.large
|
||||||
easing.type: Easing.OutQuad
|
easing.type: Easing.OutQuad
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -221,7 +221,7 @@ Flickable{
|
|||||||
Behavior on contentY {
|
Behavior on contentY {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
id: verticalAnimation
|
id: verticalAnimation
|
||||||
duration: animations.speedFactor.current*4.1*animations.duration.large
|
duration: appletAbilities.animations.speedFactor.current*4.1*appletAbilities.animations.duration.large
|
||||||
easing.type: Easing.OutQuad
|
easing.type: Easing.OutQuad
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user