Verified Commit e875678c authored by ivan tkachenko's avatar ivan tkachenko
Browse files

[applets/showdesktop] Rename things in a way that makes more sense

Besides, "component" is such an overloaded broad term in QML.
parent 02cf5789
......@@ -11,7 +11,7 @@ import QtQuick 2.15
import org.kde.taskmanager 0.1 as TaskManager
QtObject {
id: component
id: controller
readonly property QtObject tasksModel: TaskManager.TasksModel {
id: tasksModel
......@@ -21,21 +21,21 @@ QtObject {
readonly property Connections activeTaskChangedConnection: Connections {
target: tasksModel
enabled: component.active
enabled: controller.active
function onActiveTaskChanged() {
if (tasksModel.activeTask.valid) { // to suppress changing focus to non windows, such as the desktop
component.active = false;
component.minimizedClients = [];
controller.active = false;
controller.minimizedClients = [];
}
}
function onVirtualDesktopChanged() {
component.deactivate();
controller.deactivate();
}
function onActivityChanged() {
component.deactivate();
controller.deactivate();
}
}
......@@ -80,7 +80,7 @@ QtObject {
minimizedClients = [];
}
function toggleActive() {
function toggle() {
if (active) {
deactivate();
} else {
......
......@@ -26,7 +26,7 @@ MouseArea {
*/
readonly property bool isMinimizeAll: Plasmoid.pluginName === "org.kde.plasma.minimizeall"
readonly property bool isMinimizing: minimizeAllComponent.status === Loader.Ready ? minimizeAllComponent.item.active : false
readonly property bool isMinimizing: minimizeAllController.status === Loader.Ready ? minimizeAllController.item.active : false
Plasmoid.icon: Plasmoid.configuration.icon
Plasmoid.title: {
......@@ -58,11 +58,10 @@ MouseArea {
Plasmoid.onActivated: {
if (isMinimizeAll) {
minimizeAllComponent.item.toggleActive();
return;
minimizeAllController.item.toggle();
} else {
showdesktop.toggleDesktop();
}
showdesktop.toggleDesktop();
}
onClicked: Plasmoid.activated();
......@@ -86,9 +85,9 @@ MouseArea {
}
Loader {
id: minimizeAllComponent
id: minimizeAllController
active: root.isMinimizeAll
source: "MinimizeAllComponent.qml"
source: "MinimizeAllController.qml"
}
PlasmaCore.IconItem {
......
Supports Markdown
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