Browse Source

got rid of flickable in debugger pane

cl-refactor
arkpar 10 years ago
parent
commit
23fabcd8a6
  1. 94
      mix/qml/Debugger.qml
  2. 5
      mix/qml/js/Debugger.js

94
mix/qml/Debugger.qml

@ -104,18 +104,17 @@ Rectangle {
} }
} }
Flickable { ScrollView {
property int firstColumnWidth: 180 property int firstColumnWidth: 180
property int secondColumnWidth: 250 property int secondColumnWidth: 250
id: debugScrollArea id: debugScrollArea
flickableDirection: Flickable.VerticalFlick //flickableDirection: Flickable.VerticalFlick
anchors.fill: parent
contentHeight: 4000
contentWidth: parent.width
Rectangle
{
color: "transparent"
anchors.fill: parent anchors.fill: parent
//contentHeight: 4000
//width: parent.width
//contentWidth: parent.width
//color: "transparent"
ColumnLayout ColumnLayout
{ {
property int sideMargin: 10 property int sideMargin: 10
@ -124,13 +123,17 @@ Rectangle {
anchors.topMargin: 15 anchors.topMargin: 15
anchors.left: parent.left; anchors.left: parent.left;
anchors.leftMargin: machineStates.sideMargin anchors.leftMargin: machineStates.sideMargin
anchors.right: parent.right; width: debugScrollArea.width - machineStates.sideMargin * 2 - 20;
anchors.rightMargin: machineStates.sideMargin
anchors.fill: parent function updateHeight() {
Layout.fillWidth: true machineStates.height = transactionLog.childrenRect.height + buttonRow.childrenRect.height + assemblyCodeRow.childrenRect.height +
Layout.fillHeight: true callStackRect.childrenRect.height + storageRect.childrenRect.height + memoryRect.childrenRect.height + callDataRect.childrenRect.height + 120;
}
Component.onCompleted: updateHeight();
TransactionLog { TransactionLog {
id: transactionLog
Layout.fillWidth: true Layout.fillWidth: true
height: 250 height: 250
} }
@ -272,63 +275,76 @@ Rectangle {
border.color: "#deddd9" border.color: "#deddd9"
color: "white" color: "white"
anchors.top: parent.top anchors.top: parent.top
ListView { TableView {
id: statesList
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: 3 anchors.leftMargin: 3
anchors.rightMargin: 3 anchors.rightMargin: 3
anchors.topMargin: 3 anchors.topMargin: 3
anchors.bottomMargin: 3 anchors.bottomMargin: 3
clip: true clip: true
id: statesList headerDelegate: null
delegate: renderDelegate itemDelegate: renderDelegate
highlight: highlightBar
//highlightFollowsCurrentItem: false
model: ListModel {} model: ListModel {}
TableViewColumn {
role: "line"
width: debugScrollArea.firstColumnWidth - 10
}
} }
Component { Component {
id: highlightBar id: highlightBar
Rectangle { Rectangle {
radius: 4 radius: 4
height: statesList.currentItem.height anchors.fill: parent
width: statesList.currentItem.width;
y: statesList.currentItem.y y: statesList.currentItem.y
color: "#4A90E2" color: "#4A90E2"
//Behavior on y {
// PropertyAnimation { properties: "y"; easing.type: Easing.InOutQuad; duration: 50}
//}
} }
} }
Component { Component {
id: renderDelegate id: renderDelegate
Item {
Rectangle {
radius: 4
anchors.fill: parent
color: "#4A90E2"
visible: styleData.selected;
}
RowLayout { RowLayout {
id: wrapperItem id: wrapperItem
height: 20 height: 20
width: parent.width //width: parent.width
anchors.fill: parent
spacing: 5 spacing: 5
Text { Text {
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: 10 anchors.leftMargin: 10
width: 15 width: 15
color: "#b2b3ae" color: "#b2b3ae"
text: line.split(' ')[0] text: styleData.value.split(' ')[0]
font.family: "monospace" font.family: "monospace"
font.pointSize: 9 font.pointSize: 9
id: id
wrapMode: Text.NoWrap wrapMode: Text.NoWrap
id: id
} }
Text { Text {
anchors.left: id.right;
wrapMode: Text.NoWrap wrapMode: Text.NoWrap
color: parent.ListView.isCurrentItem ? "white" : "black" color: styleData.selected ? "white" : "black"
font.family: "monospace" font.family: "monospace"
text: line.replace(line.split(' ')[0], '') text: styleData.value.replace(styleData.value.split(' ')[0], '')
anchors.left: id.right
font.pointSize: 9 font.pointSize: 9
} }
} }
} }
} }
}
Rectangle { Rectangle {
Layout.fillWidth: true Layout.fillWidth: true
@ -443,8 +459,6 @@ Rectangle {
} }
orientation: Qt.Vertical orientation: Qt.Vertical
width: debugPanel.width - 2 * machineStates.sideMargin
Rectangle Rectangle
{ {
@ -454,6 +468,7 @@ Rectangle {
width: parent.width width: parent.width
Layout.minimumHeight: 120 Layout.minimumHeight: 120
Layout.maximumHeight: 400 Layout.maximumHeight: 400
onHeightChanged: machineStates.updateHeight();
CallStack { CallStack {
anchors.fill: parent anchors.fill: parent
id: callStack id: callStack
@ -461,15 +476,14 @@ Rectangle {
} }
} }
Rectangle Rectangle
{ {
id: storageRect id: storageRect
color: "transparent" color: "transparent"
width: parent.width width: parent.width
Layout.minimumHeight: 25 Layout.minimumHeight: 25
Layout.maximumHeight: 223 Layout.maximumHeight: 800
height: 25 onHeightChanged: machineStates.updateHeight();
DebugInfoList DebugInfoList
{ {
id: storage id: storage
@ -545,10 +559,10 @@ Rectangle {
{ {
id: memoryRect; id: memoryRect;
color: "transparent" color: "transparent"
height: 25
width: parent.width width: parent.width
Layout.minimumHeight: 25 Layout.minimumHeight: 25
Layout.maximumHeight: 223 Layout.maximumHeight: 800
onHeightChanged: machineStates.updateHeight();
DebugInfoList { DebugInfoList {
id: memoryDump id: memoryDump
anchors.fill: parent anchors.fill: parent
@ -567,10 +581,10 @@ Rectangle {
{ {
id: callDataRect id: callDataRect
color: "transparent" color: "transparent"
height: 25
width: parent.width width: parent.width
Layout.minimumHeight: 25 Layout.minimumHeight: 25
Layout.maximumHeight: 223 Layout.maximumHeight: 800
onHeightChanged: machineStates.updateHeight();
DebugInfoList { DebugInfoList {
id: callDataDump id: callDataDump
anchors.fill: parent anchors.fill: parent
@ -586,12 +600,12 @@ Rectangle {
} }
Rectangle Rectangle
{ {
id: bottomRect;
width: parent.width width: parent.width
Layout.minimumHeight: 25 Layout.minimumHeight: 20
color: "transparent" color: "transparent"
} }
} }
} }
} }
} }
}

5
mix/qml/js/Debugger.js

@ -118,8 +118,9 @@ function codeStr(stateIndex)
function highlightSelection(index) function highlightSelection(index)
{ {
statesList.currentIndex = index; statesList.positionViewAtRow(index, ListView.Center);
statesList.positionViewAtIndex(index, ListView.Center); statesList.selection.clear();
statesList.selection.select(index);
} }
function completeCtxInformation(state) function completeCtxInformation(state)

Loading…
Cancel
Save