diff --git a/plasmoid/package/contents/ui/task/IconItem.qml b/plasmoid/package/contents/ui/task/IconItem.qml deleted file mode 100644 index 8f32df181..000000000 --- a/plasmoid/package/contents/ui/task/IconItem.qml +++ /dev/null @@ -1,124 +0,0 @@ -/* -* Copyright 2016 Smith AR -* Michail Vourlakos -* -* 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 . -*/ - -import QtQuick 2.4 -import QtQuick.Layouts 1.1 -import QtGraphicalEffects 1.0 - -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.plasma.plasmoid 2.0 -import org.kde.plasma.private.taskmanager 0.1 as TaskManagerApplet - -import org.kde.kquickcontrolsaddons 2.0 as KQuickControlAddons - -import org.kde.latte.core 0.2 as LatteCore -import org.kde.latte.components 1.0 as LatteComponents - -import "animations" as TaskAnimations - -//I am using KQuickControlAddons.QIconItem even though onExit it triggers the following error -//QObject::~QObject: Timers cannot be stopped from another thread -//but it increases performance almost to double during animation - -Item{ - property Item contentItemContainer: iconImageBuffer - property Item titleTooltipVisualParent: titleTooltipParent - property Item previewsTootipVisualParent: previewsTooltipParent - - TitleTooltipParent{ - id: titleTooltipParent - thickness: taskItem.abilities.parabolic.factor.zoom * taskItem.abilities.metrics.totals.thickness - } - - TitleTooltipParent{ - id: previewsTooltipParent - thickness: (taskItem.abilities.parabolic.factor.zoom * taskItem.abilities.metrics.totals.thickness) - } - - //! - - // KQuickControlAddons.QIconItem{ - Item{ - id: iconGraphic - width: parent.width - height: parent.height - - //fix bug #478, when changing form factor sometimes the tasks are not positioned - //correctly, in such case we make a fast reinitialization for the sizes - Connections { - target: plasmoid - - onFormFactorChanged:{ - taskItem.inAddRemoveAnimation = false; - - wrapper.mScale = 1.01; - wrapper.tempScaleWidth = 1.01; - wrapper.tempScaleHeight = 1.01; - - wrapper.mScale = 1; - wrapper.tempScaleWidth = 1; - wrapper.tempScaleHeight = 1; - } - } - - Item { - id: iconImageBuffer - anchors.centerIn: parent - width: newTempSize - height: width - - property int zoomedSize: taskItem.abilities.parabolic.factor.zoom * taskItem.abilities.metrics.iconSize - - property real basicScalingWidth : wrapper.inTempScaling ? (taskItem.abilities.metrics.iconSize * wrapper.scaleWidth) : - taskItem.abilities.metrics.iconSize * wrapper.mScale - property real basicScalingHeight : wrapper.inTempScaling ? (taskItem.abilities.metrics.iconSize * wrapper.scaleHeight) : - taskItem.abilities.metrics.iconSize * wrapper.mScale - - property real newTempSize: { - if (wrapper.opacity === 1 ) { - return Math.min(basicScalingWidth, basicScalingHeight); - } else { - return Math.max(basicScalingWidth, basicScalingHeight); - } - } - - readonly property Item contentItem: children.length > 0 ? children[0] : null - - - //! Latte Side Painting-style if the user chose it - Loader{ - anchors.fill: iconImageBuffer - active: plasmoid.configuration.forceMonochromaticIcons - - sourceComponent: ColorOverlay { - anchors.fill: parent - color: latteBridge ? latteBridge.palette.textColor : "transparent" - source: iconImageBuffer.contentItem - } - } - //! Latte Side Painting-style if the user chose it - } //IconImageBuffer - - ShortcutBadge{ - id: shortcutBadge - } - } -}// Icon Item diff --git a/plasmoid/package/contents/ui/task/ShortcutBadge.qml b/plasmoid/package/contents/ui/task/ShortcutBadge.qml index d64b8ee68..0c7d555ae 100644 --- a/plasmoid/package/contents/ui/task/ShortcutBadge.qml +++ b/plasmoid/package/contents/ui/task/ShortcutBadge.qml @@ -24,7 +24,6 @@ import org.kde.latte.components 1.0 as LatteComponents Loader{ id: shorcutBadge - anchors.fill: iconImageBuffer active: taskItem.abilities.shortcuts.showPositionShortcutBadges && !taskItem.isSeparator && !taskItem.isHidden && taskItem.abilities.shortcuts.isEnabled asynchronous: true visible: badgeString !== "" diff --git a/plasmoid/package/contents/ui/task/TaskItem.qml b/plasmoid/package/contents/ui/task/TaskItem.qml index 153018d53..6b9c5d478 100644 --- a/plasmoid/package/contents/ui/task/TaskItem.qml +++ b/plasmoid/package/contents/ui/task/TaskItem.qml @@ -184,11 +184,10 @@ Item { readonly property alias hoveredTimer: taskMouseArea.hoveredTimer readonly property alias mouseArea: taskMouseArea readonly property alias tooltipVisualParent: _wrapper.titleTooltipVisualParent - readonly property alias previewsVisualParent: _wrapper.previewsTooltipVisualParent + readonly property alias previewsVisualParent: _wrapper.titleTooltipVisualParent readonly property alias subWindows: subWindows readonly property alias wrapper: _wrapper - readonly property alias showWindowAnimation: _showWindowAnimation readonly property alias restoreAnimation: _restoreAnimation diff --git a/plasmoid/package/contents/ui/task/Wrapper.qml b/plasmoid/package/contents/ui/task/Wrapper.qml index 0aa712cf5..81dcfa0b7 100644 --- a/plasmoid/package/contents/ui/task/Wrapper.qml +++ b/plasmoid/package/contents/ui/task/Wrapper.qml @@ -19,14 +19,13 @@ */ import QtQuick 2.0 +import QtGraphicalEffects 1.0 import org.kde.plasma.core 2.0 as PlasmaCore - import org.kde.latte.core 0.2 as LatteCore Item{ id: wrapper - opacity: 0 width: { if (!taskItem.visible) @@ -98,9 +97,8 @@ Item{ (width + hiddenSpacerLeft.separatorSpace + hiddenSpacerRight.separatorSpace) / 2 : (height + hiddenSpacerLeft.separatorSpace + hiddenSpacerRight.separatorSpace) / 2 - property Item contentItemContainer: taskIconItem.contentItemContainer - property Item titleTooltipVisualParent: taskIconItem.titleTooltipVisualParent - property Item previewsTooltipVisualParent: taskIconItem.previewsTootipVisualParent + readonly property alias contentItemContainer: _contentItemContainer + readonly property alias titleTooltipVisualParent: _titleTooltipVisualParent signal runLauncherAnimation(); @@ -126,8 +124,7 @@ Item{ NumberAnimation { duration: 0 } } - IconItem{ - id: taskIconItem + Item{ anchors.bottom: (root.location === PlasmaCore.Types.BottomEdge) ? parent.bottom : undefined anchors.top: (root.location === PlasmaCore.Types.TopEdge) ? parent.top : undefined anchors.left: (root.location === PlasmaCore.Types.LeftEdge) ? parent.left : undefined @@ -146,6 +143,72 @@ Item{ width: wrapper.regulatorWidth height: wrapper.regulatorHeight + + TitleTooltipParent{ + id: _titleTooltipVisualParent + thickness: taskItem.abilities.parabolic.factor.zoom * taskItem.abilities.metrics.totals.thickness + } + + //fix bug #478, when changing form factor sometimes the tasks are not positioned + //correctly, in such case we make a fast reinitialization for the sizes + Connections { + target: plasmoid + + onFormFactorChanged:{ + taskItem.inAddRemoveAnimation = false; + + wrapper.mScale = 1.01; + wrapper.tempScaleWidth = 1.01; + wrapper.tempScaleHeight = 1.01; + + wrapper.mScale = 1; + wrapper.tempScaleWidth = 1; + wrapper.tempScaleHeight = 1; + } + } + + Item { + id: _contentItemContainer + anchors.centerIn: parent + width: newTempSize + height: width + + property int zoomedSize: taskItem.abilities.parabolic.factor.zoom * taskItem.abilities.metrics.iconSize + + property real basicScalingWidth : wrapper.inTempScaling ? (taskItem.abilities.metrics.iconSize * wrapper.scaleWidth) : + taskItem.abilities.metrics.iconSize * wrapper.mScale + property real basicScalingHeight : wrapper.inTempScaling ? (taskItem.abilities.metrics.iconSize * wrapper.scaleHeight) : + taskItem.abilities.metrics.iconSize * wrapper.mScale + + property real newTempSize: { + if (wrapper.opacity === 1 ) { + return Math.min(basicScalingWidth, basicScalingHeight); + } else { + return Math.max(basicScalingWidth, basicScalingHeight); + } + } + + readonly property Item contentItem: children.length > 0 ? children[0] : null + + + //! Latte Side Painting-style if the user chose it + Loader{ + anchors.fill: _contentItemContainer + active: plasmoid.configuration.forceMonochromaticIcons + + sourceComponent: ColorOverlay { + anchors.fill: parent + color: latteBridge ? latteBridge.palette.textColor : "transparent" + source: _contentItemContainer.contentItem + } + } + //! Latte Side Painting-style if the user chose it + } //_contentItemContainer + + ShortcutBadge{ + id: shortcutBadge + anchors.fill: _contentItemContainer + } } function sendEndOfNeedBothAxisAnimation(){