darken the screen when results are in

hide on lock screen
This commit is contained in:
Marco Martin 2015-06-19 10:33:56 -07:00
parent 5dd2df26de
commit ec2e95258d
2 changed files with 84 additions and 38 deletions

View file

@ -29,11 +29,45 @@ import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.milou 0.1 as Milou import org.kde.milou 0.1 as Milou
PlasmaCore.FrameSvgItem { Rectangle {
id: krunner
anchors.fill: parent
height: childrenRect.height
color: listView.visible ? Qt.rgba(0, 0, 0, 0.8) : "transparent"
property alias showingResults: listView.visible
MouseArea {
enabled: listView.visible
anchors.fill: parent
preventStealing: true
onClicked: queryField.text = "";
}
PlasmaCore.FrameSvgItem {
id: background id: background
anchors {
left: parent.left
right: parent.right
top: parent.top
}
clip: true
imagePath: "widgets/background" imagePath: "widgets/background"
enabledBorders: PlasmaCore.FrameSvg.BottomBorder enabledBorders: PlasmaCore.FrameSvg.BottomBorder
height: childrenRect.height + fixedMargins.top/2 + fixedMargins.bottom height: childrenRect.height + fixedMargins.top/2 + fixedMargins.bottom
Behavior on height {
NumberAnimation {
duration: units.longDuration
easing.type: Easing.InOutQuad
}
}
transform: Translate {
y: root.locked ? -background.height : 0
Behavior on y {
NumberAnimation {
duration: units.longDuration
easing.type: Easing.InOutQuad
}
}
}
ColumnLayout { ColumnLayout {
anchors { anchors {
@ -79,5 +113,6 @@ PlasmaCore.FrameSvgItem {
runnerWindow.visible = false; runnerWindow.visible = false;
} }
} }
}
} }

View file

@ -35,6 +35,7 @@ MouseEventListener {
property alias appletsSpace: applicationsView.headerItem property alias appletsSpace: applicationsView.headerItem
property int buttonHeight: width/4 property int buttonHeight: width/4
property bool reorderingApps: false property bool reorderingApps: false
property bool locked: applicationsView.contentY <= -applicationsView.headerItem.height + root.height
Containment.onAppletAdded: { Containment.onAppletAdded: {
addApplet(applet, x, y); addApplet(applet, x, y);
@ -143,6 +144,9 @@ MouseEventListener {
} }
onPressAndHold: { onPressAndHold: {
if (krunner.showingResults) {
return;
}
var pos = mapToItem(applicationsView.headerItem.favoritesStrip, mouse.x, mouse.y); var pos = mapToItem(applicationsView.headerItem.favoritesStrip, mouse.x, mouse.y);
//in favorites area? //in favorites area?
var item; var item;
@ -220,6 +224,9 @@ MouseEventListener {
} }
onReleased: { onReleased: {
if (krunner.showingResults) {
return;
}
applicationsView.interactive = true; applicationsView.interactive = true;
dragDelegate.xTarget = Math.floor(mouse.x / root.buttonHeight) * root.buttonHeight; dragDelegate.xTarget = Math.floor(mouse.x / root.buttonHeight) * root.buttonHeight;
dragDelegate.yTarget = Math.floor(mouse.y / root.buttonHeight) * root.buttonHeight; dragDelegate.yTarget = Math.floor(mouse.y / root.buttonHeight) * root.buttonHeight;
@ -236,6 +243,9 @@ MouseEventListener {
scrollDownIndicator.opacity = 0; scrollDownIndicator.opacity = 0;
} }
onClicked: { onClicked: {
if (krunner.showingResults) {
return;
}
var pos = mapToItem(applicationsView.headerItem.favoritesStrip, mouse.x, mouse.y); var pos = mapToItem(applicationsView.headerItem.favoritesStrip, mouse.x, mouse.y);
//in favorites area? //in favorites area?
@ -281,6 +291,7 @@ MouseEventListener {
id: feedbackWindow id: feedbackWindow
} }
KRunner { KRunner {
id: krunner
z: 1000 z: 1000
anchors { anchors {
top: parent.top top: parent.top