mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03:09 +00:00
remove the fake lockscreen
remove the first screen simplify the code add a clickable arrow to suggest where the apps are
This commit is contained in:
parent
8cef8fe532
commit
475d32d0a7
4 changed files with 31 additions and 196 deletions
|
|
@ -31,7 +31,7 @@ MouseEventListener {
|
||||||
property Item lastSpacer: spacer
|
property Item lastSpacer: spacer
|
||||||
property Item favoritesStrip: favoritesView
|
property Item favoritesStrip: favoritesView
|
||||||
width: root.width
|
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 int margin: stripe.height + units.gridUnit * 2
|
||||||
property Item draggingApplet
|
property Item draggingApplet
|
||||||
property int startMouseX
|
property int startMouseX
|
||||||
|
|
@ -63,7 +63,7 @@ MouseEventListener {
|
||||||
}
|
}
|
||||||
onPressAndHold: {
|
onPressAndHold: {
|
||||||
print(favoritesView.contains(mapToItem(favoritesView, mouse.x, mouse.y)))
|
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;
|
editOverlay.visible = true;
|
||||||
var pos = mapToItem(appletsLayout, mouse.x, mouse.y);
|
var pos = mapToItem(appletsLayout, mouse.x, mouse.y);
|
||||||
draggingApplet = appletsSpace.layout.childAt(pos.x, pos.y);
|
draggingApplet = appletsSpace.layout.childAt(pos.x, pos.y);
|
||||||
|
|
@ -154,37 +154,11 @@ MouseEventListener {
|
||||||
anchors {
|
anchors {
|
||||||
fill: parent
|
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 {
|
PlasmaCore.ColorScope {
|
||||||
id: colorScope
|
id: colorScope
|
||||||
//TODO: decide what color we want applets
|
//TODO: decide what color we want applets
|
||||||
|
|
@ -208,12 +182,6 @@ MouseEventListener {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Item {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.fillHeight: true
|
|
||||||
Layout.minimumHeight: margin
|
|
||||||
Layout.maximumHeight: Layout.minimumHeight
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
SatelliteStripe {
|
SatelliteStripe {
|
||||||
id: stripe
|
id: stripe
|
||||||
|
|
@ -221,7 +189,26 @@ MouseEventListener {
|
||||||
property int viewPos: applicationsView.contentItem.height * applicationsView.visibleArea.yPosition
|
property int viewPos: applicationsView.contentItem.height * applicationsView.visibleArea.yPosition
|
||||||
|
|
||||||
y: Math.max(viewPos + krunner.inputHeight - units.smallSpacing,
|
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 {
|
GridView {
|
||||||
id: favoritesView
|
id: favoritesView
|
||||||
|
|
|
||||||
|
|
@ -1,47 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright 2014 Aaron Seigo <aseigo@kde.org>
|
|
||||||
* Copyright 2015 Marco Martin <notmart@gmail.com>
|
|
||||||
*
|
|
||||||
* 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"
|
|
||||||
}
|
|
||||||
|
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -36,7 +36,6 @@ Item {
|
||||||
property alias appletsSpace: applicationsView.headerItem
|
property alias appletsSpace: applicationsView.headerItem
|
||||||
property int buttonHeight: (Math.floor(height / units.iconSizes.huge) > 6) ? units.iconSizes.enormous : units.iconSizes.huge
|
property int buttonHeight: (Math.floor(height / units.iconSizes.huge) > 6) ? units.iconSizes.enormous : units.iconSizes.huge
|
||||||
property bool reorderingApps: false
|
property bool reorderingApps: false
|
||||||
property bool locked: applicationsView.contentY < -applicationsView.headerItem.height + plasmoid.availableScreenRect.height
|
|
||||||
property var layoutManager: LayoutManager
|
property var layoutManager: LayoutManager
|
||||||
//END properties
|
//END properties
|
||||||
|
|
||||||
|
|
@ -74,8 +73,6 @@ Item {
|
||||||
//event compress the enable of animations
|
//event compress the enable of animations
|
||||||
//startupTimer.restart();
|
//startupTimer.restart();
|
||||||
}
|
}
|
||||||
|
|
||||||
checkLastSpacer()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Autoscroll related functions
|
//Autoscroll related functions
|
||||||
|
|
@ -99,13 +96,6 @@ Item {
|
||||||
scrollDownIndicator.opacity = 0;
|
scrollDownIndicator.opacity = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkLastSpacer() {
|
|
||||||
appletsSpace.lastSpacer.parent = root
|
|
||||||
|
|
||||||
if (appletsSpace.layout.children.length <= 1) {
|
|
||||||
appletsSpace.lastSpacer.parent = appletsSpace.layout;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//END functions
|
//END functions
|
||||||
|
|
@ -115,7 +105,6 @@ Item {
|
||||||
LayoutManager.plasmoid = plasmoid;
|
LayoutManager.plasmoid = plasmoid;
|
||||||
LayoutManager.root = root;
|
LayoutManager.root = root;
|
||||||
LayoutManager.layout = appletsSpace.layout;
|
LayoutManager.layout = appletsSpace.layout;
|
||||||
LayoutManager.lastSpacer = appletsSpace.lastSpacer;
|
|
||||||
LayoutManager.restore();
|
LayoutManager.restore();
|
||||||
applicationsView.contentY = -applicationsView.headerItem.height*2;
|
applicationsView.contentY = -applicationsView.headerItem.height*2;
|
||||||
|
|
||||||
|
|
@ -220,7 +209,6 @@ Item {
|
||||||
width: Math.min(parent.width, parent.height)
|
width: Math.min(parent.width, parent.height)
|
||||||
height: width
|
height: width
|
||||||
}
|
}
|
||||||
Component.onDestruction: checkLastSpacer();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -400,7 +388,7 @@ Item {
|
||||||
anchors {
|
anchors {
|
||||||
horizontalCenter: parent.horizontalCenter
|
horizontalCenter: parent.horizontalCenter
|
||||||
top: parent.top
|
top: parent.top
|
||||||
topMargin: 200
|
topMargin: 300
|
||||||
}
|
}
|
||||||
z: 2
|
z: 2
|
||||||
opacity: 0
|
opacity: 0
|
||||||
|
|
@ -476,7 +464,6 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
property var dragData
|
property var dragData
|
||||||
property bool wasLocked: true
|
|
||||||
|
|
||||||
cellWidth: root.width / 4
|
cellWidth: root.width / 4
|
||||||
cellHeight: root.buttonHeight
|
cellHeight: root.buttonHeight
|
||||||
|
|
@ -484,48 +471,6 @@ Item {
|
||||||
|
|
||||||
snapMode: GridView.SnapToRow
|
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 {
|
NumberAnimation {
|
||||||
id: scrollAnim
|
id: scrollAnim
|
||||||
target: applicationsView
|
target: applicationsView
|
||||||
|
|
@ -559,31 +504,14 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
PlasmaComponents.ScrollBar {
|
||||||
anchors {
|
anchors {
|
||||||
|
right: parent.right
|
||||||
top: parent.top
|
top: parent.top
|
||||||
bottom: parent.bottom
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue