better behavior of the show desktop button

This commit is contained in:
Marco Martin 2015-12-18 14:46:29 +01:00
parent a363da2abe
commit bf30354c91
4 changed files with 11 additions and 5 deletions

View file

@ -43,6 +43,4 @@ MouseArea {
checked = !checked; checked = !checked;
} }
} }
onPositionChanged: mainMouseArea.positionChanged(mouse);
onReleased: mainMouseArea.released(mouse);
} }

View file

@ -115,7 +115,7 @@ Item {
onPressed: delegate.z = 10; onPressed: delegate.z = 10;
onClicked: { onClicked: {
window.hide(); window.hide();
plasmoid.nativeInterface.windowModel.requestActivate(filteredWindowModel.mapRowToSource(model.index)); window.setSingleActiveWindow(model.index);
} }
onReleased: { onReleased: {
delegate.z = 0; delegate.z = 0;

View file

@ -69,7 +69,8 @@ FullScreenPanel {
task = filteredWindowModel.get(i); task = filteredWindowModel.get(i);
if (i == id && task.IsMinimized) { if (i == id && task.IsMinimized) {
plasmoid.nativeInterface.windowModel.requestToggleMinimized(filteredWindowModel.mapRowToSource(i)); //plasmoid.nativeInterface.windowModel.requestToggleMinimized(filteredWindowModel.mapRowToSource(i));
plasmoid.nativeInterface.windowModel.requestActivate(filteredWindowModel.mapRowToSource(i));
} else if (i != id && !task.IsMinimized) { } else if (i != id && !task.IsMinimized) {
plasmoid.nativeInterface.windowModel.requestToggleMinimized(filteredWindowModel.mapRowToSource(i)); plasmoid.nativeInterface.windowModel.requestToggleMinimized(filteredWindowModel.mapRowToSource(i));
} }
@ -204,6 +205,7 @@ FullScreenPanel {
} }
iconSource: "go-home" iconSource: "go-home"
onClicked: { onClicked: {
setSingleActiveWindow(-1);
window.hide(); window.hide();
} }
} }

View file

@ -88,6 +88,8 @@ PlasmaCore.ColorScope {
enabled: taskSwitcher.tasksCount > 0 enabled: taskSwitcher.tasksCount > 0
iconSource: "window-list" iconSource: "window-list"
onClicked: taskSwitcher.visible ? taskSwitcher.hide() : taskSwitcher.show(); onClicked: taskSwitcher.visible ? taskSwitcher.hide() : taskSwitcher.show();
onPositionChanged: mainMouseArea.positionChanged(mouse);
onReleased: mainMouseArea.released(mouse);
} }
Button { Button {
@ -104,10 +106,12 @@ PlasmaCore.ColorScope {
root.taskSwitcher.setSingleActiveWindow(Math.max(0, root.taskSwitcher.currentTaskIndex)); root.taskSwitcher.setSingleActiveWindow(Math.max(0, root.taskSwitcher.currentTaskIndex));
} }
} }
onPositionChanged: mainMouseArea.positionChanged(mouse);
onReleased: mainMouseArea.released(mouse);
Connections { Connections {
target: root.taskSwitcher target: root.taskSwitcher
onCurrentTaskIndexChanged: { onCurrentTaskIndexChanged: {
showDesktopButton.checked = root.taskSwitcher.currentTaskIndex >= 0 showDesktopButton.checked = root.taskSwitcher.currentTaskIndex < 0
} }
} }
} }
@ -119,6 +123,8 @@ PlasmaCore.ColorScope {
iconSource: "window-close" iconSource: "window-close"
enabled: plasmoid.nativeInterface.hasCloseableActiveWindow; enabled: plasmoid.nativeInterface.hasCloseableActiveWindow;
onClicked: plasmoid.nativeInterface.closeActiveWindow(); onClicked: plasmoid.nativeInterface.closeActiveWindow();
onPositionChanged: mainMouseArea.positionChanged(mouse);
onReleased: mainMouseArea.released(mouse);
} }
} }
} }