Debian Codegraph @

src/app/qml/components/SidebarPageLayout.qml

raw
1 import QtQuick 2.4
2 import Lomiri.Components 1.3
3
4 import "../actions" as Actions
5
6 PageTreeNode {
7 id: rootItem
8 anchors.fill: parent
9
10 property alias sidebarLoader: sidePageLoader
11 property alias mainLoader: mainLoader
12
13 property bool sidebarActive: true
14 property alias sidebarWidth: sidebar.width
15 property alias sidebarMinimumWidth: sidebar.minimumWidth
16 property alias sidebarMaximumWidth: sidebar.maximumWidth
17
18 property alias sidebarResizing: sidebar.resizing
19
20 property Action showPanelAction: Actions.ShowPanel {
21 checkable: true
22 visible: enabled
23 shortcut: "Ctrl+Shift+O"
24 enabled: rootItem.sidebarActive
25 }
26
27 ResizeableSidebar {
28 id: sidebar
29 visible: showPanelAction.checked && sidebarActive
30 anchors {
31 left: parent.left
32 leftMargin: sidebar.visible ? 0 : -sidebar.width
33 }
34
35 Behavior on anchors.leftMargin {
36 LomiriNumberAnimation {}
37 }
38
39 Loader {
40 id: sidePageLoader
41 anchors.fill: parent
42 onLoaded: console.log("[SidebarPageLayout] Sidebar loaded")
43 }
44 }
45
46 Loader {
47 id: mainLoader
48 anchors {
49 left: sidebar.right
50 right: parent.right
51 top: parent.top
52 bottom: parent.bottom
53 }
54 }
55 }