show last page with a + when dragging

This commit is contained in:
Marco Martin 2021-04-08 18:57:20 +02:00
parent a79a7f31f8
commit 73efc8a59d
3 changed files with 32 additions and 4 deletions

View file

@ -126,6 +126,7 @@ Item {
}
OpenDrawerButton {
id: openDrawerButton
anchors {
left: parent.left
right: parent.right

View file

@ -40,6 +40,7 @@ Flickable {
scale: (3 - appDrawer.openFactor) /3
clip: true
property bool showAddPageIndicator: false
//bottomMargin: favoriteStrip.height
contentHeight: height
//interactive: !plasmoid.editMode && !launcherDragManager.active
@ -148,6 +149,7 @@ Flickable {
PlasmaComponents.PageIndicator {
id: pageIndicator
anchors {
bottom: parent.bottom
horizontalCenter: parent.horizontalCenter
@ -159,6 +161,29 @@ Flickable {
count: mainFlickable.totalPages
visible: count > 1
currentIndex: Math.round(mainFlickable.contentX / mainFlickable.width)
delegate: Rectangle {
property bool isAddPageIndicator: index === pageIndicator.count-1 && mainFlickable.showAddPageIndicator
implicitWidth: PlasmaCore.Units.gridUnit/2
implicitHeight: implicitWidth
radius: width
color: isAddPageIndicator ? "transparent" : PlasmaCore.ColorScope.textColor
PlasmaComponents.Label {
anchors.centerIn: parent
visible: parent.isAddPageIndicator
text: "⊕"
}
opacity: index === currentIndex ? 0.9 : pressed ? 0.7 : 0.5
Behavior on opacity {
OpacityAnimator {
duration: PlasmaCore.Units.longDuration
easing.type: Easing.InOutQuad
}
}
}
}
Private.ScrollIndicator {

View file

@ -105,11 +105,13 @@ FocusScope {
bottomMargin: /*favoriteStrip.height +*/ plasmoid.screenGeometry.height - plasmoid.availableScreenRect.height - plasmoid.availableScreenRect.y
}
footer: favoriteStrip
//TODO: favorite strip disappearing with everything else
//footer: favoriteStrip
appletsLayout: homeScreenContents.appletsLayout
appDrawer: appDrawer
contentWidth: Math.max(width, width * Math.ceil(homeScreenContents.itemsBoundingRect.width/width)) + (launcherDragManager.active ? width : 0)
showAddPageIndicator: launcherDragManager.active
Launcher.HomeScreenContents {
id: homeScreenContents
@ -123,17 +125,17 @@ FocusScope {
anchors.fill: parent
topPadding: plasmoid.availableScreenRect.y
bottomPadding: /*favoriteStrip.height + */plasmoid.screenGeometry.height - plasmoid.availableScreenRect.height - plasmoid.availableScreenRect.y
bottomPadding: favoriteStrip.height + plasmoid.screenGeometry.height - plasmoid.availableScreenRect.height - plasmoid.availableScreenRect.y
}
Launcher.FavoriteStrip {
id: favoriteStrip
/* anchors {
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom
bottomMargin: plasmoid.screenGeometry.height - plasmoid.availableScreenRect.height - plasmoid.availableScreenRect.y
}*/
}
appletsLayout: homeScreenContents.appletsLayout
visible: flow.children.length > 0 || launcherDragManager.active || homeScreenContents.containsDrag