Commit b27e6703 authored by Marco Martin's avatar Marco Martin
Browse files

rework panel coloring logic based on tasks

parent f7843014
...@@ -47,7 +47,9 @@ Item { ...@@ -47,7 +47,9 @@ Item {
property bool reorderingApps: false property bool reorderingApps: false
property var layoutManager: LayoutManager property var layoutManager: LayoutManager
readonly property bool showingApp: tasksModel.activeTask && tasksModel.activeTask.valid && !tasksModel.data(tasksModel.activeTask, TaskManager.AbstractTasksModel.IsFullScreen) || NanoShell.StartupFeedback.visible readonly property bool showingApp: !plasmoid.nativeInterface.showDesktop && (hasTasks || NanoShell.StartupFeedback.visible)
readonly property bool hasTasks: tasksModel.count > 0
Containment.onAppletAdded: { Containment.onAppletAdded: {
addApplet(applet, x, y); addApplet(applet, x, y);
...@@ -94,7 +96,8 @@ Item { ...@@ -94,7 +96,8 @@ Item {
screenGeometry: plasmoid.screenGeometry screenGeometry: plasmoid.screenGeometry
filterByScreen: plasmoid.configuration.showForCurrentScreenOnly filterByScreen: plasmoid.configuration.showForCurrentScreenOnly
//FIXME: workaround
Component.onCompleted: tasksModel.countChanged();
} }
PlasmaCore.DataSource { PlasmaCore.DataSource {
......
...@@ -153,6 +153,11 @@ NanoShell.FullScreenOverlay { ...@@ -153,6 +153,11 @@ NanoShell.FullScreenOverlay {
TaskManager.TasksModel { TaskManager.TasksModel {
id: tasksModel id: tasksModel
sortMode: TaskManager.TasksModel.SortVirtualDesktop
groupMode: TaskManager.TasksModel.GroupDisabled
screenGeometry: plasmoid.screenGeometry
filterByScreen: plasmoid.configuration.showForCurrentScreenOnly
} }
//This proxy is only used for "get" //This proxy is only used for "get"
PlasmaCore.SortFilterModel { PlasmaCore.SortFilterModel {
......
...@@ -37,7 +37,9 @@ PlasmaCore.ColorScope { ...@@ -37,7 +37,9 @@ PlasmaCore.ColorScope {
Plasmoid.backgroundHints: PlasmaCore.Types.NoBackground Plasmoid.backgroundHints: PlasmaCore.Types.NoBackground
readonly property bool showingApp: tasksModel.activeTask && tasksModel.activeTask.valid && !tasksModel.data(tasksModel.activeTask, TaskManager.AbstractTasksModel.IsFullScreen) || NanoShell.StartupFeedback.visible readonly property bool showingApp: !plasmoid.nativeInterface.showDesktop && (hasTasks || NanoShell.StartupFeedback.visible)
readonly property bool hasTasks: tasksModel.count > 0
property QtObject taskSwitcher: taskSwitcherLoader.item ? taskSwitcherLoader.item : null property QtObject taskSwitcher: taskSwitcherLoader.item ? taskSwitcherLoader.item : null
Loader { Loader {
...@@ -52,12 +54,24 @@ PlasmaCore.ColorScope { ...@@ -52,12 +54,24 @@ PlasmaCore.ColorScope {
TaskManager.TasksModel { TaskManager.TasksModel {
id: tasksModel id: tasksModel
sortMode: TaskManager.TasksModel.SortVirtualDesktop
groupMode: TaskManager.TasksModel.GroupDisabled groupMode: TaskManager.TasksModel.GroupDisabled
screenGeometry: plasmoid.screenGeometry screenGeometry: plasmoid.screenGeometry
filterByScreen: plasmoid.configuration.showForCurrentScreenOnly filterByScreen: plasmoid.configuration.showForCurrentScreenOnly
sortMode: TaskManager.TasksModel.SortAlpha
virtualDesktop: virtualDesktopInfo.currentDesktop
activity: activityInfo.currentActivity
//FIXME: workaround
Component.onCompleted: tasksModel.countChanged();
}
TaskManager.VirtualDesktopInfo {
id: virtualDesktopInfo
}
TaskManager.ActivityInfo {
id: activityInfo
} }
MouseArea { MouseArea {
...@@ -153,7 +167,7 @@ PlasmaCore.ColorScope { ...@@ -153,7 +167,7 @@ PlasmaCore.ColorScope {
anchors.left: parent.left anchors.left: parent.left
height: parent.height height: parent.height
width: parent.width/3 width: parent.width/3
enabled: taskSwitcher && taskSwitcher.tasksCount > 0; enabled: root.hasTasks
iconSource: "box" iconSource: "box"
onClicked: { onClicked: {
plasmoid.nativeInterface.showDesktop = false; plasmoid.nativeInterface.showDesktop = false;
......
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