Browse Source

- Add actions for play and stop debugging.

- Small change in layout of statecombobox.
cl-refactor
yann300 10 years ago
parent
commit
877380bf58
  1. 12
      mix/qml/Debugger.qml
  2. 39
      mix/qml/StatesComboBox.qml
  3. 6
      mix/qml/TransactionLog.qml
  4. BIN
      mix/qml/img/stop_button2x.png
  5. 1
      mix/res.qrc

12
mix/qml/Debugger.qml

@ -225,24 +225,24 @@ Rectangle {
id: playAction id: playAction
enabledStateImg: "qrc:/qml/img/play_button.png" enabledStateImg: "qrc:/qml/img/play_button.png"
disableStateImg: "qrc:/qml/img/play_button.png" disableStateImg: "qrc:/qml/img/play_button.png"
onClicked: console.log("play"); onClicked: projectModel.stateListModel.runState(transactionLog.selectedStateIndex)
width: 30 width: 30
height: 30 height: 30
buttonShortcut: "Ctrl+Shift+F8" buttonShortcut: "Ctrl+Shift+F8"
buttonTooltip: qsTr("Play") buttonTooltip: qsTr("Start Debugging")
visible: true visible: true
} }
StepActionImage StepActionImage
{ {
id: pauseAction id: pauseAction
enabledStateImg: "qrc:/qml/img/pause_button.png" enabledStateImg: "qrc:/qml/img/stop_button2x.png"
disableStateImg: "qrc:/qml/img/pause_button.png" disableStateImg: "qrc:/qml/img/stop_button2x.png"
onClicked: console.log("pause"); onClicked: Debugger.init(null);
width: 30 width: 30
height: 30 height: 30
buttonShortcut: "Ctrl+Shift+F9" buttonShortcut: "Ctrl+Shift+F9"
buttonTooltip: qsTr("Pause") buttonTooltip: qsTr("Stop Debugging")
visible: true visible: true
} }

39
mix/qml/StatesComboBox.qml

@ -29,7 +29,7 @@ Rectangle {
id: statesComboBox id: statesComboBox
width: 200 width: 200
height: 20 height: 23
Component.onCompleted: { Component.onCompleted: {
var top = dropDownList var top = dropDownList
@ -53,7 +53,7 @@ Rectangle {
signal selectItem(real item) signal selectItem(real item)
signal editItem(real item) signal editItem(real item)
signal selectCreate signal selectCreate
property variant rowHeight: 25 property int rowHeight: 25
property variant items property variant items
property alias selectedItem: chosenItemText.text property alias selectedItem: chosenItemText.text
property alias selectedIndex: listView.currentRow property alias selectedIndex: listView.currentRow
@ -67,21 +67,31 @@ Rectangle {
property variant colorItem property variant colorItem
property variant colorSelect property variant colorSelect
SourceSansProRegular
{
id: regularFont
}
SourceSansProBold
{
id: boldFont
}
smooth: true smooth: true
Rectangle { Rectangle {
id: chosenItem id: chosenItem
width: parent.width width: parent.width
height: statesComboBox.height height: statesComboBox.height
color: statesComboBox.color color: statesComboBox.color
smooth: true
Text { Text {
id: chosenItemText id: chosenItemText
anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.margins: 2 anchors.leftMargin: 10
anchors.verticalCenter: parent.verticalCenter
color: statesComboBox.colorItem color: statesComboBox.colorItem
text: "" text: ""
smooth: true font.family: regularFont.name
} }
MouseArea { MouseArea {
@ -111,7 +121,7 @@ Rectangle {
clip: true clip: true
radius: 4 radius: 4
anchors.top: chosenItem.top anchors.top: chosenItem.top
anchors.margins: 2 anchors.topMargin: 23
color: statesComboBox.color color: statesComboBox.color
ColumnLayout { ColumnLayout {
@ -151,7 +161,9 @@ Rectangle {
color: statesComboBox.colorItem color: statesComboBox.colorItem
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.margins: 5 anchors.leftMargin: 10
anchors.topMargin: 5
font.family: regularFont.name
} }
Image { Image {
id: imageItemid id: imageItemid
@ -197,15 +209,18 @@ Rectangle {
} //Table View } //Table View
RowLayout { RowLayout {
Rectangle { anchors.top: listView.bottom
width: 1 anchors.topMargin: 4
} anchors.left: parent.left
anchors.leftMargin: 10
Text { Text {
id: createStateText id: createStateText
width: statesComboBox.width width: statesComboBox.width
height: statesComboBox.height height: statesComboBox.height
font.bold: true font.family: boldFont.name
color: "#808080"
text: qsTr("Create State ...") text: qsTr("Create State ...")
font.weight: Font.DemiBold
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true

6
mix/qml/TransactionLog.qml

@ -9,6 +9,7 @@ Item {
property ListModel fullModel: ListModel{} property ListModel fullModel: ListModel{}
property ListModel transactionModel: ListModel{} property ListModel transactionModel: ListModel{}
property ListModel callModel: ListModel{} property ListModel callModel: ListModel{}
property int selectedStateIndex: statesCombo.selectedIndex
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
@ -45,14 +46,15 @@ Item {
projectModel.stateListModel.debugDefaultState(); projectModel.stateListModel.debugDefaultState();
} }
} }
StatesComboBox StatesComboBox
{ {
id: statesCombo id: statesCombo
items: projectModel.stateListModel items: projectModel.stateListModel
onSelectCreate: projectModel.stateListModel.addState(); onSelectCreate: projectModel.stateListModel.addState();
onEditItem: projectModel.stateListModel.editState(item) onEditItem: projectModel.stateListModel.editState(item)
colorItem: "black" colorItem: "#808080"
colorSelect: "blue" colorSelect: "#4a90e2"
color: "white" color: "white"
Connections { Connections {
target: projectModel.stateListModel target: projectModel.stateListModel

BIN
mix/qml/img/stop_button2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

1
mix/res.qrc

@ -62,5 +62,6 @@
<file>qml/img/copyicon.png</file> <file>qml/img/copyicon.png</file>
<file>qml/img/copyiconactive.png</file> <file>qml/img/copyiconactive.png</file>
<file>qml/img/searchicon.png</file> <file>qml/img/searchicon.png</file>
<file>qml/img/stop_button2x.png</file>
</qresource> </qresource>
</RCC> </RCC>

Loading…
Cancel
Save