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()
|
||||
property Item homeScreen
|
||||
property Window homeScreenWindow
|
||||
property bool homeScreenVisible
|
||||
property QtObject homeScreenWindow
|
||||
property bool homeScreenVisible: true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Window 2.12
|
||||
import QtQuick.Layouts 1.1
|
||||
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.plasma.private.mobileshell 1.0 as MobileShell
|
||||
|
||||
Item {
|
||||
id: root
|
||||
width: 640
|
||||
|
|
@ -74,10 +77,34 @@ Item {
|
|||
onWidthChanged: recalculateMaxFavoriteCount()
|
||||
onHeightChanged:recalculateMaxFavoriteCount()
|
||||
Component.onCompleted: {
|
||||
if (plasmoid.screen == 0) {
|
||||
MobileShell.HomeScreenControls.homeScreen = root
|
||||
MobileShell.HomeScreenControls.homeScreenWindow = root.Window.window
|
||||
}
|
||||
componentComplete = true;
|
||||
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 {
|
||||
id: autoScrollTimer
|
||||
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.plasma.private.nanoshell 2.0 as NanoShell
|
||||
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
|
||||
|
||||
import "LayoutManager.js" as LayoutManager
|
||||
|
||||
import "quicksettings"
|
||||
import "indicators" as Indicators
|
||||
|
||||
|
||||
Item {
|
||||
id: root
|
||||
width: 480
|
||||
|
|
@ -47,7 +49,7 @@ Item {
|
|||
property bool reorderingApps: false
|
||||
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
|
||||
|
||||
|
|
|
|||
|
|
@ -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.mobileshell 1.0 as MobileShell
|
||||
|
||||
PlasmaCore.ColorScope {
|
||||
id: root
|
||||
width: 600
|
||||
|
|
@ -37,7 +39,7 @@ PlasmaCore.ColorScope {
|
|||
|
||||
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
|
||||
|
||||
|
|
@ -46,6 +48,12 @@ PlasmaCore.ColorScope {
|
|||
id: taskSwitcherLoader
|
||||
}
|
||||
//FIXME: why it crashes on startup if TaskSwitcher is loaded immediately?
|
||||
Connections {
|
||||
target: plasmoid.nativeInterface
|
||||
function onHasCloseableActiveWindowChanged() {
|
||||
MobileShell.HomeScreenControls.homeScreenVisible = !plasmoid.nativeInterface.hasCloseableActiveWindow
|
||||
}
|
||||
}
|
||||
Timer {
|
||||
running: true
|
||||
interval: 200
|
||||
|
|
@ -204,10 +212,11 @@ PlasmaCore.ColorScope {
|
|||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
iconSource: "start-here-kde"
|
||||
enabled: taskSwitcher && taskSwitcher.tasksCount > 0
|
||||
checkable: true
|
||||
onCheckedChanged: {
|
||||
//checkable: true
|
||||
onClicked: {
|
||||
taskSwitcher.hide();
|
||||
root.minimizeAll();
|
||||
MobileShell.HomeScreenControls.resetHomeScreenPosition()
|
||||
//plasmoid.nativeInterface.showDesktop = checked;
|
||||
}
|
||||
onPressed: mainMouseArea.managePressed(mouse);
|
||||
|
|
|
|||
Loading…
Reference in a new issue