mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
make use of HomeScreenControls
This commit is contained in:
parent
7e6f6b063e
commit
3f32a18b62
4 changed files with 44 additions and 6 deletions
|
|
@ -26,6 +26,6 @@ QtObject {
|
||||||
|
|
||||||
signal resetHomeScreenPosition()
|
signal resetHomeScreenPosition()
|
||||||
property Item homeScreen
|
property Item homeScreen
|
||||||
property Window homeScreenWindow
|
property QtObject homeScreenWindow
|
||||||
property bool homeScreenVisible
|
property bool homeScreenVisible: true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import QtQuick 2.12
|
import QtQuick 2.12
|
||||||
|
import QtQuick.Window 2.12
|
||||||
import QtQuick.Layouts 1.1
|
import QtQuick.Layouts 1.1
|
||||||
import QtGraphicalEffects 1.0
|
import QtGraphicalEffects 1.0
|
||||||
|
|
||||||
|
|
@ -32,6 +33,8 @@ import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutM
|
||||||
|
|
||||||
import org.kde.phone.homescreen 1.0
|
import org.kde.phone.homescreen 1.0
|
||||||
|
|
||||||
|
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
width: 640
|
width: 640
|
||||||
|
|
@ -74,10 +77,34 @@ Item {
|
||||||
onWidthChanged: recalculateMaxFavoriteCount()
|
onWidthChanged: recalculateMaxFavoriteCount()
|
||||||
onHeightChanged:recalculateMaxFavoriteCount()
|
onHeightChanged:recalculateMaxFavoriteCount()
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
if (plasmoid.screen == 0) {
|
||||||
|
MobileShell.HomeScreenControls.homeScreen = root
|
||||||
|
MobileShell.HomeScreenControls.homeScreenWindow = root.Window.window
|
||||||
|
}
|
||||||
componentComplete = true;
|
componentComplete = true;
|
||||||
recalculateMaxFavoriteCount()
|
recalculateMaxFavoriteCount()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Plasmoid.onScreenChanged: {
|
||||||
|
if (plasmoid.screen == 0) {
|
||||||
|
MobileShell.HomeScreenControls.homeScreen = root
|
||||||
|
MobileShell.HomeScreenControls.homeScreenWindow = root.Window.window
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Window.onWindowChanged: {
|
||||||
|
if (plasmoid.screen == 0) {
|
||||||
|
MobileShell.HomeScreenControls.homeScreenWindow = root.Window.window
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: MobileShell.HomeScreenControls
|
||||||
|
function onResetHomeScreenPosition() {
|
||||||
|
scrollAnim.to = 0;
|
||||||
|
scrollAnim.restart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
id: autoScrollTimer
|
id: autoScrollTimer
|
||||||
property bool scrollDown: true
|
property bool scrollDown: true
|
||||||
|
|
|
||||||
|
|
@ -29,12 +29,14 @@ import org.kde.plasma.workspace.components 2.0 as PlasmaWorkspace
|
||||||
import org.kde.taskmanager 0.1 as TaskManager
|
import org.kde.taskmanager 0.1 as TaskManager
|
||||||
|
|
||||||
import org.kde.plasma.private.nanoshell 2.0 as NanoShell
|
import org.kde.plasma.private.nanoshell 2.0 as NanoShell
|
||||||
|
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
|
||||||
|
|
||||||
import "LayoutManager.js" as LayoutManager
|
import "LayoutManager.js" as LayoutManager
|
||||||
|
|
||||||
import "quicksettings"
|
import "quicksettings"
|
||||||
import "indicators" as Indicators
|
import "indicators" as Indicators
|
||||||
|
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
width: 480
|
width: 480
|
||||||
|
|
@ -47,7 +49,7 @@ Item {
|
||||||
property bool reorderingApps: false
|
property bool reorderingApps: false
|
||||||
property var layoutManager: LayoutManager
|
property var layoutManager: LayoutManager
|
||||||
|
|
||||||
readonly property bool showingApp: !plasmoid.nativeInterface.showDesktop && (hasTasks || NanoShell.StartupFeedback.visible)
|
readonly property bool showingApp: !MobileShell.HomeScreenControls.homeScreenVisible//!plasmoid.nativeInterface.showDesktop && (hasTasks || NanoShell.StartupFeedback.visible)
|
||||||
|
|
||||||
readonly property bool hasTasks: tasksModel.count > 0
|
readonly property bool hasTasks: tasksModel.count > 0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,8 @@ import org.kde.kquickcontrolsaddons 2.0
|
||||||
|
|
||||||
import org.kde.plasma.private.nanoshell 2.0 as NanoShell
|
import org.kde.plasma.private.nanoshell 2.0 as NanoShell
|
||||||
|
|
||||||
|
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
|
||||||
|
|
||||||
PlasmaCore.ColorScope {
|
PlasmaCore.ColorScope {
|
||||||
id: root
|
id: root
|
||||||
width: 600
|
width: 600
|
||||||
|
|
@ -37,7 +39,7 @@ PlasmaCore.ColorScope {
|
||||||
|
|
||||||
Plasmoid.backgroundHints: PlasmaCore.Types.NoBackground
|
Plasmoid.backgroundHints: PlasmaCore.Types.NoBackground
|
||||||
|
|
||||||
readonly property bool showingApp: !plasmoid.nativeInterface.showDesktop && (hasTasks || NanoShell.StartupFeedback.visible)
|
readonly property bool showingApp: plasmoid.nativeInterface.hasCloseableActiveWindow// !plasmoid.nativeInterface.showDesktop && (hasTasks || NanoShell.StartupFeedback.visible)
|
||||||
|
|
||||||
readonly property bool hasTasks: tasksModel.count > 0
|
readonly property bool hasTasks: tasksModel.count > 0
|
||||||
|
|
||||||
|
|
@ -46,6 +48,12 @@ PlasmaCore.ColorScope {
|
||||||
id: taskSwitcherLoader
|
id: taskSwitcherLoader
|
||||||
}
|
}
|
||||||
//FIXME: why it crashes on startup if TaskSwitcher is loaded immediately?
|
//FIXME: why it crashes on startup if TaskSwitcher is loaded immediately?
|
||||||
|
Connections {
|
||||||
|
target: plasmoid.nativeInterface
|
||||||
|
function onHasCloseableActiveWindowChanged() {
|
||||||
|
MobileShell.HomeScreenControls.homeScreenVisible = !plasmoid.nativeInterface.hasCloseableActiveWindow
|
||||||
|
}
|
||||||
|
}
|
||||||
Timer {
|
Timer {
|
||||||
running: true
|
running: true
|
||||||
interval: 200
|
interval: 200
|
||||||
|
|
@ -204,10 +212,11 @@ PlasmaCore.ColorScope {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
iconSource: "start-here-kde"
|
iconSource: "start-here-kde"
|
||||||
enabled: taskSwitcher && taskSwitcher.tasksCount > 0
|
enabled: taskSwitcher && taskSwitcher.tasksCount > 0
|
||||||
checkable: true
|
//checkable: true
|
||||||
onCheckedChanged: {
|
onClicked: {
|
||||||
taskSwitcher.hide();
|
taskSwitcher.hide();
|
||||||
root.minimizeAll();
|
root.minimizeAll();
|
||||||
|
MobileShell.HomeScreenControls.resetHomeScreenPosition()
|
||||||
//plasmoid.nativeInterface.showDesktop = checked;
|
//plasmoid.nativeInterface.showDesktop = checked;
|
||||||
}
|
}
|
||||||
onPressed: mainMouseArea.managePressed(mouse);
|
onPressed: mainMouseArea.managePressed(mouse);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue