mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-28 06:33:09 +00:00
show last page with a + when dragging
This commit is contained in:
parent
a79a7f31f8
commit
73efc8a59d
3 changed files with 32 additions and 4 deletions
|
|
@ -126,6 +126,7 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
OpenDrawerButton {
|
OpenDrawerButton {
|
||||||
|
id: openDrawerButton
|
||||||
anchors {
|
anchors {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ Flickable {
|
||||||
scale: (3 - appDrawer.openFactor) /3
|
scale: (3 - appDrawer.openFactor) /3
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
|
property bool showAddPageIndicator: false
|
||||||
//bottomMargin: favoriteStrip.height
|
//bottomMargin: favoriteStrip.height
|
||||||
contentHeight: height
|
contentHeight: height
|
||||||
//interactive: !plasmoid.editMode && !launcherDragManager.active
|
//interactive: !plasmoid.editMode && !launcherDragManager.active
|
||||||
|
|
@ -148,6 +149,7 @@ Flickable {
|
||||||
|
|
||||||
|
|
||||||
PlasmaComponents.PageIndicator {
|
PlasmaComponents.PageIndicator {
|
||||||
|
id: pageIndicator
|
||||||
anchors {
|
anchors {
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
horizontalCenter: parent.horizontalCenter
|
horizontalCenter: parent.horizontalCenter
|
||||||
|
|
@ -159,6 +161,29 @@ Flickable {
|
||||||
count: mainFlickable.totalPages
|
count: mainFlickable.totalPages
|
||||||
visible: count > 1
|
visible: count > 1
|
||||||
currentIndex: Math.round(mainFlickable.contentX / mainFlickable.width)
|
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 {
|
Private.ScrollIndicator {
|
||||||
|
|
|
||||||
|
|
@ -105,11 +105,13 @@ FocusScope {
|
||||||
bottomMargin: /*favoriteStrip.height +*/ plasmoid.screenGeometry.height - plasmoid.availableScreenRect.height - plasmoid.availableScreenRect.y
|
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
|
appletsLayout: homeScreenContents.appletsLayout
|
||||||
|
|
||||||
appDrawer: appDrawer
|
appDrawer: appDrawer
|
||||||
contentWidth: Math.max(width, width * Math.ceil(homeScreenContents.itemsBoundingRect.width/width)) + (launcherDragManager.active ? width : 0)
|
contentWidth: Math.max(width, width * Math.ceil(homeScreenContents.itemsBoundingRect.width/width)) + (launcherDragManager.active ? width : 0)
|
||||||
|
showAddPageIndicator: launcherDragManager.active
|
||||||
|
|
||||||
Launcher.HomeScreenContents {
|
Launcher.HomeScreenContents {
|
||||||
id: homeScreenContents
|
id: homeScreenContents
|
||||||
|
|
@ -123,17 +125,17 @@ FocusScope {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
topPadding: plasmoid.availableScreenRect.y
|
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 {
|
Launcher.FavoriteStrip {
|
||||||
id: favoriteStrip
|
id: favoriteStrip
|
||||||
/* anchors {
|
anchors {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
bottomMargin: plasmoid.screenGeometry.height - plasmoid.availableScreenRect.height - plasmoid.availableScreenRect.y
|
bottomMargin: plasmoid.screenGeometry.height - plasmoid.availableScreenRect.height - plasmoid.availableScreenRect.y
|
||||||
}*/
|
}
|
||||||
appletsLayout: homeScreenContents.appletsLayout
|
appletsLayout: homeScreenContents.appletsLayout
|
||||||
|
|
||||||
visible: flow.children.length > 0 || launcherDragManager.active || homeScreenContents.containsDrag
|
visible: flow.children.length > 0 || launcherDragManager.active || homeScreenContents.containsDrag
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue