Browse Source

fix #1472

cl-refactor
Ali Mashatan 10 years ago
parent
commit
9d2a23b51e
  1. 27
      mix/qml/Debugger.qml
  2. 78
      mix/qml/StatesComboBox.qml
  3. 35
      mix/qml/TransactionLog.qml

27
mix/qml/Debugger.qml

@ -219,6 +219,33 @@ Rectangle {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
id: jumpButtons id: jumpButtons
spacing: 3 spacing: 3
StepActionImage
{
id: playAction
enabledStateImg: "qrc:/qml/img/play_button.png"
disableStateImg: "qrc:/qml/img/play_button.png"
onClicked: console.log("play");
width: 30
height: 30
buttonShortcut: "Ctrl+Shift+F8"
buttonTooltip: qsTr("Play")
visible: true
}
StepActionImage
{
id: pauseAction
enabledStateImg: "qrc:/qml/img/pause_button.png"
disableStateImg: "qrc:/qml/img/pause_button.png"
onClicked: console.log("pause");
width: 30
height: 30
buttonShortcut: "Ctrl+Shift+F9"
buttonTooltip: qsTr("Pause")
visible: true
}
StepActionImage StepActionImage
{ {
id: runBackAction; id: runBackAction;

78
mix/qml/StatesComboBox.qml

@ -26,9 +26,9 @@ import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
Rectangle { Rectangle {
id:statesComboBox id: statesComboBox
width:200; width: 200;
height: 20; height: 20;
Component.onCompleted: Component.onCompleted:
@ -72,19 +72,19 @@ Rectangle {
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; smooth: true;
Text { Text {
id:chosenItemText id: chosenItemText
anchors.top: parent.top; anchors.top: parent.top;
anchors.left: parent.left; anchors.left: parent.left;
anchors.margins: 2; anchors.margins: 2;
color: statesComboBox.colorItem; color: statesComboBox.colorItem;
text:"" text: ""
smooth:true smooth: true
} }
MouseArea { MouseArea {
@ -96,35 +96,34 @@ Rectangle {
} }
Rectangle { Rectangle {
id:dropDownShowdowList id: dropDownShowdowList
width:statesComboBox.width; width: statesComboBox.width;
opacity: 0.3 opacity: 0.3
height:0; height: 0;
clip:true; clip: true;
radius:4; radius: 4;
anchors.top: chosenItem.top; anchors.top: chosenItem.top;
anchors.margins: 2; anchors.margins: 2;
color: "gray" color: "gray"
} }
//ToDo: We need scrollbar for items //ToDo: We need scrollbar for items
Rectangle { Rectangle {
id:dropDownList id: dropDownList
width:statesComboBox.width; width: statesComboBox.width;
height:0; height: 0;
clip:true; clip: true;
radius:4; radius: 4;
anchors.top: chosenItem.top; anchors.top: chosenItem.top;
anchors.margins: 2; anchors.margins: 2;
color: statesComboBox.color color: statesComboBox.color
ColumnLayout {
ColumnLayout{
spacing: 2 spacing: 2
TableView { TableView {
id:listView id: listView
height:20; height: 20;
implicitHeight: 0 implicitHeight: 0
width:statesComboBox.width; width: statesComboBox.width;
model: statesComboBox.items model: statesComboBox.items
horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff; horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff;
currentRow: -1 currentRow: -1
@ -140,14 +139,14 @@ Rectangle {
delegate: mainItemDelegate delegate: mainItemDelegate
} }
rowDelegate: Rectangle { rowDelegate: Rectangle {
width:statesComboBox.width; width: statesComboBox.width;
height: statesComboBox.rowHeight; height: statesComboBox.rowHeight;
} }
Component { Component {
id: mainItemDelegate id: mainItemDelegate
Rectangle { Rectangle {
id: itemDelegate id: itemDelegate
width:statesComboBox.width; width: statesComboBox.width;
height: statesComboBox.height; height: statesComboBox.height;
Text { Text {
id: textItemid id: textItemid
@ -156,13 +155,12 @@ Rectangle {
anchors.top: parent.top; anchors.top: parent.top;
anchors.left: parent.left; anchors.left: parent.left;
anchors.margins: 5; anchors.margins: 5;
} }
Image { Image {
id: imageItemid id: imageItemid
height:20 height: 20
width:20; width: 20;
anchors.right:parent.right anchors.right: parent.right
anchors.top: parent.top; anchors.top: parent.top;
anchors.margins: 5; anchors.margins: 5;
visible: false; visible: false;
@ -199,20 +197,20 @@ Rectangle {
}//Component }//Component
}//Table View }//Table View
RowLayout{ RowLayout {
Rectangle{ Rectangle {
width: 1 width: 1
} }
Text{ Text{
id:createStateText id: createStateText
width:statesComboBox.width; width: statesComboBox.width;
height: statesComboBox.height; height: statesComboBox.height;
font.bold: true font.bold: true
text:"Create State ..." text: "Create State ..."
MouseArea MouseArea
{ {
anchors.fill: parent; anchors.fill: parent;
hoverEnabled : true hoverEnabled: true
onEntered: { onEntered: {
createStateText.color = statesComboBox.colorSelect; createStateText.color = statesComboBox.colorSelect;
@ -232,9 +230,9 @@ Rectangle {
} }
states: State { states: State {
name: "dropDown"; name: "dropDown";
PropertyChanges { target: dropDownList; height:(statesComboBox.rowHeight*(statesComboBox.items.count+1)) } PropertyChanges { target: dropDownList; height: (statesComboBox.rowHeight*(statesComboBox.items.count+1)) }
PropertyChanges { target: dropDownShowdowList; width:statesComboBox.width+3; height:(statesComboBox.rowHeight*(statesComboBox.items.count+1))+3 } PropertyChanges { target: dropDownShowdowList; width: statesComboBox.width+3; height: (statesComboBox.rowHeight*(statesComboBox.items.count+1))+3 }
PropertyChanges { target:listView; height:20; implicitHeight: (statesComboBox.rowHeight*(statesComboBox.items.count)) } PropertyChanges { target: listView; height: 20; implicitHeight: (statesComboBox.rowHeight*(statesComboBox.items.count)) }
} }
} }

35
mix/qml/TransactionLog.qml

@ -10,38 +10,6 @@ Item {
property ListModel transactionModel: ListModel{} property ListModel transactionModel: ListModel{}
property ListModel callModel: ListModel{} property ListModel callModel: ListModel{}
Action {
id: addStateAction
text: "Add State"
shortcut: "Ctrl+Alt+T"
enabled: codeModel.hasContract && !clientModel.running;
onTriggered: projectModel.stateListModel.addState();
}
Action {
id: editStateAction
text: "Edit State"
shortcut: "Ctrl+Alt+T"
enabled: codeModel.hasContract && !clientModel.running && statesCombo.selectedIndex >= 0 && projectModel.stateListModel.count > 0;
onTriggered: projectModel.stateListModel.editState(statesCombo.selectedIndex);
}
Action {
id: playAndPauseAction
checkable: true;
checked: false;
iconSource: "qrc:/qml/img/play_button.png"
onToggled: {
if (checked)
{
this.iconSource = "qrc:/qml/img/pause_button2x.png"
console.log("play");
}else{
this.iconSource = "qrc:/qml/img/play_button2x.png"
console.log("pause");
}
}
enabled: true
}
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
RowLayout { RowLayout {
@ -80,8 +48,7 @@ Item {
StatesComboBox StatesComboBox
{ {
id: statesCombo id: statesCombo
items:projectModel.stateListModel items: projectModel.stateListModel
//onSelectItem: console.log("Combobox Select Item: " + item )
onSelectCreate: projectModel.stateListModel.addState(); onSelectCreate: projectModel.stateListModel.addState();
onEditItem: projectModel.stateListModel.editState(item) onEditItem: projectModel.stateListModel.editState(item)
colorItem: "black" colorItem: "black"

Loading…
Cancel
Save