mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
homescreens/halcyon: Allow full screen to be draggable
This commit is contained in:
parent
108daf50db
commit
946e9dfc62
2 changed files with 93 additions and 87 deletions
|
|
@ -17,7 +17,7 @@ import org.kde.phone.homescreen.halcyon 1.0 as Halcyon
|
|||
|
||||
import org.kde.kirigami 2.19 as Kirigami
|
||||
|
||||
MobileShell.ExtendedAbstractButton {
|
||||
MouseArea {
|
||||
id: delegate
|
||||
|
||||
property alias iconItem: icon
|
||||
|
|
@ -51,9 +51,12 @@ MobileShell.ExtendedAbstractButton {
|
|||
|
||||
hoverEnabled: true
|
||||
onPressAndHold: openContextMenu()
|
||||
onRightClickPressed: openContextMenu()
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
|
||||
onClicked: {
|
||||
if (mouse.button === Qt.RightButton) {
|
||||
openContextMenu();
|
||||
} else {
|
||||
// launch app
|
||||
if (application.running) {
|
||||
delegate.launch(0, 0, "", applicationName, applicationStorageId);
|
||||
|
|
@ -61,6 +64,7 @@ MobileShell.ExtendedAbstractButton {
|
|||
delegate.launch(delegate.x + (PlasmaCore.Units.smallSpacing * 2), delegate.y + (PlasmaCore.Units.smallSpacing * 2), icon.source, applicationName, applicationStorageId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: dialogLoader
|
||||
|
|
@ -81,15 +85,12 @@ MobileShell.ExtendedAbstractButton {
|
|||
}
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: height / 2
|
||||
color: delegate.pressed ? Qt.rgba(255, 255, 255, 0.2) : (delegate.hovered ? Qt.rgba(255, 255, 255, 0.1) : "transparent")
|
||||
color: delegate.pressed ? Qt.rgba(255, 255, 255, 0.2) : (delegate.containsMouse ? Qt.rgba(255, 255, 255, 0.1) : "transparent")
|
||||
}
|
||||
|
||||
contentItem: Item {
|
||||
implicitHeight: rowLayout.height + rowLayout.anchors.topMargin + rowLayout.anchors.bottomMargin
|
||||
implicitWidth: rowLayout.width + rowLayout.anchors.rightMargin + rowLayout.anchors.leftMargin
|
||||
|
||||
RowLayout {
|
||||
id: rowLayout
|
||||
anchors {
|
||||
|
|
@ -160,7 +161,6 @@ MobileShell.ExtendedAbstractButton {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -58,14 +58,12 @@ Item {
|
|||
id: favouritesList
|
||||
clip: true
|
||||
interactive: root.interactive
|
||||
boundsMovement: Flickable.StopAtBounds
|
||||
boundsBehavior: Flickable.DragOverBounds
|
||||
|
||||
property real delegateHeight: PlasmaCore.Units.gridUnit * 3
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: Math.round(parent.width * 0.1)
|
||||
anchors.rightMargin: Math.round(parent.width * 0.1)
|
||||
|
||||
// don't set anchors.margins since we want everywhere to be draggable
|
||||
readonly property real leftMargin: Math.round(parent.width * 0.1)
|
||||
readonly property real rightMargin: Math.round(parent.width * 0.1)
|
||||
readonly property real delegateHeight: PlasmaCore.Units.gridUnit * 3
|
||||
|
||||
// search widget open gesture
|
||||
property bool openingSearchWidget: false
|
||||
|
|
@ -95,6 +93,8 @@ Item {
|
|||
header: MobileShell.BaseItem {
|
||||
topPadding: Math.round(swipeView.height * 0.2)
|
||||
bottomPadding: PlasmaCore.Units.largeSpacing
|
||||
leftPadding: favouritesList.leftMargin
|
||||
rightPadding: favouritesList.rightMargin
|
||||
implicitWidth: favouritesList.width
|
||||
|
||||
background: Rectangle {
|
||||
|
|
@ -104,10 +104,14 @@ Item {
|
|||
contentItem: Clock {}
|
||||
}
|
||||
|
||||
delegate: DrawerListDelegate {
|
||||
id: delegate
|
||||
width: favouritesList.width
|
||||
height: visible ? favouritesList.delegateHeight : 0
|
||||
delegate: MobileShell.BaseItem {
|
||||
leftPadding: favouritesList.leftMargin
|
||||
rightPadding: favouritesList.rightMargin
|
||||
|
||||
contentItem: DrawerListDelegate {
|
||||
implicitWidth: favouritesList.width - favouritesList.leftMargin - favouritesList.rightMargin
|
||||
implicitHeight: visible ? favouritesList.delegateHeight : 0
|
||||
}
|
||||
}
|
||||
|
||||
// open wallpaper menu when held on click
|
||||
|
|
@ -121,8 +125,10 @@ Item {
|
|||
visible: favouritesList.count == 0
|
||||
opacity: 0.9
|
||||
|
||||
anchors.topMargin: Math.round(swipeView.height * 0.2) - (favouritesList.contentY - favouritesList.originY)
|
||||
anchors.fill: parent
|
||||
anchors.topMargin: Math.round(swipeView.height * 0.2) - (favouritesList.contentY - favouritesList.originY)
|
||||
anchors.leftMargin: favouritesList.leftMargin
|
||||
anchors.rightMargin: favouritesList.rightMargin
|
||||
|
||||
Kirigami.Icon {
|
||||
id: icon
|
||||
|
|
|
|||
Loading…
Reference in a new issue