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
id: jumpButtons
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
{
id: runBackAction;

78
mix/qml/StatesComboBox.qml

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

Loading…
Cancel
Save