grid as big as icons

This commit is contained in:
Marco Martin 2019-08-30 16:14:34 +02:00
parent fd2531d19a
commit 5b77af489e
2 changed files with 9 additions and 4 deletions

View file

@ -32,6 +32,7 @@ import org.kde.phone.homescreen 1.0
LauncherContainer {
id: root
readonly property int columns: Math.floor(root.flow.width / cellWidth)
readonly property int cellWidth: root.flow.width / Math.floor(root.flow.width / ((availableCellHeight - reservedSpaceForLabel) + units.smallSpacing*4))
readonly property int cellHeight: availableCellHeight

View file

@ -157,6 +157,7 @@ Item {
PlasmaComponents.ScrollBar.vertical: PlasmaComponents.ScrollBar {
id: scrollabr
opacity: mainFlickable.moving
interactive: false
Behavior on opacity {
OpacityAnimator {
duration: units.longDuration * 2
@ -229,6 +230,9 @@ Item {
anchors.fill: parent
cellWidth: Math.floor(width / launcher.columns)
cellHeight: launcher.cellHeight
configKey: width > height ? "ItemGeometriesHorizontal" : "ItemGeometriesVertical"
containment: plasmoid
editModeCondition: plasmoid.immutable
@ -244,8 +248,8 @@ Item {
defaultItemWidth: units.gridUnit * 6
defaultItemHeight: defaultItemWidth
cellWidth: units.iconSizes.small
cellHeight: cellWidth
//cellWidth: units.iconSizes.small
//cellHeight: cellWidth
acceptsAppletCallback: function(applet, x, y) {
print("Applet: "+applet+" "+x+" "+y)
@ -257,10 +261,10 @@ Item {
configOverlayComponent: ConfigOverlay {}
onEditModeChanged: {
launcherDragManager.active = editMode;
launcherDragManager.active = dragActive || editMode;
}
onDragActiveChanged: {
launcherDragManager.active = dragActive;
launcherDragManager.active = dragActive || editMode;
}
}