2017-11-02 17:20:42 +00:00
|
|
|
import QtQuick 2.0
|
2019-08-31 22:40:21 +00:00
|
|
|
import QtQuick.Window 2.4 as QQ2W
|
2017-11-02 17:20:42 +00:00
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
width: 1024
|
|
|
|
height: 768
|
|
|
|
color: "black"
|
|
|
|
|
2019-08-31 22:40:21 +00:00
|
|
|
// only show the UI on the main window
|
2019-09-01 11:58:21 +00:00
|
|
|
property double __uiOpacity: __shouldShowUi ? 1.0 : 0.0
|
2017-11-04 10:47:14 +00:00
|
|
|
property bool __uiVisible: true
|
2019-09-01 11:58:21 +00:00
|
|
|
readonly property bool __shouldShowUi: (isMainWindow && _application.showUI)
|
2019-08-31 22:40:21 +00:00
|
|
|
readonly property bool isMainWindow: (_windowNumber === 0)
|
2017-11-04 10:47:14 +00:00
|
|
|
|
2019-09-01 11:58:21 +00:00
|
|
|
Component.onCompleted: {
|
|
|
|
// synchronize insitial state of this
|
|
|
|
__uiVisible = __shouldShowUi;
|
|
|
|
}
|
|
|
|
|
2017-11-04 10:47:14 +00:00
|
|
|
Behavior on __uiOpacity {
|
|
|
|
SequentialAnimation {
|
2018-11-06 17:58:44 +00:00
|
|
|
ScriptAction { script: if (_application.showUI) __uiVisible = true; }
|
|
|
|
NumberAnimation { duration: 400 }
|
|
|
|
ScriptAction { script: if (!_application.showUI) __uiVisible = false; }
|
2017-11-04 10:47:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-02 17:20:42 +00:00
|
|
|
Image {
|
2017-11-04 10:47:14 +00:00
|
|
|
opacity: __uiOpacity * 0.5
|
2017-11-02 17:20:42 +00:00
|
|
|
source: "qrc:///images/checkerboard"
|
|
|
|
fillMode: Image.Tile
|
|
|
|
anchors.fill: parent
|
|
|
|
visible: __uiVisible
|
|
|
|
}
|
|
|
|
|
|
|
|
Repeater {
|
|
|
|
model: _application.activeCanvases
|
2019-08-31 22:40:21 +00:00
|
|
|
|
|
|
|
// we use a loader to only create canvases on the correct window
|
|
|
|
// by driving the 'active' property
|
|
|
|
delegate: Loader {
|
|
|
|
id: canvasLoader
|
|
|
|
sourceComponent: canvasFrame
|
|
|
|
active: modelData.windowIndex === _windowNumber
|
|
|
|
|
|
|
|
Binding {
|
|
|
|
target: canvasLoader.item
|
|
|
|
property: "canvas"
|
|
|
|
value: model.modelData
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: canvasFrame
|
|
|
|
CanvasFrame {
|
2017-11-04 10:47:14 +00:00
|
|
|
showUi: __uiVisible
|
2017-11-02 17:20:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-08 13:36:07 +00:00
|
|
|
VerticalTabPanel {
|
|
|
|
anchors.fill: parent
|
|
|
|
tabs: [browsePanel, configPanel, snapshotsPanel]
|
|
|
|
titles: ["Connect", "Load / Save", "Snapshots"]
|
2018-06-24 20:33:07 +00:00
|
|
|
visible: __uiVisible
|
|
|
|
opacity: __uiOpacity
|
2017-11-02 17:20:42 +00:00
|
|
|
}
|
|
|
|
|
2017-11-08 13:36:07 +00:00
|
|
|
Component {
|
|
|
|
id: browsePanel
|
|
|
|
BrowsePanel { }
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: configPanel
|
|
|
|
LoadSavePanel { }
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: snapshotsPanel
|
|
|
|
SnapshotsPanel { }
|
2017-11-02 17:20:42 +00:00
|
|
|
}
|
2017-11-08 13:36:07 +00:00
|
|
|
|
2018-11-08 08:40:53 +00:00
|
|
|
GetStarted {
|
2019-08-31 22:40:21 +00:00
|
|
|
visible: isMainWindow
|
2018-11-08 08:40:53 +00:00
|
|
|
anchors.centerIn: parent
|
|
|
|
}
|
2018-06-26 22:23:49 +00:00
|
|
|
|
|
|
|
|
2017-11-02 17:20:42 +00:00
|
|
|
}
|