plasmoid:drop deprecated IconItem

work/spdx
Michail Vourlakos 4 years ago
parent 9c3601cff4
commit ea05df3807

@ -1,124 +0,0 @@
/*
* Copyright 2016 Smith AR <audoban@openmailbox.org>
* 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.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

@ -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 !== ""

@ -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

@ -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(){

Loading…
Cancel
Save