-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ui] GraphEditor: single tab group + status table
- Use a single tab group for attributes, log, statistics, status - Use a ListView with key/value to display the node status fields (instead of a file viewer)
- Loading branch information
1 parent
6e8a6de
commit 13d0763
Showing
5 changed files
with
363 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import QtQuick 2.11 | ||
import QtQuick.Controls 2.3 | ||
import QtQuick.Controls 1.4 as Controls1 // SplitView | ||
import QtQuick.Layouts 1.3 | ||
import MaterialIcons 2.2 | ||
import Controls 1.0 | ||
|
||
import "common.js" as Common | ||
|
||
/** | ||
* ChunkListView | ||
*/ | ||
ListView { | ||
id: chunksLV | ||
|
||
// model: node.chunks | ||
|
||
property variant currentChunk: currentItem ? currentItem.chunk : undefined | ||
|
||
width: 60 | ||
Layout.fillHeight: true | ||
highlightFollowsCurrentItem: true | ||
keyNavigationEnabled: true | ||
focus: true | ||
currentIndex: 0 | ||
|
||
signal changeCurrentChunk(int chunkIndex) | ||
|
||
header: Component { | ||
Label { | ||
width: chunksLV.width | ||
elide: Label.ElideRight | ||
text: "Chunks" | ||
padding: 4 | ||
z: 10 | ||
background: Rectangle { color: parent.palette.window } | ||
} | ||
} | ||
|
||
highlight: Component { | ||
Rectangle { | ||
color: activePalette.highlight | ||
opacity: 0.3 | ||
z: 2 | ||
} | ||
} | ||
highlightMoveDuration: 0 | ||
highlightResizeDuration: 0 | ||
|
||
delegate: ItemDelegate { | ||
id: chunkDelegate | ||
property var chunk: object | ||
text: index | ||
width: parent.width | ||
leftPadding: 8 | ||
onClicked: { | ||
chunksLV.forceActiveFocus() | ||
chunksLV.changeCurrentChunk(index) | ||
} | ||
Rectangle { | ||
width: 4 | ||
height: parent.height | ||
color: Common.getChunkColor(parent.chunk) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import QtQuick 2.11 | ||
import QtQuick.Controls 2.3 | ||
import QtQuick.Controls 1.4 as Controls1 // SplitView | ||
import QtQuick.Layouts 1.3 | ||
import MaterialIcons 2.2 | ||
import Controls 1.0 | ||
|
||
import "common.js" as Common | ||
|
||
/** | ||
* NodeLog displays log and statistics data of Node's chunks (NodeChunks) | ||
* | ||
* To ease monitoring, it provides periodic auto-reload of the opened file | ||
* if the related NodeChunk is being computed. | ||
*/ | ||
FocusScope { | ||
id: root | ||
property variant node | ||
property alias chunkCurrentIndex: chunksLV.currentIndex | ||
signal changeCurrentChunk(int chunkIndex) | ||
|
||
SystemPalette { id: activePalette } | ||
|
||
Controls1.SplitView { | ||
anchors.fill: parent | ||
|
||
// The list of chunks | ||
ChunksListView { | ||
id: chunksLV | ||
Layout.fillHeight: true | ||
model: node.chunks | ||
onChangeCurrentChunk: root.changeCurrentChunk(chunkIndex) | ||
} | ||
|
||
Loader { | ||
id: componentLoader | ||
clip: true | ||
Layout.fillWidth: true | ||
Layout.fillHeight: true | ||
property url source | ||
|
||
property string currentFile: chunksLV.currentChunk ? chunksLV.currentChunk["statisticsFile"] : "" | ||
onCurrentFileChanged: { | ||
// only set text file viewer source when ListView is fully ready | ||
// (either empty or fully populated with a valid currentChunk) | ||
// to avoid going through an empty url when switching between two nodes | ||
|
||
if(!chunksLV.count || chunksLV.currentChunk) | ||
componentLoader.source = Filepath.stringToUrl(currentFile); | ||
} | ||
|
||
sourceComponent: statViewerComponent | ||
} | ||
|
||
Component { | ||
id: statViewerComponent | ||
StatViewer { | ||
id: statViewer | ||
Layout.fillWidth: true | ||
Layout.fillHeight: true | ||
source: componentLoader.source | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.