Browse Source

fix indentation issues

cl-refactor
yann300 10 years ago
parent
commit
ae5d53bc78
  1. 5
      mix/qml/Ether.qml
  2. 30
      mix/qml/StateDialog.qml
  3. 66
      mix/qml/TransactionDialog.qml

5
mix/qml/Ether.qml

@ -65,6 +65,7 @@ RowLayout {
formattedValue.text = value.format(); formattedValue.text = value.format();
} }
} }
model: ListModel { model: ListModel {
id: unitsModel id: unitsModel
ListElement { text: "Uether"; } ListElement { text: "Uether"; }
@ -87,11 +88,11 @@ RowLayout {
ListElement { text: "Kwei"; } ListElement { text: "Kwei"; }
ListElement { text: "wei"; } ListElement { text: "wei"; }
} }
style: ComboBoxStyle style: ComboBoxStyle {
{
font: regularFont.name font: regularFont.name
} }
} }
Text Text
{ {
visible: displayFormattedValue visible: displayFormattedValue

30
mix/qml/StateDialog.qml

@ -44,8 +44,6 @@ Window {
isDefault = setDefault; isDefault = setDefault;
titleField.focus = true; titleField.focus = true;
defaultCheckBox.enabled = !isDefault; defaultCheckBox.enabled = !isDefault;
} }
function close() { function close() {
@ -67,8 +65,7 @@ Window {
id: regularFont id: regularFont
} }
Rectangle Rectangle {
{
anchors.fill: parent anchors.fill: parent
anchors.margins: 10 anchors.margins: 10
color: StateDialogStyle.generic.backgroundColor color: StateDialogStyle.generic.backgroundColor
@ -114,8 +111,7 @@ Window {
} }
} }
ColumnLayout ColumnLayout {
{
anchors.top: dialogContent.bottom anchors.top: dialogContent.bottom
anchors.topMargin: 5 anchors.topMargin: 5
spacing: 5 spacing: 5
@ -132,8 +128,7 @@ Window {
onClicked: transactionsModel.addTransaction() onClicked: transactionsModel.addTransaction()
height: 5 height: 5
width: 5 width: 5
style: ButtonStyle style: ButtonStyle {
{
label: Text { label: Text {
font.family: regularFont.name font.family: regularFont.name
text: qsTr("+") text: qsTr("+")
@ -165,7 +160,9 @@ Window {
} }
} }
RowLayout {
RowLayout
{
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.right: parent.right; anchors.right: parent.right;
@ -183,9 +180,6 @@ Window {
} }
} }
ListModel { ListModel {
id: transactionsModel id: transactionsModel
@ -229,8 +223,7 @@ Window {
visible: !stdContract visible: !stdContract
Layout.fillHeight: true Layout.fillHeight: true
onClicked: transactionsModel.editTransaction(index) onClicked: transactionsModel.editTransaction(index)
style: ButtonStyle style: ButtonStyle {
{
label: Text { label: Text {
font.family: regularFont.name font.family: regularFont.name
text: qsTr("Edit") text: qsTr("Edit")
@ -247,8 +240,7 @@ Window {
text: qsTr("Delete"); text: qsTr("Delete");
Layout.fillHeight: true Layout.fillHeight: true
onClicked: transactionsModel.deleteTransaction(index) onClicked: transactionsModel.deleteTransaction(index)
style: ButtonStyle style: ButtonStyle {
{
label: Text { label: Text {
font.family: regularFont.name font.family: regularFont.name
text: qsTr("Delete") text: qsTr("Delete")
@ -264,9 +256,11 @@ Window {
} }
} }
TransactionDialog { TransactionDialog
{
id: transactionDialog id: transactionDialog
onAccepted: { onAccepted:
{
var item = transactionDialog.getItem(); var item = transactionDialog.getItem();
if (transactionDialog.transactionIndex < transactionsModel.count) { if (transactionDialog.transactionIndex < transactionsModel.count) {

66
mix/qml/TransactionDialog.qml

@ -209,8 +209,7 @@ Window {
onCurrentIndexChanged: { onCurrentIndexChanged: {
loadParameters(); loadParameters();
} }
style: ComboBoxStyle style: ComboBoxStyle {
{
font: regularFont.name font: regularFont.name
} }
} }
@ -432,69 +431,8 @@ Window {
} }
} }
} }
ListModel { ListModel {
id: paramsModel id: paramsModel
} }
Component {
id: rowDelegate
Item {
height: 100
}
}
Component {
id: editableDelegate
Item {
Loader {
id: loaderEditor
anchors.fill: parent
anchors.margins: 4
Connections {
target: loaderEditor.item
onTextChanged: {
if (styleData.role === "value" && styleData.row < paramsModel.count)
loaderEditor.updateValue(styleData.row, styleData.role, loaderEditor.item.text);
}
}
function updateValue(row, role, value)
{
paramsModel.setProperty(styleData.row, styleData.role, value);
}
sourceComponent:
{
if (styleData.role === "value")
{
if (paramsModel.get(styleData.row) === undefined)
return null;
if (paramsModel.get(styleData.row).type.indexOf("int") !== -1)
return intViewComp;
else if (paramsModel.get(styleData.row).type.indexOf("bool") !== -1)
return boolViewComp;
else if (paramsModel.get(styleData.row).type.indexOf("string") !== -1)
return stringViewComp;
else if (paramsModel.get(styleData.row).type.indexOf("hash") !== -1)
return hashViewComp;
}
else
return editor;
}
Component {
id: editor
TextInput {
id: textinput
readOnly: true
color: styleData.textColor
text: styleData.value
font.family: regularFont.name
}
}
}
}
}
} }

Loading…
Cancel
Save