Commit 4f5427cd authored by Devin Lin's avatar Devin Lin 🎨
Browse files

homescreens/halcyon: Ensure gridview header is draggable, and add scrollbar

parent 13f2a105
Pipeline #194989 passed with stage
in 1 minute and 7 seconds
......@@ -166,11 +166,12 @@ MobileShell.ExtendedAbstractButton {
visible: text.length > 0
Layout.fillWidth: true
Layout.topMargin: PlasmaCore.Units.smallSpacing
Layout.preferredHeight: delegate.reservedSpaceForLabel
wrapMode: Text.WordWrap
Layout.topMargin: PlasmaCore.Units.smallSpacing
Layout.leftMargin: -parent.anchors.leftMargin + PlasmaCore.Units.smallSpacing
Layout.rightMargin: -parent.anchors.rightMargin + PlasmaCore.Units.smallSpacing
wrapMode: Text.WordWrap
maximumLineCount: 2
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignTop
......
......@@ -22,20 +22,21 @@ GridView {
clip: true
readonly property int reservedSpaceForLabel: metrics.height
readonly property real effectiveContentWidth: width - leftMargin - rightMargin
cellWidth: width / Math.min(Math.floor(width / (PlasmaCore.Units.iconSizes.huge + Kirigami.Units.largeSpacing * 2)), 8)
cellWidth: effectiveContentWidth / Math.min(Math.floor(effectiveContentWidth / (PlasmaCore.Units.iconSizes.huge + Kirigami.Units.largeSpacing * 2)), 8)
cellHeight: cellWidth + reservedSpaceForLabel
property int columns: Math.floor(width / cellWidth)
property int columns: Math.floor(effectiveContentWidth / cellWidth)
property int rows: Math.ceil(Halcyon.ApplicationListModel.count / columns)
cacheBuffer: Math.max(0, rows * cellHeight)
model: Halcyon.ApplicationListModel
header: Controls.Control {
implicitWidth: gridView.width
topPadding: PlasmaCore.Units.largeSpacing + Math.round(gridView.height * 0.25)
header: MobileShell.BaseItem {
implicitWidth: gridView.effectiveContentWidth
topPadding: PlasmaCore.Units.largeSpacing + Math.round(gridView.height * 0.2)
bottomPadding: PlasmaCore.Units.largeSpacing
leftPadding: PlasmaCore.Units.smallSpacing
......@@ -78,4 +79,21 @@ GridView {
application.runApplication();
}
}
PC3.ScrollBar.vertical: PC3.ScrollBar {
id: scrollBar
interactive: true
enabled: true
Behavior on opacity {
OpacityAnimator {
duration: PlasmaCore.Units.longDuration * 2
easing.type: Easing.InOutQuad
}
}
implicitWidth: PlasmaCore.Units.smallSpacing
contentItem: Rectangle {
radius: width/2
color: Qt.rgba(1, 1, 1, 0.3)
}
}
}
......@@ -158,12 +158,12 @@ Item {
height: swipeView.height
width: swipeView.width
property real horizontalMargin: Math.max(Kirigami.Units.largeSpacing, column.width * 0.1 / 2)
property real horizontalMargin: Math.max(Kirigami.Units.largeSpacing, root.width * 0.1 / 2)
GridAppList {
interactive: root.interactive
Layout.leftMargin: column.horizontalMargin
Layout.rightMargin: column.horizontalMargin
leftMargin: column.horizontalMargin
rightMargin: column.horizontalMargin
Layout.fillWidth: true
Layout.fillHeight: true
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment