@ -3,6 +3,7 @@ import QtQuick.Controls.Styles 1.1
import QtQuick . Controls 1.1
import QtQuick . Dialogs 1.1
import QtQuick . Layouts 1.1
import Qt . labs . settings 1.0
import "js/Debugger.js" as Debugger
import "js/ErrorLocationFormater.js" as ErrorLocationFormater
@ -20,7 +21,13 @@ Rectangle {
Debugger . moveSelection ( - 1 ) ;
}
function update ( )
onVisibleChanged:
{
if ( visible )
forceActiveFocus ( ) ;
}
function update ( giveFocus )
{
if ( statusPane . result . successful )
{
@ -39,11 +46,13 @@ Rectangle {
errorDetail . text = errorInfo . errorDetail ;
errorLine . text = errorInfo . errorLine ;
}
if ( giveFocus )
forceActiveFocus ( ) ;
}
Connections {
target: codeModel
onCompilationComplete: update ( )
onCompilationComplete: update ( false )
}
Rectangle
@ -95,17 +104,18 @@ Rectangle {
}
}
Flickable {
property int firstColumnWidth: 17 0
property int firstColumnWidth: 18 0
property int secondColumnWidth: 250
id: debugScrollArea
flickableDirection: Flickable . VerticalFlick
anchors.fill: parent
contentHeight: machineStates . height + 300
contentWidth: machineStates . width
GridLayout
contentHeight: 4000
contentWidth: parent . width
Rectangle
{
anchors.fill: parent
ColumnLayout
{
property int sideMargin: 10
id: machineStates
@ -115,13 +125,16 @@ Rectangle {
anchors.leftMargin: machineStates . sideMargin
anchors.right: parent . right ;
anchors.rightMargin: machineStates . sideMargin
flow: GridLayout . TopToBottom
rowSpacing: 15
anchors.fill: parent
Layout.fillWidth: true
Layout.fillHeight: true
RowLayout {
/ / s t e p b u t t o n + s l i d e r
id: buttonRow
spacing: machineStates . sideMargin
height: 27
width: debugPanel . width
Layout.fillWidth: true
Rectangle
{
height: parent . height
@ -137,8 +150,9 @@ Rectangle {
enabledStateImg: "qrc:/qml/img/jumpoutback.png"
disableStateImg: "qrc:/qml/img/jumpoutbackdisabled.png"
onClicked: Debugger . stepOutBack ( )
width: 25
height: 27
width: 28
height: 30
buttonTooltip: qsTr ( "Step Out Back" )
}
StepActionImage
@ -147,8 +161,9 @@ Rectangle {
enabledStateImg: "qrc:/qml/img/jumpintoback.png"
disableStateImg: "qrc:/qml/img/jumpintobackdisabled.png"
onClicked: Debugger . stepIntoBack ( )
width: 25
height: 27
width: 28
height: 30
buttonTooltip: qsTr ( "Step Into Back" )
}
StepActionImage
@ -157,8 +172,9 @@ Rectangle {
enabledStateImg: "qrc:/qml/img/jumpoverback.png"
disableStateImg: "qrc:/qml/img/jumpoverbackdisabled.png"
onClicked: Debugger . stepOverBack ( )
width: 25
height: 27
width: 28
height: 30
buttonTooltip: qsTr ( "Step Over Back" )
}
StepActionImage
@ -167,8 +183,9 @@ Rectangle {
enabledStateImg: "qrc:/qml/img/jumpoverforward.png"
disableStateImg: "qrc:/qml/img/jumpoverforwarddisabled.png"
onClicked: Debugger . stepOverForward ( )
width: 25
height: 27
width: 28
height: 30
buttonTooltip: qsTr ( "Step Over Forward" )
}
StepActionImage
@ -177,8 +194,9 @@ Rectangle {
enabledStateImg: "qrc:/qml/img/jumpintoforward.png"
disableStateImg: "qrc:/qml/img/jumpintoforwarddisabled.png"
onClicked: Debugger . stepIntoForward ( )
width: 25
height: 27
width: 28
height: 30
buttonTooltip: qsTr ( "Step Into Forward" )
}
StepActionImage
@ -187,14 +205,16 @@ Rectangle {
enabledStateImg: "qrc:/qml/img/jumpoutforward.png"
disableStateImg: "qrc:/qml/img/jumpoutforwarddisabled.png"
onClicked: Debugger . stepOutForward ( )
width: 25
height: 27
width: 28
height: 30
buttonTooltip: qsTr ( "Step Out Forward" )
}
}
}
Rectangle {
color: "transparent"
width: debugScrollArea . secondColumnWidth
Layout.fillWidth: true
height: parent . height
Slider {
id: statesSlider
@ -224,12 +244,15 @@ Rectangle {
RowLayout {
/ / A s s e m b l y c o d e
width: debugPanel . width
id: assemblyCodeRow
Layout.fillWidth: true
height: 405
implicitHeight: 405
spacing: machineStates . sideMargin
Rectangle
{
id: stateListContainer
width: debugScrollArea . firstColumnWidth
height: parent . height
border.width: 3
@ -246,7 +269,7 @@ Rectangle {
id: statesList
delegate: renderDelegate
highlight: highlightBar
highlightFollowsCurrentItem: tru e
highlightFollowsCurrentItem: fals e
}
Component {
@ -255,8 +278,11 @@ Rectangle {
radius: 4
height: statesList . currentItem . height
width: statesList . currentItem . width ;
y: statesList . currentItem . y
color: "#4A90E2"
Behavior on y { SpringAnimation { spring: 2 ; damping: 0.1 } }
Behavior on y {
PropertyAnimation { properties: "y" ; easing.type: Easing . InOutQuad ; duration: 50 }
}
}
}
@ -288,54 +314,51 @@ Rectangle {
}
}
ColumnLayout {
width: debugScrollArea . secondColumnWidth
height: parent . height
/ / C o l u m n L a y o u t {
Rectangle {
/ / I n f o
Layout.fillWidth: true
height: parent . height / / - 2 * s t a t e L i s t C o n t a i n e r . b o r d e r . w i d t h
ColumnLayout
{
width: parent . width
id: basicInfoColumn
height: 125
color: "transparent"
ColumnLayout {
anchors.fill: parent
spacing: 0
width: parent . width
height: parent . height
DebugBasicInfo {
id: currentStep
titleStr: qsTr ( "Current step" )
titleStr: qsTr ( "Current Step" )
Layout.fillWidth: true
height: 30
}
DebugBasicInfo {
id: mem
titleStr: qsTr ( "Adding memory" )
titleStr: qsTr ( "Adding Memory" )
Layout.fillWidth: true
height: 30
}
DebugBasicInfo {
id: stepCost
titleStr: qsTr ( "Step cost" )
titleStr: qsTr ( "Step Cost" )
Layout.fillWidth: true
height: 30
}
DebugBasicInfo {
id: gasSpent
titleStr: qsTr ( "Total gas s pent" )
}
}
titleStr: qsTr ( "Total Gas S pent" )
Layout.fillWidth: true
height: 30
}
Rectangle {
/ / S t a c k
height: 275
width: parent . width
color: "transparent"
DebugInfoList
{
Layout.fillHeight: true
Layout.fillWidth: true
id: stack
width: parent . width
height: parent . height
collapsible: false
title : qsTr ( "Stack" )
itemDelegate: Item {
id: renderedItem
height: 27
height: 25
width: parent . width
RowLayout
{
@ -352,7 +375,8 @@ Rectangle {
Text {
anchors.centerIn: parent
anchors.leftMargin: 5
color: "#8b8b8b"
font.family: "monospace"
color: "#4a4a4a"
text: model . index ;
font.pointSize: 9
}
@ -369,8 +393,9 @@ Rectangle {
Text {
anchors.left: parent . left
anchors.leftMargin: 5
font.family: "monospace"
anchors.verticalCenter: parent . verticalCenter
color: "#8b8b8b "
color: "#4a4a4a "
text: modelData
font.pointSize: 9
}
@ -387,21 +412,37 @@ Rectangle {
}
}
}
}
}
Rectangle {
width: debugPanel . width - 2 * machineStates . sideMargin
height: 2 ;
color: "#e3e3e3"
radius: 3
SplitView
{
id: splitInfoList
Layout.fillHeight: true
Layout.fillWidth: true
Settings {
id: splitSettings
property alias storageHeightSettings: storageRect . height
property alias memoryDumpHeightSettings: memoryRect . height
property alias callDataHeightSettings: callDataRect . height
}
orientation: Qt . Vertical
width: debugPanel . width - 2 * machineStates . sideMargin
Rectangle
{
id: storageRect
width: parent . width
Layout.minimumHeight: 25
Layout.maximumHeight: 223
height: 25
DebugInfoList
{
id: storage
width: debugPanel . width - 2 * machineStates . sideMargin
height: 223
anchors.fill: parent
collapsible: true
title : qsTr ( "Storage" )
itemDelegate:
@ -425,8 +466,9 @@ Rectangle {
Text {
anchors.verticalCenter: parent . verticalCenter
anchors.left: parent . left
font.family: "monospace"
anchors.leftMargin: 5
color: "#8b8b8b "
color: "#4a4a4a "
text: modelData . split ( ' ' ) [ 0 ] . substring ( 0 , 10 ) ;
font.pointSize: 9
}
@ -445,8 +487,9 @@ Rectangle {
width: parent . width - 5
wrapMode: Text . Wrap
anchors.left: parent . left
font.family: "monospace"
anchors.verticalCenter: parent . verticalCenter
color: "#8b8b8b "
color: "#4a4a4a "
text: modelData . split ( ' ' ) [ 1 ] . substring ( 0 , 10 ) ;
font.pointSize: 9
}
@ -462,18 +505,18 @@ Rectangle {
}
}
}
Rectangle {
width: debugPanel . width - 2 * machineStates . sideMargin
height: 2 ;
color: "#e3e3e3"
radius: 3
}
Rectangle
{
id: memoryRect ;
height: 25
width: parent . width
Layout.minimumHeight: 25
Layout.maximumHeight: 223
DebugInfoList {
id: memoryDump
width: debugPanel . width - 2 * machineStates . sideMargin
height: 223
anchors.fill: parent
collapsible: true
title: qsTr ( "Memory Dump" )
itemDelegate:
@ -483,20 +526,20 @@ Rectangle {
ItemDelegateDataDump { }
}
}
Rectangle {
width: debugPanel . width - 2 * machineStates . sideMargin
height: 2 ;
color: "#e3e3e3"
radius: 3
}
Rectangle
{
id: callDataRect
height: 25
width: parent . width
Layout.minimumHeight: 25
Layout.maximumHeight: 223
DebugInfoList {
id: callDataDump
width: debugPanel . width - 2 * machineStates . sideMargin
height: 223
anchors.fill: parent
collapsible: true
title: qsTr ( "Call data" )
title: qsTr ( "Call D ata" )
itemDelegate:
Item {
height: 29
@ -505,5 +548,14 @@ Rectangle {
}
}
}
Rectangle
{
width: parent . width
Layout.minimumHeight: 25
color: "transparent"
}
}
}
}
}
}