Commit 17153c4a authored by Konrad Materka's avatar Konrad Materka

[applet/systemtray] Use model binding instead of copy

Summary: The `effectiveStatus` parameter was passed as a copy, use proper binding.

Test Plan: No visible impact

Reviewers: #plasma_workspaces, #plasma, ngraham, broulik, davidedmundson, apol

Reviewed By: ngraham

Subscribers: apol, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D28185
parent 97ff2a20
......@@ -28,11 +28,13 @@ PlasmaCore.ToolTipArea {
height: inVisibleLayout ? visibleLayout.cellHeight : hiddenLayout.iconItemHeight
width: inVisibleLayout ? visibleLayout.cellWidth : hiddenLayout.width
property var model: itemModel
property string itemId
property alias text: label.text
property Item iconItem
property int /*PlasmaCore.Types.ItemStatus*/ status
property int /*PlasmaCore.Types.ItemStatus*/ effectiveStatus
property int /*PlasmaCore.Types.ItemStatus*/ status: model.status || PlasmaCore.Types.UnknownStatus
property int /*PlasmaCore.Types.ItemStatus*/ effectiveStatus: model.effectiveStatus || PlasmaCore.Types.UnknownStatus
readonly property bool inHiddenLayout: effectiveStatus === PlasmaCore.Types.PassiveStatus
readonly property bool inVisibleLayout: effectiveStatus === PlasmaCore.Types.ActiveStatus
......
......@@ -22,17 +22,13 @@ import QtQuick 2.0
Loader {
id: itemLoader
Component.onCompleted: {
property var itemModel: model
source: {
if (model.itemType === "Plasmoid" && model.hasApplet) {
itemLoader.setSource("PlasmoidItem.qml", {
"applet": model.applet,
"effectiveStatus": model.effectiveStatus
})
return "PlasmoidItem.qml"
} else if (model.itemType === "StatusNotifier") {
itemLoader.setSource("StatusNotifierItem.qml", {
"model": model,
"effectiveStatus": model.effectiveStatus
})
return "StatusNotifierItem.qml"
}
}
}
......@@ -23,7 +23,7 @@ import org.kde.plasma.core 2.0 as PlasmaCore
AbstractItem {
id: plasmoidContainer
property Item applet
property Item applet: model.applet || null
iconItem: applet
text: applet ? applet.title : ""
......@@ -33,7 +33,6 @@ AbstractItem {
icon: applet ? applet.icon : ""
mainItem: applet && applet.toolTipItem ? applet.toolTipItem : null
textFormat: applet ? applet.toolTipTextFormat : ""
status: applet ? applet.status : PlasmaCore.Types.UnknownStatus
active: root.activeApplet !== applet
onClicked: {
......
......@@ -23,8 +23,6 @@ import org.kde.plasma.core 2.0 as PlasmaCore
AbstractItem {
id: taskIcon
property var model
itemId: model.Id
text: model.Title
mainText: model.ToolTipTitle !== "" ? model.ToolTipTitle : model.Title
......@@ -32,8 +30,6 @@ AbstractItem {
icon: model.ToolTipIcon !== "" ? model.ToolTipIcon : model.Icon ? model.Icon : model.IconName
textFormat: Text.AutoText
status: model.status
iconItem: iconItem
PlasmaCore.IconItem {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment