diff --git a/applications/task-switcher/main.cpp b/applications/task-switcher/main.cpp index 2180c6c2c..d749bd2df 100644 --- a/applications/task-switcher/main.cpp +++ b/applications/task-switcher/main.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include "controller.h" @@ -14,6 +15,7 @@ using namespace std; using namespace Oxide; +using namespace Oxide::QML; using namespace Oxide::Sentry; void sigHandler(int signal){ @@ -32,8 +34,8 @@ int main(int argc, char *argv[]){ auto screenProvider = new ScreenProvider(&app); Controller controller(&app, screenProvider); QQmlApplicationEngine engine; + registerQML(&engine); QQmlContext* context = engine.rootContext(); - context->setContextProperty("screenGeometry", app.primaryScreen()->geometry()); context->setContextProperty("apps", QVariant::fromValue(controller.getApps())); context->setContextProperty("controller", &controller); engine.rootContext()->setContextProperty("screenProvider", screenProvider); diff --git a/applications/task-switcher/main.qml b/applications/task-switcher/main.qml index 84aef9453..c76aaf436 100644 --- a/applications/task-switcher/main.qml +++ b/applications/task-switcher/main.qml @@ -2,14 +2,14 @@ import QtQuick 2.10 import QtQuick.Window 2.3 import QtQuick.Controls 2.4 import QtQuick.Layouts 1.0 +import "qrc:/codes.eeems.oxide" import "./widgets" -ApplicationWindow { +OxideWindow { id: window objectName: "window" visible: stateController.state === "loaded" - width: screenGeometry.width - height: screenGeometry.height + backgroundColor: "transparent" title: qsTr("Corrupt") property int itemPadding: 10 Connections{ @@ -25,6 +25,12 @@ ApplicationWindow { } } } + Shortcut{ + sequence: [StandardKey.Cancel, Qt.Key_Backspace] + context: Qt.ApplicationShortcut + onActivated: controller.previousApplication() + } + Component.onCompleted: { controller.startup(); } @@ -45,17 +51,16 @@ ApplicationWindow { } } } - contentData: [ - MouseArea { - anchors.fill: parent - enabled: stateController.state === "loaded" - onClicked: { - controller.breadcrumb("background", "click", "ui"); - controller.previousApplication(); - } + initialItem: MouseArea { + anchors.fill: parent + enabled: stateController.state === "loaded" + onClicked: { + controller.breadcrumb("background", "click", "ui"); + controller.previousApplication(); } - ] - footer: Rectangle { + } + page.header: Item{} + page.footer: Rectangle { id: footer color: "white" border.color: "black"