2
0
mirror of synced 2025-02-19 10:07:24 +00:00
status-qml/src/StatusQ/Layout/StatusAppLayout.qml
Pascal Precht 554998dc34 feat(Layout): introduce StatusAppLayout component
This introduces a layout component to quickly scaffold a Status Desktop
ui layout.

Usage:

```qml
import StatusQ.Layout 0.1

StatusAppLayout {
    appNavBar: StatusAppNavBar { ... }
    appView: StackView {
        anchors.fill: parent
        initialItem: Component { ... }
    }
}
```

Closes: #77
2021-05-27 15:01:55 +02:00

50 lines
984 B
QML

import QtQuick 2.13
import QtQuick.Layouts 1.13
import QtQuick.Controls 2.13
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
Rectangle {
id: statusAppLayout
implicitWidth: 900
implicitHeight: 600
color: Theme.palette.statusAppLayout.backgroundColor
property StatusAppNavBar appNavBar
property Item appView
onAppNavBarChanged: {
if (!!appNavBar) {
appNavBar.parent = appNavBarSlot
}
}
onAppViewChanged: {
if (!!appView) {
appView.parent = appViewSlot
}
}
Row {
id: rowLayout
spacing: 0
height: statusAppLayout.height
width: statusAppLayout.width
Item {
id: appNavBarSlot
height: statusAppLayout.height
width: 78
}
Item {
id: appViewSlot
height: statusAppLayout.height
width: statusAppLayout.width - appNavBarSlot.width
}
}
}