InlineButton development

This commit is contained in:
Sander Ferdinand
2017-11-25 22:53:07 +01:00
committed by moneromooo-monero
parent 36ac2ee86d
commit 6d21b9919d
4 changed files with 54 additions and 72 deletions

View File

@@ -47,10 +47,6 @@ Item {
anchors.rightMargin: 8
anchors.topMargin: 8
function onClicked(){
console.log("debug click");
}
function doClick() {
// Android workaround
releaseFocus();
@@ -58,10 +54,11 @@ Item {
}
Rectangle{
color: "#808080"
id: rect
color: rect.enabled ? "#808080" : "#3b3b3b"
border.color: "black"
height: 32
width: inlineText.width + 20
width: inlineText.width + 22
radius: 4
anchors.top: parent.top
@@ -70,14 +67,16 @@ Item {
Text {
id: inlineText
font.family: Style.fontBold.name
font.bold: true
font.pixelSize: 16 * scaleRatio
color: "#FFFFFF"
color: "black"
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
}
MouseArea {
id: buttonArea
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked: doClick()
}

View File

@@ -33,6 +33,7 @@ import "." 1.0
TextField {
font.family: Style.fontRegular.name
font.pixelSize: 22
font.bold: true
horizontalAlignment: TextInput.AlignLeft
selectByMouse: true
color: "white"

View File

@@ -37,6 +37,7 @@ Item {
property alias readOnly : input.readOnly
property alias cursorPosition: input.cursorPosition
property alias echoMode: input.echoMode
property alias inlineButton: inlineButtonId
property alias inlineButtonText: inlineButtonId.text
property alias inlineIcon: inlineIcon.visible
property int fontSize: 18 * scaleRatio
@@ -70,9 +71,9 @@ Item {
function getColor(error) {
// @TODO: replace/remove this (implement as ternary?)
if (error)
return Style.inputBoxBackground
return "transparent"
else
return Style.inputBoxBackground
return "transparent"
}
Text {
@@ -85,7 +86,7 @@ Item {
font.pixelSize: 20 * scaleRatio
color: "#FFFFFF"
text: ""
visible: item.setPlaceholder() ? false : true
visible: input.text ? false : true
z: 3
}
@@ -128,6 +129,7 @@ Item {
InlineButton {
id: inlineButtonId
onClicked: inlineButtonId.onClicked
visible: item.inlineButtonText ? true : false
}
}