forked from carver/mix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- allows write a ctor with contract type param and select the contract
to use as a param in the transaction dialog.
- Loading branch information
Showing
5 changed files
with
124 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import QtQuick 2.0 | ||
import QtQuick.Controls 1.3 | ||
|
||
Item | ||
{ | ||
property alias value: textinput.text | ||
property alias contractCreationTr: ctrModel | ||
id: editRoot | ||
height: 30 | ||
width: 200 | ||
|
||
SourceSansProBold | ||
{ | ||
id: boldFont | ||
} | ||
|
||
function init() | ||
{ | ||
if (value.indexOf("<") === 0) | ||
{ | ||
for (var k = 0; k < ctrModel.count; k++) | ||
{ | ||
if ("<" + ctrModel.get(k).functionId + ">" === value) | ||
{ | ||
trCombobox.currentIndex = k; | ||
return; | ||
} | ||
} | ||
trCombobox.currentIndex = 0; | ||
value = ""; | ||
} | ||
} | ||
|
||
Rectangle { | ||
anchors.fill: parent | ||
radius: 4 | ||
TextInput { | ||
id: textinput | ||
text: value | ||
width: parent.width | ||
height: 30 | ||
wrapMode: Text.WrapAnywhere | ||
clip: true | ||
font.family: boldFont.name | ||
MouseArea { | ||
id: mouseArea | ||
anchors.fill: parent | ||
hoverEnabled: true | ||
onClicked: textinput.forceActiveFocus() | ||
} | ||
onTextChanged: | ||
{ | ||
if (trCombobox.selected) | ||
{ | ||
trCombobox.currentIndex = 0; | ||
trCombobox.selected = false; | ||
} | ||
} | ||
} | ||
} | ||
|
||
ListModel | ||
{ | ||
id: ctrModel | ||
} | ||
|
||
ComboBox | ||
{ | ||
property bool selected: false | ||
id: trCombobox | ||
model: ctrModel | ||
textRole: "functionId" | ||
anchors.verticalCenter: parent.verticalCenter | ||
anchors.left: textinput.parent.right | ||
onCurrentIndexChanged: { | ||
if (currentText === "") | ||
return; | ||
else if (currentText !== " - ") | ||
{ | ||
textinput.text = "<" + currentText + ">"; | ||
trCombobox.selected = true; | ||
} | ||
else if (textinput.text.indexOf("<") === 0) | ||
textinput.text = ""; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,5 +67,6 @@ | |
<file>qml/img/stop_button2x.png</file> | ||
<file>qml/img/warningicon.png</file> | ||
<file>qml/img/[email protected]</file> | ||
<file>qml/QAddressView.qml</file> | ||
</qresource> | ||
</RCC> |