Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 3f32a18b authored by Marco Martin's avatar Marco Martin

make use of HomeScreenControls

parent 7e6f6b06
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment