Browse Source

ui changes

cl-refactor
yann300 10 years ago
parent
commit
5953778e3c
  1. 105
      mix/qml/Block.qml
  2. 13
      mix/qml/BlockChain.qml
  3. 1
      mix/qml/StateListModel.qml
  4. 4
      mix/qml/WebPreview.qml

105
mix/qml/Block.qml

@ -16,7 +16,7 @@ ColumnLayout
property int number property int number
property int blockWidth: Layout.preferredWidth - statusWidth - horizontalMargin property int blockWidth: Layout.preferredWidth - statusWidth - horizontalMargin
property int horizontalMargin: 10 property int horizontalMargin: 10
property int trHeight: 30 property int trHeight: 35
spacing: 0 spacing: 0
property int openedTr: 0 property int openedTr: 0
property int blockIndex property int blockIndex
@ -42,6 +42,10 @@ ColumnLayout
height = calculateHeight() height = calculateHeight()
} }
DebuggerPaneStyle {
id: dbgStyle
}
RowLayout RowLayout
{ {
Layout.preferredHeight: trHeight Layout.preferredHeight: trHeight
@ -60,6 +64,7 @@ ColumnLayout
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: horizontalMargin anchors.leftMargin: horizontalMargin
font.pointSize: dbgStyle.absoluteSize(1)
color: "#adadad" color: "#adadad"
text: text:
{ {
@ -196,44 +201,61 @@ ColumnLayout
{ {
anchors.top: parent.top anchors.top: parent.top
width: parent.width width: parent.width
spacing: 10 spacing: 7
RowLayout RowLayout
{ {
anchors.top: parent.top anchors.top: parent.top
Layout.fillWidth: true Layout.fillWidth: true
spacing: cellSpacing spacing: cellSpacing
Text Rectangle
{ {
id: hash Layout.preferredWidth: fromWidth
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: horizontalMargin anchors.leftMargin: horizontalMargin
Layout.preferredWidth: fromWidth Text
elide: Text.ElideRight {
maximumLineCount: 1 id: hash
color: labelColor width: parent.width - 30
text: { elide: Text.ElideRight
if (index >= 0) anchors.verticalCenter: parent.verticalCenter
return transactions.get(index).sender maximumLineCount: 1
else color: labelColor
return "" font.pointSize: dbgStyle.absoluteSize(1)
font.bold: true
text: {
if (index >= 0)
return transactions.get(index).sender
else
return ""
}
} }
} }
Text
Rectangle
{ {
id: func
text: {
if (index >= 0)
parent.userFrienldyToken(transactions.get(index).label)
else
return ""
}
elide: Text.ElideRight
color: labelColor
maximumLineCount: 1
Layout.preferredWidth: toWidth Layout.preferredWidth: toWidth
Text
{
id: func
text: {
if (index >= 0)
parent.parent.userFrienldyToken(transactions.get(index).label)
else
return ""
}
elide: Text.ElideRight
anchors.verticalCenter: parent.verticalCenter
color: labelColor
font.pointSize: dbgStyle.absoluteSize(1)
font.bold: true
maximumLineCount: 1
width: parent.width
}
} }
function userFrienldyToken(value) function userFrienldyToken(value)
{ {
if (value && value.indexOf("<") === 0) if (value && value.indexOf("<") === 0)
@ -247,18 +269,25 @@ ColumnLayout
return value return value
} }
Text Rectangle
{ {
id: returnValue
elide: Text.ElideRight
maximumLineCount: 1
color: labelColor
Layout.preferredWidth: valueWidth Layout.preferredWidth: valueWidth
text: { Text
if (index >= 0 && transactions.get(index).returned) {
return transactions.get(index).returned id: returnValue
else elide: Text.ElideRight
return "" anchors.verticalCenter: parent.verticalCenter
maximumLineCount: 1
color: labelColor
font.bold: true
font.pointSize: dbgStyle.absoluteSize(1)
width: parent.width -30
text: {
if (index >= 0 && transactions.get(index).returned)
return transactions.get(index).returned
else
return ""
}
} }
} }
@ -272,8 +301,11 @@ ColumnLayout
{ {
id: logs id: logs
anchors.left: parent.left anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: 10 anchors.leftMargin: 10
color: labelColor color: labelColor
font.bold: true
font.pointSize: dbgStyle.absoluteSize(1)
text: { text: {
if (index >= 0 && transactions.get(index).logs && transactions.get(index).logs.count) if (index >= 0 && transactions.get(index).logs && transactions.get(index).logs.count)
return transactions.get(index).logs.count return transactions.get(index).logs.count
@ -288,8 +320,6 @@ ColumnLayout
} }
} }
} }
} }
RowLayout RowLayout
@ -329,8 +359,9 @@ ColumnLayout
Rectangle Rectangle
{ {
width: debugActionWidth width: debugActionWidth
height: trHeight - 10 height: trHeight
anchors.left: rowContentTr.right anchors.left: rowContentTr.right
anchors.topMargin: -6
anchors.top: rowContentTr.top anchors.top: rowContentTr.top
anchors.leftMargin: -50 anchors.leftMargin: -50
color: "transparent" color: "transparent"

13
mix/qml/BlockChain.qml

@ -40,16 +40,16 @@ ColumnLayout {
if (width <= 630 || previousWidth <= 630) if (width <= 630 || previousWidth <= 630)
{ {
fromWidth = 100 fromWidth = 150
toWidth = 100 toWidth = 100
valueWidth = 250 valueWidth = 200
} }
else else
{ {
var diff = (width - previousWidth) / 3; var diff = (width - previousWidth) / 3;
fromWidth = fromWidth + diff < 100 ? 100 : fromWidth + diff fromWidth = fromWidth + diff < 150 ? 150 : fromWidth + diff
toWidth = toWidth + diff < 100 ? 100 : toWidth + diff toWidth = toWidth + diff < 100 ? 100 : toWidth + diff
valueWidth = valueWidth + diff < 250 ? 250 : valueWidth + diff valueWidth = valueWidth + diff < 200 ? 200 : valueWidth + diff
} }
previousWidth = width previousWidth = width
} }
@ -68,9 +68,9 @@ ColumnLayout {
} }
property int statusWidth: 50 property int statusWidth: 50
property int fromWidth: 100 property int fromWidth: 150
property int toWidth: 100 property int toWidth: 100
property int valueWidth: 250 property int valueWidth: 200
property int logsWidth: 40 property int logsWidth: 40
property int debugActionWidth: 40 property int debugActionWidth: 40
property int horizontalMargin: 10 property int horizontalMargin: 10
@ -422,7 +422,6 @@ ColumnLayout {
return; return;
} }
} }
// tr is not in the list. // tr is not in the list.
var itemTr = TransactionHelper.defaultTransaction() var itemTr = TransactionHelper.defaultTransaction()
itemTr.saveStatus = false itemTr.saveStatus = false

1
mix/qml/StateListModel.qml

@ -256,6 +256,7 @@ Item {
if (!_secret) if (!_secret)
_secret = clientModel.newSecret(); _secret = clientModel.newSecret();
var address = clientModel.address(_secret); var address = clientModel.address(_secret);
console.log(address);
var name = qsTr("Account") + "-" + address.substring(0, 4); var name = qsTr("Account") + "-" + address.substring(0, 4);
return { name: name, secret: _secret, balance: QEtherHelper.createEther(_balance, _unit), address: address }; return { name: name, secret: _secret, balance: QEtherHelper.createEther(_balance, _unit), address: address };
} }

4
mix/qml/WebPreview.qml

@ -89,10 +89,10 @@ Item {
} }
} }
Connections { /*Connections {
target: clientModel target: clientModel
onRunComplete: reload(); onRunComplete: reload();
} }*/
Connections { Connections {
target: codeModel target: codeModel

Loading…
Cancel
Save