diff --git a/applets/activities/contents/ui/main.qml b/applets/activities/contents/ui/main.qml index 7909dc3d..74026824 100644 --- a/applets/activities/contents/ui/main.qml +++ b/applets/activities/contents/ui/main.qml @@ -45,7 +45,9 @@ ColumnLayout { if (text != "") { activityModel.addActivity(text, function(id) { visible = false; - activityModel.setCurrentActivity(id, function() {}); + activityModel.setCurrentActivity(id, function() { + plasmoid.expanded = false; + }); }); } } @@ -107,7 +109,9 @@ ColumnLayout { height: Math.max(label.height, label.height) onClicked: { listView.currentIndex = index; - activityModel.setCurrentActivity(model.id, function() {}); + activityModel.setCurrentActivity(model.id, function() { + plasmoid.expanded = false; + }); } onPressAndHold: { edit.visible = true diff --git a/containments/panel/contents/ui/SlidingPanel.qml b/containments/panel/contents/ui/SlidingPanel.qml index 4556c0c6..46623427 100644 --- a/containments/panel/contents/ui/SlidingPanel.qml +++ b/containments/panel/contents/ui/SlidingPanel.qml @@ -36,6 +36,12 @@ FullScreenPanel { width: Screen.width height: Screen.height + function open() { + mouseArea.state = "open"; + } + function close() { + mouseArea.state = "closed"; + } function updateState() { var delta = offset - mouseArea.startOffset; if (delta > units.gridUnit * 8) { diff --git a/containments/panel/contents/ui/main.qml b/containments/panel/contents/ui/main.qml index b5dff7f0..a0f57a94 100644 --- a/containments/panel/contents/ui/main.qml +++ b/containments/panel/contents/ui/main.qml @@ -44,6 +44,15 @@ PlasmaCore.ColorScope { LayoutManager.save(); } + Connections { + target: expandedApplet + onExpandedChanged: { + if (!expanded) { + slidingPanel.close(); + } + } + } + function addApplet(applet, x, y) { var container = appletContainerComponent.createObject(appletIconsRow) @@ -98,12 +107,14 @@ PlasmaCore.ColorScope { z: 999 onClicked: { if (root.expandedApplet != applet) { + //temp var needed for oldExpandedApplet not to catch one expandedChanged too much by our Connections + var oldExpandedApplet = root.expandedApplet; + root.expandedApplet = applet; applet.expanded = true; appletsStack.replace(applet.fullRepresentationItem); - if (root.expandedApplet) { - root.expandedApplet.expanded = false; + if (oldExpandedApplet) { + oldExpandedApplet.expanded = false; } - root.expandedApplet = applet; } } } @@ -209,6 +220,7 @@ PlasmaCore.ColorScope { var factor = 1; slidingPanel.offset = slidingPanel.offset + (mouse.y - oldMouseY) * factor; oldMouseY = mouse.y; + root.expandedApplet.expanded = true; } onReleased: slidingPanel.updateState(); }