|
| 1 | +// Copyright (c) 2024 The Bitcoin Core developers |
| 2 | +// Distributed under the MIT software license, see the accompanying |
| 3 | +// file COPYING or http://www.opensource.org/licenses/mit-license.php. |
| 4 | + |
| 5 | +import QtQuick 2.15 |
| 6 | +import QtQuick.Controls 2.15 |
| 7 | +import QtQuick.Layouts 1.15 |
| 8 | + |
| 9 | +Item { |
| 10 | + property alias labelText: label.text |
| 11 | + property alias text: input.text |
| 12 | + property alias placeholderText: input.placeholderText |
| 13 | + property alias iconSource: icon.source |
| 14 | + property alias customIcon: iconContainer.data |
| 15 | + property alias enabled: input.enabled |
| 16 | + |
| 17 | + signal iconClicked |
| 18 | + signal textEdited |
| 19 | + |
| 20 | + id: root |
| 21 | + implicitHeight: label.height + input.height |
| 22 | + |
| 23 | + CoreText { |
| 24 | + id: label |
| 25 | + anchors.left: parent.left |
| 26 | + anchors.top: parent.top |
| 27 | + color: Theme.color.neutral7 |
| 28 | + font.pixelSize: 15 |
| 29 | + } |
| 30 | + |
| 31 | + TextField { |
| 32 | + id: input |
| 33 | + anchors.left: parent.left |
| 34 | + anchors.right: iconContainer.left |
| 35 | + anchors.bottom: parent.bottom |
| 36 | + leftPadding: 0 |
| 37 | + font.family: "Inter" |
| 38 | + font.styleName: "Regular" |
| 39 | + font.pixelSize: 18 |
| 40 | + color: Theme.color.neutral9 |
| 41 | + placeholderTextColor: Theme.color.neutral7 |
| 42 | + background: Item {} |
| 43 | + onTextEdited: root.textEdited() |
| 44 | + } |
| 45 | + |
| 46 | + Item { |
| 47 | + id: iconContainer |
| 48 | + anchors.right: parent.right |
| 49 | + anchors.verticalCenter: input.verticalCenter |
| 50 | + |
| 51 | + Icon { |
| 52 | + id: icon |
| 53 | + source: "" |
| 54 | + color: Theme.color.neutral8 |
| 55 | + size: 30 |
| 56 | + enabled: source != "" |
| 57 | + onClicked: root.iconClicked() |
| 58 | + } |
| 59 | + } |
| 60 | +} |
0 commit comments