Skip to content

Commit

Permalink
[ui] ScriptEditor: ScriptEditor gets a RowLayout
Browse files Browse the repository at this point in the history
A Row Layout is more practical for using script editor with the current placement of meshroom GUI.
  • Loading branch information
waaake committed Jan 7, 2025
1 parent 0730936 commit 8207e84
Showing 1 changed file with 35 additions and 38 deletions.
73 changes: 35 additions & 38 deletions meshroom/ui/qml/GraphEditor/ScriptEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -211,50 +211,16 @@ Item {
}
}

MSplitView {
id: topBottomSplit
RowLayout {
Layout.fillHeight: true
Layout.fillWidth: true

orientation: Qt.Vertical

// Output Text Area -- Shows the output for the executed script(s)
Rectangle {
id: outputArea

// Has a minimum height
SplitView.minimumHeight: 80

color: palette.base

Flickable {
width: parent.width
height: parent.height
contentWidth: width
contentHeight: ( output.lineCount + 5 ) * output.font.pixelSize // + 5 lines for buffer to be scrolled and visibility

ScrollBar.vertical: MScrollBar {}

TextArea.flickable: TextArea {
id: output

readOnly: true
selectByMouse: true
padding: 0
Layout.fillHeight: true
Layout.fillWidth: true
wrapMode: Text.WordWrap

textFormat: Text.RichText
}
}
}
width: root.width

// Input Text Area -- Holds the input scripts to be executed
Rectangle {
id: inputArea

SplitView.fillHeight: true
Layout.fillHeight: true
Layout.fillWidth: true

color: palette.base

Expand Down Expand Up @@ -342,6 +308,37 @@ Item {
}
}

// Output Text Area -- Shows the output for the executed script(s)
Rectangle {
id: outputArea
Layout.fillHeight: true
Layout.fillWidth: true

color: palette.base

Flickable {
width: parent.width
height: parent.height
contentWidth: width
contentHeight: ( output.lineCount + 5 ) * output.font.pixelSize // + 5 lines for buffer to be scrolled and visibility

ScrollBar.vertical: MScrollBar {}

TextArea.flickable: TextArea {
id: output

readOnly: true
selectByMouse: true
padding: 0
Layout.fillHeight: true
Layout.fillWidth: true
wrapMode: Text.WordWrap

textFormat: Text.RichText
}
}
}

// Syntax Highlights for the Input Area for Python Based Syntax
PySyntaxHighlighter {
id: syntaxHighlighter
Expand Down

0 comments on commit 8207e84

Please sign in to comment.