mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-03 10:14:45 +00:00
fix controlling from the bottom panel
This commit is contained in:
parent
b98c7ec224
commit
8483bcbe0f
4 changed files with 10 additions and 9 deletions
|
|
@ -14,8 +14,7 @@ QtObject {
|
||||||
|
|
||||||
signal resetHomeScreenPosition()
|
signal resetHomeScreenPosition()
|
||||||
signal snapHomeScreenPosition()
|
signal snapHomeScreenPosition()
|
||||||
signal requestHomeScreenPosition(real y)
|
signal requestRelativeScroll(point pos)
|
||||||
property real homeScreenPosition: 0
|
|
||||||
property Item homeScreen
|
property Item homeScreen
|
||||||
property QtObject homeScreenWindow
|
property QtObject homeScreenWindow
|
||||||
property bool homeScreenVisible: true
|
property bool homeScreenVisible: true
|
||||||
|
|
|
||||||
|
|
@ -198,7 +198,6 @@ Item {
|
||||||
|
|
||||||
oldContentY = contentY;
|
oldContentY = contentY;
|
||||||
root.offset = contentY + view.originY + view.height*2 - root.closedPositionOffset*2
|
root.offset = contentY + view.originY + view.height*2 - root.closedPositionOffset*2
|
||||||
MobileShell.HomeScreenControls.homeScreenPosition = contentY
|
|
||||||
}
|
}
|
||||||
onMovementEnded: root.snapDrawerStatus()
|
onMovementEnded: root.snapDrawerStatus()
|
||||||
onFlickEnded: movementEnded()
|
onFlickEnded: movementEnded()
|
||||||
|
|
|
||||||
|
|
@ -76,15 +76,15 @@ FocusScope {
|
||||||
appDrawer.close();
|
appDrawer.close();
|
||||||
}
|
}
|
||||||
function onSnapHomeScreenPosition() {
|
function onSnapHomeScreenPosition() {
|
||||||
if (lastRequestedPosition > 0) {
|
if (lastRequestedPosition < 0) {
|
||||||
appDrawer.open();
|
appDrawer.open();
|
||||||
} else {
|
} else {
|
||||||
appDrawer.close();
|
appDrawer.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function onRequestHomeScreenPosition(y) {
|
function onRequestRelativeScroll(pos) {
|
||||||
appDrawer.offset += y;
|
appDrawer.offset -= pos.y;
|
||||||
lastRequestedPosition = y;
|
lastRequestedPosition = pos.y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,12 +95,15 @@ PlasmaCore.ColorScope {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
property int oldMouseY: 0
|
property int oldMouseY: 0
|
||||||
property int startMouseY: 0
|
property int startMouseY: 0
|
||||||
|
property int oldMouseX: 0
|
||||||
|
property int startMouseX: 0
|
||||||
property bool isDragging: false
|
property bool isDragging: false
|
||||||
property bool opening: false
|
property bool opening: false
|
||||||
drag.filterChildren: true
|
drag.filterChildren: true
|
||||||
property Button activeButton
|
property Button activeButton
|
||||||
|
|
||||||
onPressed: {
|
onPressed: {
|
||||||
|
startMouseX = oldMouseX = mouse.y;
|
||||||
startMouseY = oldMouseY = mouse.y;
|
startMouseY = oldMouseY = mouse.y;
|
||||||
taskSwitcher.offset = -taskSwitcher.height;
|
taskSwitcher.offset = -taskSwitcher.height;
|
||||||
activeButton = icons.childAt(mouse.x, mouse.y);
|
activeButton = icons.childAt(mouse.x, mouse.y);
|
||||||
|
|
@ -125,9 +128,10 @@ PlasmaCore.ColorScope {
|
||||||
taskSwitcher.showFullScreen();
|
taskSwitcher.showFullScreen();
|
||||||
//no tasks, let's scroll up the homescreen instead
|
//no tasks, let's scroll up the homescreen instead
|
||||||
} else if (taskSwitcher.tasksCount === 0) {
|
} else if (taskSwitcher.tasksCount === 0) {
|
||||||
MobileShell.HomeScreenControls.requestHomeScreenPosition(MobileShell.HomeScreenControls.homeScreenPosition - (mouse.y - oldMouseY));
|
MobileShell.HomeScreenControls.requestRelativeScroll(Qt.point(mouse.x - oldMouseX, mouse.y - oldMouseY));
|
||||||
}
|
}
|
||||||
oldMouseY = mouse.y;
|
oldMouseY = mouse.y;
|
||||||
|
oldMouseY = mouse.y;
|
||||||
}
|
}
|
||||||
onReleased: {
|
onReleased: {
|
||||||
if (taskSwitcher.visibility == Window.Hidden) {
|
if (taskSwitcher.visibility == Window.Hidden) {
|
||||||
|
|
@ -214,7 +218,6 @@ PlasmaCore.ColorScope {
|
||||||
height: parent.height
|
height: parent.height
|
||||||
width: parent.width*0.8/3
|
width: parent.width*0.8/3
|
||||||
mouseArea: mainMouseArea
|
mouseArea: mainMouseArea
|
||||||
enabled: !taskSwitcher.visible && (root.showingApp || MobileShell.HomeScreenControls.homeScreenPosition != 0)
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (!enabled) {
|
if (!enabled) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue