2020-10-18 06:50:26 -05:00
|
|
|
/*
|
2023-01-22 23:51:35 -06:00
|
|
|
* Copyright (c) 2021-2023 Alex Spataru <https://github.com/alex-spataru>
|
2020-10-18 06:50:26 -05:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
* THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2022-05-02 04:31:32 -05:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Layouts
|
|
|
|
import QtQuick.Controls
|
2021-09-04 23:26:04 -05:00
|
|
|
|
2021-09-25 21:48:06 -05:00
|
|
|
import "../Dashboard" as DashboardItems
|
2020-10-18 06:50:26 -05:00
|
|
|
|
2024-08-11 18:20:03 -05:00
|
|
|
RowLayout {
|
2024-05-05 00:20:10 -05:00
|
|
|
id: root
|
2024-08-11 18:20:03 -05:00
|
|
|
spacing: 0
|
2024-05-05 00:20:10 -05:00
|
|
|
|
2024-08-12 00:52:58 -05:00
|
|
|
//
|
|
|
|
// Custom properties
|
|
|
|
//
|
|
|
|
property int structureMargin: 0
|
|
|
|
readonly property int structureWidth: 280
|
|
|
|
readonly property bool structureVisible: structureMargin > -1 * structureWidth
|
|
|
|
|
|
|
|
//
|
|
|
|
// Hides/shows the structure tree
|
|
|
|
//
|
|
|
|
function toggleStructureTree() {
|
|
|
|
if (structureMargin < 0)
|
|
|
|
structureMargin = 0
|
|
|
|
else
|
|
|
|
structureMargin = -1 * root.structureWidth
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Animations
|
|
|
|
//
|
|
|
|
Behavior on structureMargin {NumberAnimation{}}
|
|
|
|
|
2024-05-05 00:20:10 -05:00
|
|
|
//
|
2024-08-11 18:20:03 -05:00
|
|
|
// View options window
|
2024-05-05 00:20:10 -05:00
|
|
|
//
|
2024-08-11 18:20:03 -05:00
|
|
|
DashboardItems.ViewOptions {
|
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.minimumWidth: 280
|
2024-08-12 00:52:58 -05:00
|
|
|
visible: root.structureVisible
|
|
|
|
Layout.leftMargin: root.structureMargin
|
2024-08-11 18:20:03 -05:00
|
|
|
onColumnsChanged:(columns) => widgetGrid.columns = columns
|
|
|
|
}
|
2021-09-25 01:26:05 -05:00
|
|
|
|
2024-08-11 18:20:03 -05:00
|
|
|
//
|
|
|
|
// Panel border rectangle
|
|
|
|
//
|
|
|
|
Rectangle {
|
|
|
|
z: 2
|
|
|
|
width: 1
|
|
|
|
Layout.fillHeight: true
|
2024-08-12 00:52:58 -05:00
|
|
|
visible: root.structureVisible
|
2024-08-11 18:20:03 -05:00
|
|
|
color: Cpp_ThemeManager.colors["setup_border"]
|
2024-05-05 00:20:10 -05:00
|
|
|
|
2024-08-11 18:20:03 -05:00
|
|
|
Rectangle {
|
|
|
|
width: 1
|
2024-05-05 00:20:10 -05:00
|
|
|
height: 32
|
2024-08-11 18:20:03 -05:00
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.left: parent.left
|
|
|
|
color: Cpp_ThemeManager.colors["pane_caption_border"]
|
2021-09-25 01:26:05 -05:00
|
|
|
}
|
2024-05-05 00:20:10 -05:00
|
|
|
}
|
2024-08-11 18:20:03 -05:00
|
|
|
|
|
|
|
//
|
|
|
|
// Widget grid
|
|
|
|
//
|
|
|
|
DashboardItems.WidgetGrid {
|
|
|
|
id: widgetGrid
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.minimumWidth: 240
|
|
|
|
}
|
2020-10-18 06:50:26 -05:00
|
|
|
}
|