first commit
This commit is contained in:
@@ -0,0 +1,140 @@
|
||||
import QtQuick 2.0
|
||||
import FlightGear 1.0 as FG
|
||||
|
||||
Item {
|
||||
Rectangle {
|
||||
id: hostPanel
|
||||
height: hostPanelContent.childrenRect.height + 16
|
||||
width: 300
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 8
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
border.color: "#9f9f9f"
|
||||
border.width: 1
|
||||
color: "#5f5f5f"
|
||||
opacity: 0.8
|
||||
|
||||
Column {
|
||||
spacing: 8
|
||||
|
||||
id: hostPanelContent
|
||||
width: parent.width - 30
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 8
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
InputLine {
|
||||
id: hostInput
|
||||
width: parent.width
|
||||
label: "Hostname"
|
||||
text: _application.host
|
||||
onEditingFinished: {
|
||||
_application.host = text
|
||||
portInput.forceActiveFocus();
|
||||
}
|
||||
|
||||
KeyNavigation.tab: portInput
|
||||
}
|
||||
|
||||
InputLine {
|
||||
id: portInput
|
||||
width: parent.width
|
||||
label: "Port"
|
||||
text: _application.port
|
||||
KeyNavigation.tab: queryButton
|
||||
|
||||
onEditingFinished: {
|
||||
_application.port = text
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
id: queryButton
|
||||
label: "Query"
|
||||
enabled: _application.host != ""
|
||||
visible: (_application.status == FG.Application.Idle)
|
||||
|
||||
onClicked: {
|
||||
_application.query();
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
id: cancelButton
|
||||
label: "Cancel"
|
||||
anchors.right: parent.right
|
||||
|
||||
visible: (_application.status == FG.Application.Querying)
|
||||
|
||||
onClicked: {
|
||||
_application.cancelQuery();
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
id: clearlButton
|
||||
label: "Clear"
|
||||
anchors.right: parent.right
|
||||
|
||||
visible: (_application.status == FG.Application.SuccessfulQuery) |
|
||||
(_application.status == FG.Application.QueryFailed)
|
||||
|
||||
onClicked: {
|
||||
_application.clearQuery();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: canvasListPanel
|
||||
border.color: "#9f9f9f"
|
||||
border.width: 1
|
||||
color: "#5f5f5f"
|
||||
opacity: 0.8
|
||||
anchors.top: hostPanel.bottom
|
||||
anchors.topMargin: 8
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: 300
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 8
|
||||
visible: _application.canvases.length > 0
|
||||
|
||||
ListView {
|
||||
id: canvasList
|
||||
model: _application.canvases
|
||||
visible: (_application.status == FG.Application.SuccessfulQuery)
|
||||
width: parent.width - 30
|
||||
height: parent.height
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
delegate: Rectangle {
|
||||
width: canvasLabel.implicitWidth
|
||||
height: canvasLabel.implicitHeight + 20
|
||||
|
||||
color: "#3f3f3f"
|
||||
|
||||
Text {
|
||||
id: canvasLabel
|
||||
text: modelData['name']
|
||||
|
||||
// todo - different color if we already have a connection?
|
||||
color: "white"
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
_application.openCanvas(modelData['path']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import QtQuick 2.0
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
|
||||
property alias label: labelText.text
|
||||
property bool enabled: true
|
||||
|
||||
signal clicked
|
||||
|
||||
border.width: 2
|
||||
border.color: enabled ? "orange" : "9f9f9f"
|
||||
|
||||
color: "#3f3f3f"
|
||||
implicitWidth: 100
|
||||
implicitHeight: 30
|
||||
|
||||
Text {
|
||||
id: labelText
|
||||
anchors.centerIn: parent
|
||||
color: enabled ? "white" : "9f9f9f"
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
enabled: root.enabled
|
||||
|
||||
onClicked: {
|
||||
root.clicked();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
import QtQuick 2.0
|
||||
import FlightGear 1.0 as FG
|
||||
|
||||
Item {
|
||||
id: root
|
||||
property bool showDecorations: true
|
||||
property alias canvas: paintedDisplay.canvas
|
||||
property bool showUi: true
|
||||
property bool showMenu: false
|
||||
|
||||
|
||||
Component.onCompleted: {
|
||||
if (canvas) {
|
||||
width = canvas.size.width
|
||||
height = canvas.size.height
|
||||
x = canvas.origin.x
|
||||
y = canvas.origin.y
|
||||
}
|
||||
}
|
||||
|
||||
function saveGeometry()
|
||||
{
|
||||
canvas.origin = Qt.point(x, y )
|
||||
canvas.size = Qt.size(root.width, root.height);
|
||||
}
|
||||
|
||||
Item {
|
||||
id: clipShell
|
||||
anchors.fill: parent
|
||||
clip: true
|
||||
|
||||
// FG.CanvasDisplay {
|
||||
// id: canvasDisplay
|
||||
// anchors.fill: parent
|
||||
|
||||
// onCanvasChanged: {
|
||||
// if (canvas) {
|
||||
// root.width = canvas.size.width
|
||||
// root.height = canvas.size.height
|
||||
// root.x = canvas.origin.x
|
||||
// root.y = canvas.origin.y
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
FG.PaintedCanvasDisplay {
|
||||
id: paintedDisplay
|
||||
anchors.fill: parent
|
||||
// canvas: canvasDisplay.canvas
|
||||
|
||||
onCanvasChanged: {
|
||||
if (canvas) {
|
||||
root.width = canvas.size.width
|
||||
root.height = canvas.size.height
|
||||
root.x = canvas.origin.x
|
||||
root.y = canvas.origin.y
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
border.width: 1
|
||||
border.color: "orange"
|
||||
color: "transparent"
|
||||
anchors.centerIn: parent
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
visible: showUi
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
|
||||
drag.target: root
|
||||
|
||||
onReleased: {
|
||||
root.saveGeometry();
|
||||
}
|
||||
|
||||
onPressAndHold: {
|
||||
root.showMenu = true;
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: 32
|
||||
height: 32
|
||||
color: "orange"
|
||||
opacity: 0.5
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
|
||||
// resizing
|
||||
|
||||
onPositionChanged: {
|
||||
var rootPos = mapToItem(root, mouse.x, mouse.y);
|
||||
// var rootDiff = Qt.point(rootPos.x - root.x,
|
||||
// rootPos.y - root.y);
|
||||
|
||||
root.width = rootPos.x;
|
||||
root.height = rootPos.y;
|
||||
}
|
||||
|
||||
onReleased: {
|
||||
saveGeometry();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
color: "orange"
|
||||
anchors.centerIn: parent
|
||||
text: "Canvas"
|
||||
visible: !root.showMenu
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.fill: parent
|
||||
verticalAlignment: Text.AlignBottom
|
||||
|
||||
function statusAsString(status)
|
||||
{
|
||||
switch (status) {
|
||||
case FG.CanvasConnection.NotConnected: return "Not connected";
|
||||
case FG.CanvasConnection.Connecting: return "Connecting";
|
||||
case FG.CanvasConnection.Connected: return "Connected";
|
||||
case FG.CanvasConnection.Closed: return "Closed";
|
||||
case FG.CanvasConnection.Reconnecting: return "Re-connecting";
|
||||
case FG.CanvasConnection.Error: return "Error";
|
||||
case FG.CanvasConnection.Snapshot: return "Snapshot";
|
||||
}
|
||||
}
|
||||
|
||||
text: "WS: " + canvas.webSocketUrl + "\n"
|
||||
+ "Root:" + canvas.rootPath + "\n"
|
||||
+ "Status:" + statusAsString(canvas.status);
|
||||
color: "white"
|
||||
|
||||
}
|
||||
|
||||
CanvasMenu {
|
||||
anchors.fill:parent
|
||||
visible: root.showMenu
|
||||
onMenuBack: root.showMenu = false
|
||||
onCloseCanvas: _application.closeCanvas(canvas);
|
||||
onReconnectCanvas: canvas.reconnect();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
import QtQuick 2.0
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
signal menuBack();
|
||||
signal closeCanvas();
|
||||
signal reconnectCanvas();
|
||||
|
||||
Rectangle {
|
||||
anchors.centerIn: parent
|
||||
width: buttons.childrenRect.width + 20
|
||||
height: buttons.childrenRect.height + 20
|
||||
border.width: 1
|
||||
border.color: "orange"
|
||||
color: "#5f5f5f"
|
||||
|
||||
Column {
|
||||
id: buttons
|
||||
spacing: 30
|
||||
|
||||
Button {
|
||||
label: qsTr("Back")
|
||||
onClicked: root.menuBack();
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
Button {
|
||||
label: qsTr("Close")
|
||||
onClicked: root.closeCanvas();
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
Button {
|
||||
label: qsTr("Reconnect")
|
||||
onClicked: root.reconnectCanvas();
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
} // of buttons column
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
import QtQuick 2.0
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
border.width: 1
|
||||
border.color: "orange"
|
||||
color: "#1f1f1f"
|
||||
height: contentBox.childrenRect.height + 40
|
||||
width: 600
|
||||
|
||||
Component.onCompleted: {
|
||||
if (!_application.showGettingStarted) {
|
||||
root.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
id: contentBox
|
||||
width: parent.width - 20
|
||||
y: 20
|
||||
spacing: 20
|
||||
|
||||
anchors {
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
Text {
|
||||
width: parent.width
|
||||
text: _application.gettingStartedText
|
||||
wrapMode: Text.WordWrap
|
||||
color: "white"
|
||||
}
|
||||
|
||||
Row {
|
||||
id: buttonRow
|
||||
spacing: 20
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
height: childrenRect.height
|
||||
|
||||
Button {
|
||||
label: qsTr("Okay")
|
||||
onClicked: root.visible = false
|
||||
width: 150
|
||||
}
|
||||
|
||||
Button {
|
||||
label: qsTr("Don't show again")
|
||||
onClicked: {
|
||||
_application.showGettingStarted = false;
|
||||
root.visible = false
|
||||
}
|
||||
width: 150
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
import QtQuick 2.2
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
property alias text: input.text
|
||||
property alias label: labelText.text
|
||||
|
||||
signal editingFinished
|
||||
|
||||
implicitHeight: 30
|
||||
implicitWidth: 200
|
||||
|
||||
Text {
|
||||
id: labelText
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: inputFrame.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: inputFrame
|
||||
border.width: 2
|
||||
border.color: input.focus ? "orange" : "#9f9f9f"
|
||||
color: "#3f3f3f"
|
||||
width: parent.width * 0.5
|
||||
anchors.right: parent.right
|
||||
height: root.height
|
||||
|
||||
TextInput {
|
||||
id: input
|
||||
|
||||
anchors {
|
||||
left: parent.left
|
||||
leftMargin: 8
|
||||
right: parent.right
|
||||
rightMargin: 8
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
onActiveFocusChanged: {
|
||||
if (activeFocus) {
|
||||
selectAll();
|
||||
}
|
||||
}
|
||||
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
onEditingFinished: {
|
||||
root.editingFinished();
|
||||
}
|
||||
|
||||
color: "#9f9f9f"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
import QtQuick 2.0
|
||||
import FlightGear 1.0 as FG
|
||||
|
||||
Item {
|
||||
id: root
|
||||
signal requestPanelClose();
|
||||
|
||||
Rectangle {
|
||||
id: savePanel
|
||||
width: parent.width - 8
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 8
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 8
|
||||
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
border.color: "#9f9f9f"
|
||||
border.width: 1
|
||||
color: "#5f5f5f"
|
||||
opacity: 0.8
|
||||
layer.enabled: true
|
||||
|
||||
InputLine {
|
||||
id: saveTitleInput
|
||||
width: parent.width
|
||||
label: "Title"
|
||||
anchors {
|
||||
top: parent.top
|
||||
topMargin: 8
|
||||
left: parent.left
|
||||
leftMargin: 8
|
||||
right: saveButton.left
|
||||
rightMargin: 8
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Button {
|
||||
id: saveButton
|
||||
label: "Save"
|
||||
enabled: (saveTitleInput.text != "")
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 8
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 8
|
||||
|
||||
onClicked: {
|
||||
_application.save(saveTitleInput.text);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ListView {
|
||||
id: savedList
|
||||
model: _application.configs
|
||||
width: parent.width - 30
|
||||
anchors.top: saveTitleInput.bottom
|
||||
anchors.topMargin: 8
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 8
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
delegate: Item {
|
||||
width: parent.width
|
||||
height:delegateFrame.height + 8
|
||||
|
||||
Rectangle {
|
||||
id: delegateBackFrame
|
||||
color: "#1f1f1f"
|
||||
width: delegateFrame.width
|
||||
height: delegateFrame.height
|
||||
clip: true
|
||||
|
||||
Button {
|
||||
id: deleteButton
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 8
|
||||
label: "Delete"
|
||||
onClicked: {
|
||||
_application.deleteConfig(model.index)
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: deleteButton.left
|
||||
anchors.rightMargin: 8
|
||||
label: "Save"
|
||||
onClicked: {
|
||||
_application.saveConfigChanges(model.index)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: delegateFrame
|
||||
width: parent.width
|
||||
// anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
height: configLabel.implicitHeight + 20
|
||||
|
||||
opacity: 1.0
|
||||
color: "#3f3f3f"
|
||||
|
||||
Text {
|
||||
id: configLabel
|
||||
text: modelData['name']
|
||||
color: "white"
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 8
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
_application.restoreConfig(model.index)
|
||||
root.requestPanelClose();
|
||||
}
|
||||
|
||||
drag.target: delegateFrame
|
||||
drag.axis: Drag.XAxis
|
||||
drag.minimumX: -delegateFrame.width
|
||||
drag.maximumX: 0
|
||||
}
|
||||
|
||||
|
||||
} // of visible rect
|
||||
} // of delegate item
|
||||
|
||||
}
|
||||
} // of frame rect
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
import QtQuick 2.0
|
||||
import FlightGear 1.0 as FG
|
||||
|
||||
Item {
|
||||
id: root
|
||||
signal requestPanelClose();
|
||||
|
||||
Rectangle {
|
||||
id: savePanel
|
||||
width: parent.width - 8
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 8
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 8
|
||||
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
border.color: "#9f9f9f"
|
||||
border.width: 1
|
||||
color: "#5f5f5f"
|
||||
opacity: 0.8
|
||||
layer.enabled: true
|
||||
|
||||
InputLine {
|
||||
id: saveTitleInput
|
||||
width: parent.width
|
||||
label: "Title"
|
||||
anchors {
|
||||
top: parent.top
|
||||
topMargin: 8
|
||||
left: parent.left
|
||||
leftMargin: 8
|
||||
right: saveButton.left
|
||||
rightMargin: 8
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Button {
|
||||
id: saveButton
|
||||
label: "Save"
|
||||
enabled: (saveTitleInput.text != "")
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 8
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 8
|
||||
|
||||
onClicked: {
|
||||
_application.saveSnapshot(saveTitleInput.text);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ListView {
|
||||
id: savedList
|
||||
model: _application.snapshots
|
||||
width: parent.width - 30
|
||||
anchors.top: saveTitleInput.bottom
|
||||
anchors.topMargin: 8
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 8
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
delegate: Item {
|
||||
width: parent.width
|
||||
height:delegateFrame.height + 8
|
||||
|
||||
Rectangle {
|
||||
id: delegateBackFrame
|
||||
color: "#1f1f1f"
|
||||
width: delegateFrame.width
|
||||
height: delegateFrame.height
|
||||
|
||||
|
||||
Button {
|
||||
id: deleteButton
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 8
|
||||
label: "Delete"
|
||||
onClicked: {
|
||||
// _application.deleteConfig(model.index)
|
||||
// _application.deleteConfig
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: delegateFrame
|
||||
width: parent.width
|
||||
|
||||
height: configLabel.implicitHeight + 20
|
||||
|
||||
opacity: 1.0
|
||||
color: "#3f3f3f"
|
||||
|
||||
Text {
|
||||
id: configLabel
|
||||
text: modelData['name']
|
||||
color: "white"
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 8
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
_application.restoreSnapshot(model.index);
|
||||
root.requestPanelClose();
|
||||
}
|
||||
|
||||
drag.target: delegateFrame
|
||||
drag.axis: Drag.XAxis
|
||||
drag.minimumX: -delegateFrame.width
|
||||
drag.maximumX: 0
|
||||
}
|
||||
|
||||
|
||||
} // of visible rect
|
||||
} // of delegate item
|
||||
|
||||
}
|
||||
} // of frame rect
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
import QtQuick 2.0
|
||||
|
||||
Item {
|
||||
id: root
|
||||
property int activeTab: -1
|
||||
property var tabs: []
|
||||
property var titles: []
|
||||
property int __panelWidth: 250
|
||||
|
||||
readonly property int panelWidth: __panelWidth
|
||||
|
||||
Rectangle {
|
||||
id: contentBox
|
||||
x: parent.width - width // can't use an anchors, for dragability
|
||||
|
||||
height: parent.height
|
||||
width: (activeTab >= 0) ? __panelWidth : 0
|
||||
color: "#1f1f1f"
|
||||
Behavior on width {
|
||||
enabled: !splitterDrag.drag.active
|
||||
NumberAnimation {
|
||||
duration: 250
|
||||
}
|
||||
}
|
||||
|
||||
clip: true
|
||||
|
||||
Loader {
|
||||
id: loader
|
||||
anchors.fill: parent
|
||||
sourceComponent: (activeTab >= 0) ? tabs[activeTab] : null
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: loader.item
|
||||
onRequestPanelClose: root.activeTab = -1;
|
||||
ignoreUnknownSignals: true
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: splitter
|
||||
width: 2
|
||||
height: parent.height
|
||||
anchors.right: contentBox.left
|
||||
|
||||
color: "orange"
|
||||
|
||||
MouseArea {
|
||||
id: splitterDrag
|
||||
height: parent.height
|
||||
width: parent.width * 25
|
||||
|
||||
drag.target: contentBox
|
||||
drag.axis: Drag.XAxis
|
||||
drag.minimumX: 0
|
||||
drag.maximumX: root.width
|
||||
|
||||
onMouseXChanged: {
|
||||
__panelWidth = root.width - contentBox.x
|
||||
}
|
||||
|
||||
// enabled when open?
|
||||
|
||||
// click to toggle open / close
|
||||
|
||||
cursorShape: Qt.SizeHorCursor
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors.right: splitter.left
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 20
|
||||
spacing: 1
|
||||
|
||||
Repeater {
|
||||
model: tabs
|
||||
Rectangle {
|
||||
readonly property bool tabIsActive: (model.index == activeTab)
|
||||
width: tabLabel.implicitHeight + 10
|
||||
height: tabLabel.implicitWidth + 20
|
||||
|
||||
color: "#3f3f3f"
|
||||
border.width: 1
|
||||
border.color: "#5f5f5f"
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
id: tabLabel
|
||||
text: titles[model.index]
|
||||
rotation: 90
|
||||
color: tabIsActive ? "orange" : tabMouse.containsMouse ? "#afafaf" : "#9f9f9f"
|
||||
transformOrigin: Item.Center
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: tabMouse
|
||||
hoverEnabled: true
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
if (parent.tabIsActive) {
|
||||
activeTab = -1
|
||||
} else {
|
||||
activeTab = model.index
|
||||
}
|
||||
}
|
||||
}
|
||||
} // rectangle
|
||||
} // of repeater
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
import QtQuick 2.0
|
||||
|
||||
Rectangle {
|
||||
width: 1024
|
||||
height: 768
|
||||
color: "black"
|
||||
|
||||
// only show the UI on the main window
|
||||
property double __uiOpacity: __shouldShowUi ? 1.0 : 0.0
|
||||
property bool __uiVisible: true
|
||||
readonly property bool __shouldShowUi: (isMainWindow && _application.showUI)
|
||||
readonly property bool isMainWindow: (_windowNumber === 0)
|
||||
|
||||
Component.onCompleted: {
|
||||
// synchronize insitial state of this
|
||||
__uiVisible = __shouldShowUi;
|
||||
}
|
||||
|
||||
Behavior on __uiOpacity {
|
||||
SequentialAnimation {
|
||||
ScriptAction { script: if (_application.showUI) __uiVisible = true; }
|
||||
NumberAnimation { duration: 400 }
|
||||
ScriptAction { script: if (!_application.showUI) __uiVisible = false; }
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
opacity: __uiOpacity * 0.5
|
||||
source: "qrc:///images/checkerboard"
|
||||
fillMode: Image.Tile
|
||||
anchors.fill: parent
|
||||
visible: __uiVisible
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: _application.activeCanvases
|
||||
|
||||
// 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 {
|
||||
showUi: __uiVisible
|
||||
}
|
||||
}
|
||||
|
||||
VerticalTabPanel {
|
||||
anchors.fill: parent
|
||||
tabs: [browsePanel, configPanel, snapshotsPanel]
|
||||
titles: ["Connect", "Load / Save", "Snapshots"]
|
||||
visible: __uiVisible
|
||||
opacity: __uiOpacity
|
||||
}
|
||||
|
||||
Component {
|
||||
id: browsePanel
|
||||
BrowsePanel { }
|
||||
}
|
||||
|
||||
Component {
|
||||
id: configPanel
|
||||
LoadSavePanel { }
|
||||
}
|
||||
|
||||
Component {
|
||||
id: snapshotsPanel
|
||||
SnapshotsPanel { }
|
||||
}
|
||||
|
||||
GetStarted {
|
||||
visible: isMainWindow
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 740 B |
Reference in New Issue
Block a user