mirror of
https://github.com/KDE/latte-dock.git
synced 2024-12-26 23:21:37 +03:00
rename task:centralItem to taskIcon
--improve readability of code
This commit is contained in:
parent
e3223d6908
commit
4bdcd5e4d2
@ -38,7 +38,7 @@ import "animations" as TaskAnimations
|
||||
//but it increases performance almost to double during animation
|
||||
|
||||
Item{
|
||||
id: centralItem
|
||||
id: taskIcon
|
||||
|
||||
width: wrapper.regulatorWidth
|
||||
height: wrapper.regulatorHeight
|
||||
@ -80,7 +80,7 @@ Item{
|
||||
if (smartLauncherEnabled && !smartLauncherItem) {
|
||||
var smartLauncher = Qt.createQmlObject(
|
||||
" import org.kde.plasma.private.taskmanager 0.1 as TaskManagerApplet; TaskManagerApplet.SmartLauncherItem { }",
|
||||
centralItem);
|
||||
taskIcon);
|
||||
|
||||
smartLauncher.launcherUrl = Qt.binding(function() { return taskItem.launcherUrlWithIcon; });
|
||||
|
||||
@ -182,7 +182,7 @@ Item{
|
||||
return 0;
|
||||
}
|
||||
|
||||
width: Math.round(newTempSize) //+ 2*centralItem.shadowSize
|
||||
width: Math.round(newTempSize) //+ 2*taskIcon.shadowSize
|
||||
height: Math.round(width)
|
||||
source: decoration
|
||||
|
||||
@ -289,8 +289,8 @@ Item{
|
||||
|
||||
property real opacityN: showProgress || showAudio ? 1 : 0
|
||||
|
||||
property bool showProgress: (centralItem.smartLauncherEnabled && centralItem.smartLauncherItem && !taskItem.isSeparator
|
||||
&& (centralItem.smartLauncherItem.countVisible || centralItem.smartLauncherItem.progressVisible
|
||||
property bool showProgress: (taskIcon.smartLauncherEnabled && taskIcon.smartLauncherItem && !taskItem.isSeparator
|
||||
&& (taskIcon.smartLauncherItem.countVisible || taskIcon.smartLauncherItem.progressVisible
|
||||
|| taskItem.badgeIndicator > 0))
|
||||
|
||||
property bool showAudio: taskItem.hasAudioStream && taskItem.playingAudio &&
|
||||
@ -572,7 +572,7 @@ Item{
|
||||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
centralItem.toBeDestroyed = true;
|
||||
taskIcon.toBeDestroyed = true;
|
||||
|
||||
if(removingAnimation.removingItem)
|
||||
removingAnimation.removingItem.destroy();
|
||||
|
@ -61,22 +61,22 @@ Item {
|
||||
border.color: root.minimizedDotColor
|
||||
minimumWidth: 0.8 * parent.height
|
||||
height: 0.8 * parent.height
|
||||
numberValue: taskItem.badgeIndicator > 0 ? taskItem.badgeIndicator : centralItem.smartLauncherItem.count
|
||||
numberValue: taskItem.badgeIndicator > 0 ? taskItem.badgeIndicator : taskIcon.smartLauncherItem.count
|
||||
fullCircle: true
|
||||
showNumber: true
|
||||
|
||||
textWithBackgroundColor: ( (taskItem.badgeIndicator > 0)
|
||||
|| (centralItem.smartLauncherItem.countVisible && !centralItem.smartLauncherItem.progressVisible) )
|
||||
|| (taskIcon.smartLauncherItem.countVisible && !taskIcon.smartLauncherItem.progressVisible) )
|
||||
&& proportion>0
|
||||
|
||||
proportion: {
|
||||
if (taskItem.badgeIndicator > 0 ||
|
||||
(centralItem.smartLauncherItem.countVisible && !centralItem.smartLauncherItem.progressVisible)) {
|
||||
(taskIcon.smartLauncherItem.countVisible && !taskIcon.smartLauncherItem.progressVisible)) {
|
||||
return 100;
|
||||
}
|
||||
|
||||
if (centralItem.smartLauncherItem) {
|
||||
return centralItem.smartLauncherItem.progress / 100;
|
||||
if (taskIcon.smartLauncherItem) {
|
||||
return taskIcon.smartLauncherItem.progress / 100;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ Item{
|
||||
id:removingAnimation
|
||||
|
||||
function init(){
|
||||
var relavantPoint = root.mapFromItem(centralItem,0,0);
|
||||
var relavantPoint = root.mapFromItem(taskIcon,0,0);
|
||||
|
||||
var removingItem = removeTaskComponent.createObject(root);
|
||||
removingItem.x = relavantPoint.x;
|
||||
@ -41,7 +41,7 @@ Item{
|
||||
}
|
||||
|
||||
function removeTask(){
|
||||
if(!centralItem.toBeDestroyed && plasmoid.configuration.showShadows && Latte.WindowSystem.compositingActive){
|
||||
if(!taskIcon.toBeDestroyed && plasmoid.configuration.showShadows && Latte.WindowSystem.compositingActive){
|
||||
removingAnimation.init();
|
||||
}
|
||||
}
|
||||
@ -60,8 +60,8 @@ Item{
|
||||
id: removeTaskComponent
|
||||
Item{
|
||||
id: removeTask
|
||||
width: centralItem.width
|
||||
height: centralItem.height
|
||||
width: taskIcon.width
|
||||
height: taskIcon.height
|
||||
|
||||
visible: false
|
||||
|
||||
@ -97,7 +97,7 @@ Item{
|
||||
fast: true
|
||||
samples: 2 * radius
|
||||
source: tempRemoveIcon
|
||||
radius: centralItem.shadowSize
|
||||
radius: taskIcon.shadowSize
|
||||
verticalOffset: 2
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user