swissChili | 23958ca | 2022-02-21 19:23:34 -0800 | [diff] [blame] | 1 | import QtQuick 2.5 |
| 2 | import QtQuick.Controls 2.15 |
| 3 | import QtQuick.Controls.Material 2.0 |
| 4 | import QtQuick.Layouts 1.3 |
| 5 | |
swissChili | 4b3105a | 2022-02-22 16:34:39 -0800 | [diff] [blame^] | 6 | import sh.swisschili.REFAL 1.0 |
| 7 | |
swissChili | 23958ca | 2022-02-21 19:23:34 -0800 | [diff] [blame] | 8 | ApplicationWindow { |
| 9 | id: root |
| 10 | width: 1080 |
| 11 | height: 720 |
| 12 | title: "Notebook" |
| 13 | visible: true |
| 14 | |
swissChili | 4b3105a | 2022-02-22 16:34:39 -0800 | [diff] [blame^] | 15 | Material.theme: Material.Light |
swissChili | 23958ca | 2022-02-21 19:23:34 -0800 | [diff] [blame] | 16 | Material.accent: Material.Orange |
| 17 | |
swissChili | 4b3105a | 2022-02-22 16:34:39 -0800 | [diff] [blame^] | 18 | CellModel { |
| 19 | id: model |
| 20 | } |
| 21 | |
| 22 | Component.onCompleted: { |
| 23 | model.addCell("Refal { = Hi!; }", ""); |
| 24 | model.addCell("<Refal>", "Hi!"); |
| 25 | model.addCell("Hello there", "Hello there"); |
| 26 | } |
| 27 | |
swissChili | 23958ca | 2022-02-21 19:23:34 -0800 | [diff] [blame] | 28 | ColumnLayout { |
| 29 | id: column |
| 30 | anchors.fill: parent |
| 31 | |
| 32 | TabBar { |
| 33 | id: bar |
| 34 | |
| 35 | Layout.fillWidth: true |
| 36 | |
| 37 | TabButton { |
| 38 | text: "Example Workspace" |
| 39 | } |
| 40 | |
| 41 | TabButton { |
| 42 | text: "Another Workspace" |
| 43 | } |
| 44 | |
| 45 | TabButton { |
| 46 | text: "Testing" |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | SplitView { |
| 51 | id: split |
| 52 | Layout.fillHeight: true |
| 53 | Layout.fillWidth: true |
| 54 | orientation: Qt.Horizontal |
| 55 | |
| 56 | ListView { |
| 57 | id: codeEditor |
| 58 | SplitView.fillWidth: true |
| 59 | SplitView.minimumWidth: 400 |
swissChili | 4b3105a | 2022-02-22 16:34:39 -0800 | [diff] [blame^] | 60 | model: model |
swissChili | 23958ca | 2022-02-21 19:23:34 -0800 | [diff] [blame] | 61 | clip: true |
| 62 | |
swissChili | 4b3105a | 2022-02-22 16:34:39 -0800 | [diff] [blame^] | 63 | delegate: NotebookCell { |
swissChili | 23958ca | 2022-02-21 19:23:34 -0800 | [diff] [blame] | 64 | width: codeEditor.width - 5 |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | Item { |
| 69 | id: variables |
| 70 | SplitView.minimumWidth: 240 |
| 71 | |
| 72 | Label { |
| 73 | anchors.centerIn: parent |
| 74 | text: "Vars" |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | } |
| 79 | } |