mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-10 03:42:05 +02:00
InlineButton development
This commit is contained in:
parent
36ac2ee86d
commit
6d21b9919d
@ -47,10 +47,6 @@ Item {
|
|||||||
anchors.rightMargin: 8
|
anchors.rightMargin: 8
|
||||||
anchors.topMargin: 8
|
anchors.topMargin: 8
|
||||||
|
|
||||||
function onClicked(){
|
|
||||||
console.log("debug click");
|
|
||||||
}
|
|
||||||
|
|
||||||
function doClick() {
|
function doClick() {
|
||||||
// Android workaround
|
// Android workaround
|
||||||
releaseFocus();
|
releaseFocus();
|
||||||
@ -58,10 +54,11 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
color: "#808080"
|
id: rect
|
||||||
|
color: rect.enabled ? "#808080" : "#3b3b3b"
|
||||||
border.color: "black"
|
border.color: "black"
|
||||||
height: 32
|
height: 32
|
||||||
width: inlineText.width + 20
|
width: inlineText.width + 22
|
||||||
radius: 4
|
radius: 4
|
||||||
|
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
@ -70,14 +67,16 @@ Item {
|
|||||||
Text {
|
Text {
|
||||||
id: inlineText
|
id: inlineText
|
||||||
font.family: Style.fontBold.name
|
font.family: Style.fontBold.name
|
||||||
|
font.bold: true
|
||||||
font.pixelSize: 16 * scaleRatio
|
font.pixelSize: 16 * scaleRatio
|
||||||
color: "#FFFFFF"
|
color: "black"
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: buttonArea
|
id: buttonArea
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: doClick()
|
onClicked: doClick()
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@ import "." 1.0
|
|||||||
TextField {
|
TextField {
|
||||||
font.family: Style.fontRegular.name
|
font.family: Style.fontRegular.name
|
||||||
font.pixelSize: 22
|
font.pixelSize: 22
|
||||||
|
font.bold: true
|
||||||
horizontalAlignment: TextInput.AlignLeft
|
horizontalAlignment: TextInput.AlignLeft
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
color: "white"
|
color: "white"
|
||||||
|
@ -37,6 +37,7 @@ Item {
|
|||||||
property alias readOnly : input.readOnly
|
property alias readOnly : input.readOnly
|
||||||
property alias cursorPosition: input.cursorPosition
|
property alias cursorPosition: input.cursorPosition
|
||||||
property alias echoMode: input.echoMode
|
property alias echoMode: input.echoMode
|
||||||
|
property alias inlineButton: inlineButtonId
|
||||||
property alias inlineButtonText: inlineButtonId.text
|
property alias inlineButtonText: inlineButtonId.text
|
||||||
property alias inlineIcon: inlineIcon.visible
|
property alias inlineIcon: inlineIcon.visible
|
||||||
property int fontSize: 18 * scaleRatio
|
property int fontSize: 18 * scaleRatio
|
||||||
@ -70,9 +71,9 @@ Item {
|
|||||||
function getColor(error) {
|
function getColor(error) {
|
||||||
// @TODO: replace/remove this (implement as ternary?)
|
// @TODO: replace/remove this (implement as ternary?)
|
||||||
if (error)
|
if (error)
|
||||||
return Style.inputBoxBackground
|
return "transparent"
|
||||||
else
|
else
|
||||||
return Style.inputBoxBackground
|
return "transparent"
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
@ -85,7 +86,7 @@ Item {
|
|||||||
font.pixelSize: 20 * scaleRatio
|
font.pixelSize: 20 * scaleRatio
|
||||||
color: "#FFFFFF"
|
color: "#FFFFFF"
|
||||||
text: ""
|
text: ""
|
||||||
visible: item.setPlaceholder() ? false : true
|
visible: input.text ? false : true
|
||||||
z: 3
|
z: 3
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,6 +129,7 @@ Item {
|
|||||||
|
|
||||||
InlineButton {
|
InlineButton {
|
||||||
id: inlineButtonId
|
id: inlineButtonId
|
||||||
|
onClicked: inlineButtonId.onClicked
|
||||||
visible: item.inlineButtonText ? true : false
|
visible: item.inlineButtonText ? true : false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,8 +30,8 @@ import QtQuick 2.0
|
|||||||
import QtQuick.Layouts 1.1
|
import QtQuick.Layouts 1.1
|
||||||
import QtQuick.Dialogs 1.2
|
import QtQuick.Dialogs 1.2
|
||||||
import moneroComponents.PendingTransaction 1.0
|
import moneroComponents.PendingTransaction 1.0
|
||||||
import "../components"
|
|
||||||
import moneroComponents.Wallet 1.0
|
import moneroComponents.Wallet 1.0
|
||||||
|
import "../components"
|
||||||
import "." 1.0
|
import "." 1.0
|
||||||
|
|
||||||
|
|
||||||
@ -41,10 +41,18 @@ Rectangle {
|
|||||||
int priority, string description)
|
int priority, string description)
|
||||||
signal sweepUnmixableClicked()
|
signal sweepUnmixableClicked()
|
||||||
|
|
||||||
color: "black"
|
color: "transparent"
|
||||||
property string startLinkText: qsTr("<style type='text/css'>a {text-decoration: none; color: #FF6C3C; font-size: 14px;}</style><font size='2'> (</font><a href='#'>Start daemon</a><font size='2'>)</font>") + translationManager.emptyString
|
property string startLinkText: qsTr("<style type='text/css'>a {text-decoration: none; color: #FF6C3C; font-size: 14px;}</style><font size='2'> (</font><a href='#'>Start daemon</a><font size='2'>)</font>") + translationManager.emptyString
|
||||||
property bool showAdvanced: false
|
property bool showAdvanced: false
|
||||||
|
|
||||||
|
Image {
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.top: parent.top
|
||||||
|
height: panel.height
|
||||||
|
source: "../images/leftPanelBg.jpg"
|
||||||
|
}
|
||||||
|
|
||||||
function scaleValueToMixinCount(scaleValue) {
|
function scaleValueToMixinCount(scaleValue) {
|
||||||
var scaleToMixinCount = [6,7,8,9,10,11,12,13,14,16,18,20,22,25];
|
var scaleToMixinCount = [6,7,8,9,10,11,12,13,14,16,18,20,22,25];
|
||||||
if (scaleValue < scaleToMixinCount.length) {
|
if (scaleValue < scaleToMixinCount.length) {
|
||||||
@ -119,6 +127,7 @@ Rectangle {
|
|||||||
RowLayout{
|
RowLayout{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.bottomMargin: 20
|
Layout.bottomMargin: 20
|
||||||
|
height: 150
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: panelHeader
|
id: panelHeader
|
||||||
@ -144,22 +153,16 @@ Rectangle {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
id: amountRow
|
id: amountRow
|
||||||
Layout.minimumWidth: 200
|
Layout.minimumWidth: 200
|
||||||
Item {
|
|
||||||
visible: !isMobile
|
|
||||||
width: 37 * scaleRatio
|
|
||||||
height: 37 * scaleRatio
|
|
||||||
|
|
||||||
Image {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
source: "../images/moneroIcon.png"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Amount input
|
// Amount input
|
||||||
LineEdit {
|
LineEdit {
|
||||||
Layout.fillWidth: true
|
|
||||||
id: amountLine
|
id: amountLine
|
||||||
|
Layout.fillWidth: true
|
||||||
|
inlineIcon: true
|
||||||
placeholderText: qsTr("") + translationManager.emptyString
|
placeholderText: qsTr("") + translationManager.emptyString
|
||||||
width:100
|
width: 100
|
||||||
|
inlineButtonText: qsTr("All") + translationManager.emptyString
|
||||||
|
inlineButton.onClicked: amountLine.text = "(all)"
|
||||||
validator: DoubleValidator {
|
validator: DoubleValidator {
|
||||||
bottom: 0.0
|
bottom: 0.0
|
||||||
top: 18446744.073709551615
|
top: 18446744.073709551615
|
||||||
@ -168,21 +171,7 @@ Rectangle {
|
|||||||
locale: "C"
|
locale: "C"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StandardButton {
|
|
||||||
id: amountAllButton
|
|
||||||
width: 60 * scaleRatio
|
|
||||||
text: qsTr("All") + translationManager.emptyString
|
|
||||||
shadowReleasedColor: "#FF4304"
|
|
||||||
shadowPressedColor: "#B32D00"
|
|
||||||
releasedColor: "#FF6C3C"
|
|
||||||
pressedColor: "#FF4304"
|
|
||||||
enabled : true
|
|
||||||
onClicked: amountLine.text = "(all)"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
@ -197,7 +186,20 @@ Rectangle {
|
|||||||
// ListElement { column1: qsTr("LOW") + translationManager.emptyString ; column2: ""; priority: PendingTransaction.Priority_Low }
|
// ListElement { column1: qsTr("LOW") + translationManager.emptyString ; column2: ""; priority: PendingTransaction.Priority_Low }
|
||||||
// For translations to work, the strings need to be listed in
|
// For translations to work, the strings need to be listed in
|
||||||
// the file components/StandardDropdown.qml too.
|
// the file components/StandardDropdown.qml too.
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
|
=======
|
||||||
|
|
||||||
|
// Priorities before v5
|
||||||
|
ListModel {
|
||||||
|
id: priorityModel
|
||||||
|
|
||||||
|
ListElement { column1: qsTr("Low (x1 fee)") ; column2: ""; priority: PendingTransaction.Priority_Low }
|
||||||
|
ListElement { column1: qsTr("Medium (x20 fee)") ; column2: ""; priority: PendingTransaction.Priority_Medium }
|
||||||
|
ListElement { column1: qsTr("High (x166 fee)") ; column2: ""; priority: PendingTransaction.Priority_High }
|
||||||
|
}
|
||||||
|
|
||||||
|
>>>>>>> InlineButton development
|
||||||
// Priorites after v5
|
// Priorites after v5
|
||||||
ListModel {
|
ListModel {
|
||||||
id: priorityModelV5
|
id: priorityModelV5
|
||||||
@ -215,45 +217,32 @@ Rectangle {
|
|||||||
id: priorityDropdown
|
id: priorityDropdown
|
||||||
shadowReleasedColor: "#FF4304"
|
shadowReleasedColor: "#FF4304"
|
||||||
shadowPressedColor: "#B32D00"
|
shadowPressedColor: "#B32D00"
|
||||||
releasedColor: "#FF6C3C"
|
releasedColor: "black"
|
||||||
pressedColor: "#FF4304"
|
pressedColor: "#404040"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Make sure dropdown is on top
|
// Make sure dropdown is on top
|
||||||
z: parent.z + 1
|
z: parent.z + 1
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
id: amountRowx
|
|
||||||
Label {
|
|
||||||
id: amountLabelx
|
|
||||||
text: qsTr("Amount") + translationManager.emptyString
|
|
||||||
width: mainLayout.labelWidth
|
|
||||||
}
|
|
||||||
|
|
||||||
// this LineEdit is for testing purposes
|
|
||||||
LineEdit {
|
|
||||||
id: amountLinex
|
|
||||||
fontSize: mainLayout.lineEditFontSize
|
|
||||||
placeholderText: qsTr("Amount to receive") + translationManager.emptyString
|
|
||||||
readOnly: false
|
|
||||||
width: mainLayout.editWidth
|
|
||||||
Layout.fillWidth: true
|
|
||||||
inlineButtonText: "Testy"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Label {
|
Label {
|
||||||
id: addressLabel
|
id: addressLabel
|
||||||
textFormat: Text.RichText
|
textFormat: Text.RichText
|
||||||
|
<<<<<<< HEAD
|
||||||
text: "<style type='text/css'>a {text-decoration: none; color: #FF6C3C; font-size: 14px;}</style>" +
|
text: "<style type='text/css'>a {text-decoration: none; color: #FF6C3C; font-size: 14px;}</style>" +
|
||||||
qsTr("Address") +
|
qsTr("Address") +
|
||||||
"<font size='2'> ( " +
|
"<font size='2'> ( " +
|
||||||
qsTr("Paste in or select from <a href='#'>Address book</a>") +
|
qsTr("Paste in or select from <a href='#'>Address book</a>") +
|
||||||
" )</font>" +
|
" )</font>" +
|
||||||
translationManager.emptyString
|
translationManager.emptyString
|
||||||
|
=======
|
||||||
|
text: qsTr("<style type='text/css'>a {text-decoration: none; color: #858585; font-size: 14px;}</style>\
|
||||||
|
Address <font size='2'> ( Paste in or select from </font> <a href='#'>Address book</a><font size='2'> )</font>")
|
||||||
|
+ translationManager.emptyString
|
||||||
|
|
||||||
|
>>>>>>> InlineButton development
|
||||||
onLinkActivated: appWindow.showPageRequest("AddressBook")
|
onLinkActivated: appWindow.showPageRequest("AddressBook")
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
@ -282,19 +271,9 @@ Rectangle {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
anchors.topMargin: 5 * scaleRatio
|
anchors.topMargin: 5 * scaleRatio
|
||||||
placeholderText: "4..."
|
placeholderText: "4..."
|
||||||
// validator: RegExpValidator { regExp: /[0-9A-Fa-f]{95}/g }
|
inlineButtonText: qsTr("Resolve") + translationManager.emptyString
|
||||||
}
|
inlineButton.enabled: isValidOpenAliasAddress(addressLine.text)
|
||||||
|
inlineButton.onClicked: {
|
||||||
StandardButton {
|
|
||||||
id: resolveButton
|
|
||||||
width: 60 * scaleRatio
|
|
||||||
text: qsTr("Resolve") + translationManager.emptyString
|
|
||||||
shadowReleasedColor: "#FF4304"
|
|
||||||
shadowPressedColor: "#B32D00"
|
|
||||||
releasedColor: "#FF6C3C"
|
|
||||||
pressedColor: "#FF4304"
|
|
||||||
enabled : isValidOpenAliasAddress(addressLine.text)
|
|
||||||
onClicked: {
|
|
||||||
var result = walletManager.resolveOpenAlias(addressLine.text)
|
var result = walletManager.resolveOpenAlias(addressLine.text)
|
||||||
if (result) {
|
if (result) {
|
||||||
var parts = result.split("|")
|
var parts = result.split("|")
|
||||||
@ -325,6 +304,7 @@ Rectangle {
|
|||||||
oa_message(qsTr("No address found"))
|
oa_message(qsTr("No address found"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// validator: RegExpValidator { regExp: /[0-9A-Fa-f]{95}/g }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user