diff --git a/containments/homescreen/package/contents/ui/AppletsArea.qml b/containments/homescreen/package/contents/ui/AppletsArea.qml index f358f3f6..a80379f3 100644 --- a/containments/homescreen/package/contents/ui/AppletsArea.qml +++ b/containments/homescreen/package/contents/ui/AppletsArea.qml @@ -31,7 +31,7 @@ MouseEventListener { property Item lastSpacer: spacer property Item favoritesStrip: favoritesView width: root.width - height: mainLayout.Layout.minimumHeight + height: Math.max(applicationsView.height - stripe.height, mainLayout.Layout.minimumHeight) property int margin: stripe.height + units.gridUnit * 2 property Item draggingApplet property int startMouseX @@ -63,7 +63,7 @@ MouseEventListener { } onPressAndHold: { print(favoritesView.contains(mapToItem(favoritesView, mouse.x, mouse.y))) - if (!root.locked && !favoritesView.contains(mapToItem(favoritesView, mouse.x, mouse.y))) { + if (!favoritesView.contains(mapToItem(favoritesView, mouse.x, mouse.y))) { editOverlay.visible = true; var pos = mapToItem(appletsLayout, mouse.x, mouse.y); draggingApplet = appletsSpace.layout.childAt(pos.x, pos.y); @@ -154,37 +154,11 @@ MouseEventListener { anchors { fill: parent } - Item { - Layout.fillWidth: true - Layout.minimumHeight: plasmoid.availableScreenRect.height + units.gridUnit * 3 - Layout.maximumHeight: Layout.minimumHeight - Clock { - anchors { - horizontalCenter: parent.horizontalCenter - bottom: goUp.top - margins: units.largeSpacing - } - } - PlasmaCore.IconItem { - id: goUp - source: "go-up" - width: units.iconSizes.huge - height: width - colorGroup: PlasmaCore.Theme.ComplementaryColorGroup - anchors { - horizontalCenter: parent.horizontalCenter - bottom: parent.bottom - bottomMargin: units.gridUnit * 3 - } - } - } - Item { - id: spacer - width: parent.width - height: Math.max(0, plasmoid.availableScreenRect.height/4 * Math.max(0, 4 -plasmoid.applets.length) - stripe.height - units.gridUnit * 3) - //plasmoid.availableScreenRect.height/4 - } + Item { + Layout.minimumHeight: krunner.inputHeight + Layout.minimumWidth: Layout.minimumHeight + } PlasmaCore.ColorScope { id: colorScope //TODO: decide what color we want applets @@ -208,12 +182,6 @@ MouseEventListener { width: parent.width } } - Item { - Layout.fillWidth: true - Layout.fillHeight: true - Layout.minimumHeight: margin - Layout.maximumHeight: Layout.minimumHeight - } } SatelliteStripe { id: stripe @@ -221,7 +189,26 @@ MouseEventListener { property int viewPos: applicationsView.contentItem.height * applicationsView.visibleArea.yPosition y: Math.max(viewPos + krunner.inputHeight - units.smallSpacing, - Math.min(parent.height, viewPos + plasmoid.availableScreenRect.height - height) + Math.max(0, -(parent.height - height + applicationsView.contentY))) + Math.min(parent.height, viewPos + plasmoid.availableScreenRect.height - height) ) + + PlasmaCore.IconItem { + id: goUp + source: "go-up" + width: units.iconSizes.huge + height: width + colorGroup: PlasmaCore.Theme.ComplementaryColorGroup + anchors { + horizontalCenter: parent.horizontalCenter + bottom: parent.top + } + MouseArea { + anchors { + fill: parent + margins: -units.smallSpacing + } + onClicked: applicationsView.flick(0, -applicationsView.height/2) + } + } GridView { id: favoritesView diff --git a/containments/homescreen/package/contents/ui/Clock.qml b/containments/homescreen/package/contents/ui/Clock.qml deleted file mode 100644 index 9118eaf7..00000000 --- a/containments/homescreen/package/contents/ui/Clock.qml +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2014 Aaron Seigo - * Copyright 2015 Marco Martin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick 2.1 -import QtQuick.Layouts 1.1 -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents - - -PlasmaComponents.Label { - id: bigClock - - PlasmaCore.DataSource { - id: timeSource - engine: "time" - connectedSources: ["Local"] - interval: 60 * 1000 - } - - Layout.minimumWidth: implicitWidth - Layout.minimumHeight: implicitHeight - - text: Qt.formatTime(timeSource.data.Local.DateTime, "hh:mm") - color: PlasmaCore.ColorScope.textColor - horizontalAlignment: Qt.AlignHCenter - verticalAlignment: Qt.AlignVCenter - font.pointSize: 40 - style: Text.Raised - styleColor: "black" -} diff --git a/containments/homescreen/package/contents/ui/HomeLauncherSvg.qml b/containments/homescreen/package/contents/ui/HomeLauncherSvg.qml deleted file mode 100644 index 4b9e1909..00000000 --- a/containments/homescreen/package/contents/ui/HomeLauncherSvg.qml +++ /dev/null @@ -1,33 +0,0 @@ -import QtQuick 2.0 -import org.kde.plasma.core 2.0 as PlasmaCore - -Item { - id: root - width: parent.width / parent.columns - height: root.buttonHeight - property var callback - property string text - property string sub - property alias svg: icon.svg - property alias elementId: icon.elementId - - PlasmaCore.SvgItem{ - id: icon - width: units.iconSizes.medium - height: width - anchors.centerIn: parent - } - - MouseArea { - anchors.fill: parent - propagateComposedEvents: true - - onClicked: { - if (callback) { - callback(); - } else { - addNumber(parent.text); - } - } - } -} diff --git a/containments/homescreen/package/contents/ui/main.qml b/containments/homescreen/package/contents/ui/main.qml index 2f56f140..43eea009 100644 --- a/containments/homescreen/package/contents/ui/main.qml +++ b/containments/homescreen/package/contents/ui/main.qml @@ -36,7 +36,6 @@ Item { property alias appletsSpace: applicationsView.headerItem property int buttonHeight: (Math.floor(height / units.iconSizes.huge) > 6) ? units.iconSizes.enormous : units.iconSizes.huge property bool reorderingApps: false - property bool locked: applicationsView.contentY < -applicationsView.headerItem.height + plasmoid.availableScreenRect.height property var layoutManager: LayoutManager //END properties @@ -74,8 +73,6 @@ Item { //event compress the enable of animations //startupTimer.restart(); } - - checkLastSpacer() } //Autoscroll related functions @@ -99,13 +96,6 @@ Item { scrollDownIndicator.opacity = 0; } - function checkLastSpacer() { - appletsSpace.lastSpacer.parent = root - - if (appletsSpace.layout.children.length <= 1) { - appletsSpace.lastSpacer.parent = appletsSpace.layout; - } - } //END functions @@ -115,7 +105,6 @@ Item { LayoutManager.plasmoid = plasmoid; LayoutManager.root = root; LayoutManager.layout = appletsSpace.layout; - LayoutManager.lastSpacer = appletsSpace.lastSpacer; LayoutManager.restore(); applicationsView.contentY = -applicationsView.headerItem.height*2; @@ -220,7 +209,6 @@ Item { width: Math.min(parent.width, parent.height) height: width } - Component.onDestruction: checkLastSpacer(); } } @@ -400,7 +388,7 @@ Item { anchors { horizontalCenter: parent.horizontalCenter top: parent.top - topMargin: 200 + topMargin: 300 } z: 2 opacity: 0 @@ -476,7 +464,6 @@ Item { } property var dragData - property bool wasLocked: true cellWidth: root.width / 4 cellHeight: root.buttonHeight @@ -484,48 +471,6 @@ Item { snapMode: GridView.SnapToRow - onFlickingChanged: { - draggingVerticallyChanged(false); - } - onDraggingVerticallyChanged: { - if (draggingVertically) { - return; - } - - if (wasLocked) { - //scrolling down, unlock - if (contentY > (-headerItem.height + root.height/5)) { - scrollAnim.to = -headerItem.height +plasmoid.availableScreenRect.height - scrollAnim.running = true; - wasLocked = false; - return; - - //scrolling up, lock - } else { - scrollAnim.to = -headerItem.height; - scrollAnim.running = true; - wasLocked = true; - return; - } - - //was unlocked - } else { - //scrolling up, lock - if (contentY < (-headerItem.height + root.height - root.height/5)) { - scrollAnim.to = -headerItem.height; - scrollAnim.running = true; - wasLocked = true; - return; - - //scrolling down, unlock - } else if (contentY < (-headerItem.height + root.height + root.height/5)) { - scrollAnim.to = -headerItem.height +plasmoid.availableScreenRect.height - scrollAnim.running = true; - wasLocked = false; - return; - } - } - } NumberAnimation { id: scrollAnim target: applicationsView @@ -559,31 +504,14 @@ Item { } } - Rectangle { + PlasmaComponents.ScrollBar { anchors { + right: parent.right top: parent.top bottom: parent.bottom - horizontalCenter: scrollHandle.horizontalCenter - } - width: units.smallSpacing - color: PlasmaCore.ColorScope.textColor - opacity: scrollHandle.opacity / 2 - } - Rectangle { - id: scrollHandle - color: PlasmaCore.ColorScope.textColor - width: units.gridUnit - height: width - radius: width - anchors.right: parent.right - y: applicationsView.height * applicationsView.visibleArea.yPosition - opacity: applicationsView.flicking || scrollDownIndicator.opacity > 0 || scrollUpIndicator.opacity > 0 ? 0.8 : 0 - Behavior on opacity { - NumberAnimation { - duration: units.longDuration - easing.type: Easing.InOutQuad - } } + interactive: false + flickableItem: applicationsView } } }