Skip to content

Commit

Permalink
Add landscape support to process manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems committed Jan 14, 2024
1 parent c13bdfb commit eb8cfe1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 35 deletions.
4 changes: 3 additions & 1 deletion applications/process-manager/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
#include <fcntl.h>
#include <liboxide.h>
#include <liboxide/eventfilter.h>
#include <liboxide/oxideqml.h>

#include "controller.h"

using namespace std;
using namespace Oxide;
using namespace Oxide::QML;
using namespace Oxide::Sentry;

int main(int argc, char *argv[]){
Expand All @@ -26,9 +28,9 @@ int main(int argc, char *argv[]){
app.setApplicationDisplayName("Process Monitor");
app.setApplicationVersion(APP_VERSION);
QQmlApplicationEngine engine;
registerQML(&engine);
QQmlContext* context = engine.rootContext();
Controller controller(&engine);
context->setContextProperty("screenGeometry", app.primaryScreen()->geometry());
context->setContextProperty("controller", &controller);
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (engine.rootObjects().isEmpty()){
Expand Down
59 changes: 25 additions & 34 deletions applications/process-manager/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import QtQuick 2.10
import QtQuick.Window 2.3
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.11
import "qrc:/codes.eeems.oxide"
import "widgets"

ApplicationWindow {
OxideWindow {
id: window
visible: true
width: screenGeometry.width
height: screenGeometry.height
backgroundColor: "white"
onAfterSynchronizing: {
if (stateController.state == "loading") {
stateController.state = "loaded";
Expand All @@ -21,37 +21,30 @@ ApplicationWindow {
running: true
onTriggered: controller.reload()
}

menuBar: ColumnLayout {
width: parent.width
ToolBar {
Layout.fillWidth: true
background: Rectangle { color: "black" }
RowLayout {
width: parent.width
BetterButton {
text: "⬅️"
onClicked: quitTimer.start()
Timer {
id: quitTimer
interval: 1000
onTriggered: {
controller.breadcrumb("back", "click", "ui");
Qt.quit();
}
}
}
Item { Layout.fillWidth: true }
Label {
text: "Process Manager"
color: "white"
anchors.centerIn: parent
leftMenu: [
BetterButton {
text: "⬅️"
onClicked: quitTimer.start()
Timer {
id: quitTimer
interval: 1000
onTriggered: {
controller.breadcrumb("back", "click", "ui");
Qt.quit();
}
}
}
]
centerMenu: [
Label {
text: "Process Manager"
color: "white"
}
]
initialItem: Item{
RowLayout {
id: tasksViewHeaderContent
Layout.fillWidth: true
width: parent.width
Label {
text: "Process"
color: "black"
Expand Down Expand Up @@ -124,11 +117,9 @@ ApplicationWindow {
}
Item { width: scrollbar.width }
}
}
background: Rectangle { color: "white" }
contentData: [
ColumnLayout {
anchors.fill: parent
anchors.topMargin: tasksViewHeaderContent.height
BetterButton {
text: ""
visible: !tasksView.atYBeginning
Expand Down Expand Up @@ -336,8 +327,8 @@ ApplicationWindow {
}
}
}
]
footer: ToolBar {
}
page.footer: ToolBar {
background: Rectangle { color: "black" }
}
StateGroup {
Expand Down

0 comments on commit eb8cfe1

Please sign in to comment.