[StatusQ] Move StyledTextField to StatusQ
- and rename it and its usages to StatusTextField - remove a couple of related and unused components Fixes #16296
This commit is contained in:
parent
69605f5965
commit
0c6a602336
|
@ -170,7 +170,7 @@ editPermissionView_Is_allowed_to_StatusFlowSelector = {"container": mainWindow_e
|
|||
editPermissionView_In_StatusItemSelector = {"container": mainWindow_editPermissionView_EditPermissionView, "id": "inSelector", "type": "StatusItemSelector", "unnamed": 1, "visible": True}
|
||||
editPermissionView_whoHoldsSwitch_StatusSwitch = {"checkable": True, "container": mainWindow_editPermissionView_EditPermissionView, "id": "whoHoldsSwitch", "type": "StatusSwitch", "unnamed": 1, "visible": True}
|
||||
edit_TextEdit = {"container": statusDesktop_mainWindow_overlay, "type": "TextEdit", "unnamed": 1, "visible": True}
|
||||
inputValue_StyledTextField = {"container": statusDesktop_mainWindow_overlay, "id": "inputValue", "type": "StyledTextField", "unnamed": 1, "visible": True}
|
||||
inputValue_StyledTextField = {"container": statusDesktop_mainWindow_overlay, "id": "inputValue", "type": "StatusTextField", "unnamed": 1, "visible": True}
|
||||
o_TokenItem = {"container": statusDesktop_mainWindow_overlay, "index": 0, "type": "TokenItem", "unnamed": 1, "visible": True}
|
||||
add_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "objectName": "addButton", "type": "StatusButton", "visible": True}
|
||||
add_update_statusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "id": "addOrUpdateButton", "type": "StatusButton", "unnamed": 1, "visible": True}
|
||||
|
|
|
@ -507,7 +507,7 @@ o_StatusTabBar = {"container": statusDesktop_mainWindow_overlay, "type": "Status
|
|||
tab_Status_template = {"container": o_StatusTabBar, "type": "StatusBaseText", "unnamed": 1, "visible": True}
|
||||
o_TokenBalancePerChainDelegate_template = {"container": statusDesktop_mainWindow_overlay, "objectName": "tokenBalancePerChainDelegate", "type": "TokenBalancePerChainDelegate", "visible": True}
|
||||
o_CollectibleNestedDelegate_template = {"container": statusDesktop_mainWindow_overlay, "type": "CollectibleNestedDelegate", "unnamed": 1, "visible": True}
|
||||
amountInput_TextEdit = {"container": statusDesktop_mainWindow_overlay, "objectName": "amountToSend_textField", "type": "StyledTextField", "visible": True}
|
||||
amountInput_TextEdit = {"container": statusDesktop_mainWindow_overlay, "objectName": "amountToSend_textField", "type": "StatusTextField", "visible": True}
|
||||
paste_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "type": "StatusButton", "unnamed": 1, "visible": True}
|
||||
ens_or_address_TextEdit = {"container": statusDesktop_mainWindow_overlay, "id": "edit", "type": "TextEdit", "unnamed": 1, "visible": True}
|
||||
accountSelectionTabBar_StatusTabBar = {"container": statusDesktop_mainWindow_overlay, "id": "accountSelectionTabBar", "type": "StatusTabBar", "unnamed": 1, "visible": True}
|
||||
|
|
|
@ -103,7 +103,7 @@ mainWindow_passwordView_PasswordConfirmationView = {"container": statusDesktop_m
|
|||
# Login View
|
||||
mainWindow_LoginView = {"container": statusDesktop_mainWindow, "type": "LoginView", "unnamed": 1, "visible": True}
|
||||
loginView_submitBtn = {"container": mainWindow_LoginView, "type": "StatusRoundButton", "visible": True}
|
||||
loginView_passwordInput = {"container": mainWindow_LoginView, "objectName": "loginPasswordInput", "type": "StyledTextField"}
|
||||
loginView_passwordInput = {"container": mainWindow_LoginView, "objectName": "loginPasswordInput", "type": "StatusTextField"}
|
||||
loginView_currentUserNameLabel = {"container": mainWindow_LoginView, "objectName": "currentUserNameLabel", "type": "StatusBaseText"}
|
||||
loginView_changeAccountBtn = {"container": mainWindow_LoginView, "objectName": "loginChangeAccountButton", "type": "StatusFlatRoundButton"}
|
||||
accountsView_accountListPanel = {"container": statusDesktop_mainWindow, "objectName": "LoginView_AccountsRepeater", "type": "Repeater", "visible": True}
|
||||
|
|
|
@ -164,7 +164,7 @@ signOutConfirmationButton = {"container": statusDesktop_mainWindow_overlay, "obj
|
|||
mainWindow_EnsWelcomeView = {"container": statusDesktop_mainWindow, "type": "EnsWelcomeView", "unnamed": 1, "visible": True}
|
||||
mainWindow_Start_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow, "objectName": "ensStartButton", "type": "StatusButton", "visible": True}
|
||||
mainWindow_EnsSearchView = {"container": statusDesktop_mainWindow, "type": "EnsSearchView", "unnamed": 1, "visible": True}
|
||||
mainWindow_ensUsernameInput_StyledTextField = {"container": statusDesktop_mainWindow, "objectName": "ensUsernameInput", "type": "StyledTextField", "visible": True}
|
||||
mainWindow_ensUsernameInput_StyledTextField = {"container": statusDesktop_mainWindow, "objectName": "ensUsernameInput", "type": "StatusTextField", "visible": True}
|
||||
mainWindow_ensNextButton_StatusRoundButton = {"container": statusDesktop_mainWindow, "objectName": "ensNextButton", "type": "StatusRoundButton", "visible": True}
|
||||
ens_StatusBaseText = {"container": mainWindow_EnsSearchView, "type": "StatusBaseText", "unnamed": 1, "visible": True}
|
||||
mainWindow_EnsTermsAndConditionsView = {"container": statusDesktop_mainWindow, "type": "EnsTermsAndConditionsView", "unnamed": 1, "visible": True}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from scripts.global_names import *
|
||||
|
||||
# Main:
|
||||
loginView_passwordInput = {"container": statusDesktop_mainWindow, "objectName": "loginPasswordInput", "type": "StyledTextField"}
|
||||
loginView_passwordInput = {"container": statusDesktop_mainWindow, "objectName": "loginPasswordInput", "type": "StatusTextField"}
|
||||
loginView_changeAccountBtn = {"container": statusDesktop_mainWindow, "objectName": "loginChangeAccountButton", "type": "StatusFlatRoundButton"}
|
||||
loginView_currentUserNameLabel = {"container": statusDesktop_mainWindow, "objectName": "currentUserNameLabel", "type": "StatusBaseText"}
|
||||
loginView_submitBtn = {"container": statusDesktop_mainWindow, "type": "StatusRoundButton", "visible": True}
|
||||
|
|
|
@ -41,12 +41,12 @@ LeftTabView_ScrollView = {"container": mainWindow_LeftTabView, "type": "StatusSc
|
|||
|
||||
# ENS view;
|
||||
settings_ENS_Start_Button = {"container": statusDesktop_mainWindow, "objectName": "ensStartButton", "type": "StatusButton"}
|
||||
settings_ENS_Search_Input = {"container": statusDesktop_mainWindow, "objectName": "ensUsernameInput", "type": "StyledTextField"}
|
||||
settings_ENS_Search_Input = {"container": statusDesktop_mainWindow, "objectName": "ensUsernameInput", "type": "StatusTextField"}
|
||||
settings_ENS_Search_Next_Button = {"container": statusDesktop_mainWindow, "objectName": "ensNextButton", "type": "StatusRoundButton"}
|
||||
settings_ENS_Terms_Agree = {"container": statusDesktop_mainWindow, "objectName": "ensAgreeTerms", "type": "StatusCheckBox"}
|
||||
settings_ENS_Terms_Open_Transaction = {"container": statusDesktop_mainWindow, "objectName": "ensStartTransaction", "type": "StatusButton"}
|
||||
settings_ENS_Terms_Transaction_Next_Button = {"container": statusDesktop_mainWindow, "objectName": "sendNextButton", "type": "StatusButton"}
|
||||
settings_ENS_Terms_Transaction_Password_Input = {"container": statusDesktop_mainWindow, "objectName": "transactionSignerPasswordInput", "type": "StyledTextField"}
|
||||
settings_ENS_Terms_Transaction_Password_Input = {"container": statusDesktop_mainWindow, "objectName": "transactionSignerPasswordInput", "type": "StatusTextField"}
|
||||
|
||||
# Side bar items (Secondary navigation):
|
||||
wallet_StatusNavigationListItem = {"container": mainWindow_ScrollView, "objectName": SettingsSubsection.WALLET.value, "type": "StatusNavigationListItem", "visible": True}
|
||||
|
|
|
@ -71,7 +71,7 @@ mainWallet_Send_Popup_Networks_List = {"container": statusDesktop_mainWindow, "o
|
|||
mainWallet_Send_Popup_Send_Button = {"container": statusDesktop_mainWindow, "objectName": "transactionModalFooterButton", "type": "StatusButton"}
|
||||
mainWallet_Send_Popup_Asset_Selector = {"container": statusDesktop_mainWindow, "objectName": "assetSelectorButton", "type": "StatusComboBox"}
|
||||
mainWallet_Send_Popup_Asset_List = {"container": statusDesktop_mainWindow, "objectName": "assetSelectorList", "type": "StatusListView"}
|
||||
mainWallet_Send_Popup_GasPrice_Input = {"container": statusDesktop_mainWindow, "objectName": "gasPriceSelectorInput", "type": "StyledTextField"}
|
||||
mainWallet_Send_Popup_GasPrice_Input = {"container": statusDesktop_mainWindow, "objectName": "gasPriceSelectorInput", "type": "StatusTextField"}
|
||||
|
||||
# Add/Edit account popup:
|
||||
grid_Grid = {"container": statusDesktop_mainWindow_overlay, "id": "grid", "type": "Grid", "unnamed": 1, "visible": True}
|
||||
|
|
|
@ -105,7 +105,7 @@ editPermissionView_Is_allowed_to_StatusFlowSelector = {"container": mainWindow_e
|
|||
editPermissionView_In_StatusItemSelector = {"container": mainWindow_editPermissionView_EditPermissionView_2, "id": "inSelector", "type": "StatusItemSelector", "unnamed": 1, "visible": True}
|
||||
editPermissionView_whoHoldsSwitch_StatusSwitch = {"checkable": True, "container": mainWindow_editPermissionView_EditPermissionView, "id": "whoHoldsSwitch", "type": "StatusSwitch", "unnamed": 1, "visible": True}
|
||||
edit_TextEdit = {"container": statusDesktop_mainWindow_overlay, "type": "TextEdit", "unnamed": 1, "visible": True}
|
||||
inputValue_StyledTextField = {"container": statusDesktop_mainWindow_overlay, "echoMode": 0, "id": "inputValue", "type": "StyledTextField", "unnamed": 1, "visible": True}
|
||||
inputValue_StyledTextField = {"container": statusDesktop_mainWindow_overlay, "echoMode": 0, "id": "inputValue", "type": "StatusTextField", "unnamed": 1, "visible": True}
|
||||
o_TokenItem = {"container": statusDesktop_mainWindow_overlay, "index": 0, "type": "TokenItem", "unnamed": 1, "visible": True}
|
||||
add_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "type": "StatusButton", "unnamed": 1, "visible": True}
|
||||
CustomPermissionListItem = {"container": statusDesktop_mainWindow_overlay, "objectName": "becomeAdmin", "type": "CustomPermissionListItem", "visible": True}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import QtQuick 2.14
|
||||
import QtQuick.Layouts 1.12
|
||||
import QtQuick.Controls 2.14
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Core.Theme 0.1
|
||||
|
@ -9,7 +9,7 @@ import StatusQ.Components 0.1
|
|||
|
||||
/*!
|
||||
\qmltype StatusPasswordInput
|
||||
\inherits Item
|
||||
\inherits StatusTextField
|
||||
\inqmlmodule StatusQ.Controls
|
||||
\since StatusQ.Controls 0.1
|
||||
\brief The StatusPasswordInput control provides a generic user password input with an option to display signing phrase
|
||||
|
@ -26,7 +26,7 @@ import StatusQ.Components 0.1
|
|||
For a list of available components see StatusQ.
|
||||
*/
|
||||
|
||||
TextField {
|
||||
StatusTextField {
|
||||
id: root
|
||||
|
||||
/*!
|
||||
|
@ -39,7 +39,6 @@ TextField {
|
|||
id: d
|
||||
|
||||
readonly property int inputTextPadding: 16
|
||||
readonly property int pixelSize: 15
|
||||
readonly property int radius: 8
|
||||
readonly property int signingPhrasePadding: 8
|
||||
readonly property int signingPhraseWordPadding: 8
|
||||
|
@ -57,30 +56,14 @@ TextField {
|
|||
implicitHeight: 44
|
||||
selectByMouse: true
|
||||
|
||||
placeholderTextColor: Theme.palette.baseColor1
|
||||
echoMode: TextInput.Password
|
||||
font.pixelSize: d.pixelSize
|
||||
font.family: Theme.palette.baseFont.name
|
||||
color: Theme.palette.directColor1
|
||||
selectionColor: Theme.palette.primaryColor2
|
||||
selectedTextColor: Theme.palette.directColor1
|
||||
|
||||
background: Rectangle {
|
||||
id: inputRectangle
|
||||
anchors.fill: parent
|
||||
color: Theme.palette.baseColor2
|
||||
radius: d.radius
|
||||
border.width: root.focus ? 1 : 0
|
||||
border.color: {
|
||||
if (root.focus) {
|
||||
return Theme.palette.primaryColor1
|
||||
}
|
||||
return "transparent"
|
||||
}
|
||||
}
|
||||
|
||||
cursorDelegate: StatusCursorDelegate {
|
||||
cursorVisible: root.cursorVisible
|
||||
border.color: Theme.palette.primaryColor1
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
import StatusQ.Components 0.1
|
||||
import StatusQ.Core.Theme 0.1
|
||||
|
||||
TextField {
|
||||
id: root
|
||||
|
||||
font.family: Theme.palette.baseFont.name
|
||||
font.pixelSize: Theme.primaryTextFontSize
|
||||
color: readOnly ? Theme.palette.baseColor1 : Theme.palette.directColor1
|
||||
selectByMouse: true
|
||||
selectedTextColor: Theme.palette.directColor1
|
||||
selectionColor: Theme.palette.primaryColor2
|
||||
placeholderTextColor: Theme.palette.baseColor1
|
||||
|
||||
opacity: enabled ? 1 : 0.3
|
||||
|
||||
cursorDelegate: StatusCursorDelegate {
|
||||
cursorVisible: root.cursorVisible
|
||||
}
|
||||
}
|
|
@ -53,6 +53,7 @@ StatusScrollBar 0.1 StatusScrollBar.qml
|
|||
StatusComboBox 0.1 StatusComboBox.qml
|
||||
StatusItemDelegate 0.1 StatusItemDelegate.qml
|
||||
StatusTextArea 0.1 StatusTextArea.qml
|
||||
StatusTextField 0.1 StatusTextField.qml
|
||||
StatusBackButton 0.1 StatusBackButton.qml
|
||||
StatusPasswordInput 0.1 StatusPasswordInput.qml
|
||||
StatusTextWithLoadingState 0.1 StatusTextWithLoadingState.qml
|
||||
|
|
|
@ -146,6 +146,7 @@
|
|||
<file>StatusQ/Controls/StatusTabButton.qml</file>
|
||||
<file>StatusQ/Controls/StatusTagItem.qml</file>
|
||||
<file>StatusQ/Controls/StatusTextArea.qml</file>
|
||||
<file>StatusQ/Controls/StatusTextField.qml</file>
|
||||
<file>StatusQ/Controls/StatusTextWithLoadingState.qml</file>
|
||||
<file>StatusQ/Controls/StatusTokenInlineSelector.qml</file>
|
||||
<file>StatusQ/Controls/StatusToolTip.qml</file>
|
||||
|
|
|
@ -72,15 +72,14 @@ StatusSectionLayout {
|
|||
font.weight: Font.Medium
|
||||
font.pixelSize: 20
|
||||
}
|
||||
// TODO: replace with StatusTextArea once it lives in StatusQ.
|
||||
StyledTextArea {
|
||||
StatusTextArea {
|
||||
id: mailserverLogTxt
|
||||
Layout.rightMargin: Style.current.padding
|
||||
Layout.leftMargin: Style.current.padding
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 200
|
||||
text: ""
|
||||
customHeight: 200
|
||||
textField.readOnly: true
|
||||
readOnly: true
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -97,15 +96,14 @@ StatusSectionLayout {
|
|||
font.weight: Font.Medium
|
||||
font.pixelSize: 20
|
||||
}
|
||||
// TODO: replace with StatusTextArea once it lives in StatusQ.
|
||||
StyledTextArea {
|
||||
StatusTextArea {
|
||||
id: logsTxt
|
||||
Layout.rightMargin: Style.current.padding
|
||||
Layout.leftMargin: Style.current.padding
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 200
|
||||
text: ""
|
||||
customHeight: 200
|
||||
textField.readOnly: true
|
||||
readOnly: true
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -201,13 +199,12 @@ StatusSectionLayout {
|
|||
}
|
||||
}
|
||||
|
||||
StyledTextField {
|
||||
StatusTextField {
|
||||
id: txtData
|
||||
text: ""
|
||||
leftPadding: 0
|
||||
padding: 0
|
||||
font.pixelSize: 14
|
||||
selectByMouse: true
|
||||
placeholderText: qsTr("Type json-rpc message... e.g {\"method\": \"eth_accounts\"}")
|
||||
anchors.right: rpcSendBtn.left
|
||||
anchors.rightMargin: 16
|
||||
|
@ -215,11 +212,7 @@ StatusSectionLayout {
|
|||
anchors.topMargin: 24
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 24
|
||||
Keys.onEnterPressed: {
|
||||
root.store.onSend(txtData.text)
|
||||
txtData.text = ""
|
||||
}
|
||||
Keys.onReturnPressed: {
|
||||
onAccepted: {
|
||||
root.store.onSend(txtData.text)
|
||||
txtData.text = ""
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ import utils 1.0
|
|||
|
||||
/*!
|
||||
\qmltype CurrencyAmountInput
|
||||
\inherits TextField
|
||||
\inherits StatusTextField
|
||||
\brief Provides a text input field that accepts a numeric value, with optional (currency) symbol (defaults to "USD").
|
||||
Utilizes a builtin DoubleValidator to validate the user's input.
|
||||
It accepts both the native decimal separator and optionally a period (`.`) for locales that don't use this.
|
||||
|
@ -19,7 +19,7 @@ import utils 1.0
|
|||
|
||||
Internally it uses FormattedDoubleProperty object that keeps track of the value.
|
||||
*/
|
||||
TextField {
|
||||
StatusTextField {
|
||||
id: root
|
||||
|
||||
property alias value: internalProp.value // accepts double/float or string representation, rejects NaN
|
||||
|
@ -62,9 +62,6 @@ TextField {
|
|||
Component.onCompleted: text = internalProp.asLocaleString(decimals)
|
||||
onTextEdited: value = text
|
||||
|
||||
font.family: Style.current.baseFont.name
|
||||
font.pixelSize: Style.current.primaryTextFontSize
|
||||
|
||||
leftPadding: Style.current.padding
|
||||
rightPadding: currencySymbol !== "" ?
|
||||
currencySymbolText.width + currencySymbolText.anchors.leftMargin + currencySymbolText.anchors.rightMargin :
|
||||
|
@ -72,14 +69,7 @@ TextField {
|
|||
topPadding: 10
|
||||
bottomPadding: 10
|
||||
|
||||
opacity: enabled ? 1 : 0.3
|
||||
color: readOnly ? Theme.palette.baseColor1 : Theme.palette.directColor1
|
||||
selectionColor: Theme.palette.primaryColor2
|
||||
selectedTextColor: Theme.palette.directColor1
|
||||
placeholderTextColor: Theme.palette.baseColor1
|
||||
|
||||
hoverEnabled: !readOnly
|
||||
selectByMouse: true
|
||||
inputMethodHints: Qt.ImhFormattedNumbersOnly
|
||||
|
||||
validator: DoubleValidator {
|
||||
|
@ -106,10 +96,6 @@ TextField {
|
|||
Behavior on border.color { ColorAnimation {} }
|
||||
}
|
||||
|
||||
cursorDelegate: StatusCursorDelegate {
|
||||
cursorVisible: root.cursorVisible
|
||||
}
|
||||
|
||||
StatusBaseText {
|
||||
id: currencySymbolText
|
||||
anchors.right: parent.right
|
||||
|
|
|
@ -79,7 +79,7 @@ Item {
|
|||
height: customHeight
|
||||
anchors.top: inputBox.hasLabel ? inputLabel.bottom : parent.top
|
||||
anchors.topMargin: inputBox.hasLabel ? inputBox.labelMargin : 0
|
||||
StyledTextField {
|
||||
StatusTextField {
|
||||
id: inputValue
|
||||
visible: !inputBox.isTextArea && !inputBox.isSelect
|
||||
placeholderText: inputBox.placeholderText
|
||||
|
@ -88,7 +88,6 @@ Item {
|
|||
anchors.right: clipboardButtonLoader.active ? clipboardButtonLoader.left : parent.right
|
||||
anchors.rightMargin: clipboardButtonLoader.active ? Style.current.padding : 0
|
||||
leftPadding: inputBox.hasIcon ? iconWidth + 20 : Style.current.padding
|
||||
selectByMouse: true
|
||||
font.pixelSize: fontPixelSize
|
||||
readOnly: inputBox.readOnly
|
||||
background: Rectangle {
|
||||
|
@ -159,7 +158,7 @@ Item {
|
|||
if (inputBox.copyToClipboard) {
|
||||
ClipboardUtils.setText(inputBox.textToCopy ? inputBox.textToCopy : inputValue.text)
|
||||
} else {
|
||||
inputValue.paste()
|
||||
inputValue.paste()
|
||||
}
|
||||
|
||||
copyBtn.copied = true
|
||||
|
@ -188,9 +187,3 @@ Item {
|
|||
wrapMode: TextEdit.Wrap
|
||||
}
|
||||
}
|
||||
|
||||
/*##^##
|
||||
Designer {
|
||||
D{i:0;formeditorColor:"#c0c0c0";formeditorZoom:1.25}
|
||||
}
|
||||
##^##*/
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.13
|
||||
import QtQml 2.14
|
||||
|
||||
import utils 1.0
|
||||
import "../"
|
||||
import "../panels"
|
||||
|
||||
Button {
|
||||
property string label: "My button"
|
||||
property color btnColor: Style.current.secondaryBackground
|
||||
property color btnBorderColor: "transparent"
|
||||
property int btnBorderWidth: 0
|
||||
property color textColor: Style.current.blue
|
||||
property int textSize: 15
|
||||
property bool disabled: false
|
||||
|
||||
id: btnStyled
|
||||
width: txtBtnLabel.width + 2 * Style.current.padding
|
||||
height: 44
|
||||
enabled: !disabled
|
||||
|
||||
background: Rectangle {
|
||||
color: disabled ? Style.current.grey :
|
||||
hovered ? Qt.darker(btnStyled.btnColor, 1.1) : btnStyled.btnColor
|
||||
radius: Style.current.radius
|
||||
anchors.fill: parent
|
||||
border.color: btnBorderColor
|
||||
border.width: btnBorderWidth
|
||||
}
|
||||
|
||||
StyledText {
|
||||
id: txtBtnLabel
|
||||
color: btnStyled.disabled ? Style.current.darkGrey : btnStyled.textColor
|
||||
font.pixelSize: btnStyled.textSize
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: btnStyled.label
|
||||
font.weight: Font.Medium
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
parent.onClicked()
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.3
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtGraphicalEffects 1.12
|
||||
|
||||
import utils 1.0
|
||||
import "../panels"
|
||||
|
||||
Item {
|
||||
property alias textField: textArea
|
||||
property string placeholderText: "My placeholder"
|
||||
property alias text: textArea.text
|
||||
property string validationError: ""
|
||||
property string label: ""
|
||||
readonly property bool hasLabel: label !== ""
|
||||
property color bgColor: Style.current.inputBackground
|
||||
readonly property var forceActiveFocus: function () {
|
||||
textArea.forceActiveFocus(Qt.MouseFocusReason)
|
||||
}
|
||||
readonly property int labelMargin: 7
|
||||
property int customHeight: 44
|
||||
property bool hideRectangle: false
|
||||
signal keyPressed(var event)
|
||||
|
||||
id: inputBox
|
||||
height: inputRectangle.height + (hasLabel ? inputLabel.height + labelMargin : 0) + (!!validationError ? validationErrorText.height : 0)
|
||||
|
||||
StyledText {
|
||||
id: inputLabel
|
||||
text: inputBox.label
|
||||
font.weight: Font.Medium
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 0
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 0
|
||||
font.pixelSize: 13
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: inputRectangle
|
||||
height: customHeight
|
||||
color: hideRectangle ? Style.current.transparent : bgColor
|
||||
radius: Style.current.radius
|
||||
anchors.top: inputBox.hasLabel ? inputLabel.bottom : parent.top
|
||||
anchors.topMargin: inputBox.hasLabel ? inputBox.labelMargin : 0
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
border.width: !!validationError && !hideRectangle ? 1 : 0
|
||||
border.color: Style.current.red
|
||||
|
||||
TextArea {
|
||||
id: textArea
|
||||
text: ""
|
||||
font.pixelSize: 15
|
||||
selectByMouse: true
|
||||
wrapMode: Text.WrapAnywhere
|
||||
placeholderText: inputBox.placeholderText
|
||||
anchors.rightMargin: Style.current.smallPadding
|
||||
anchors.leftMargin: inputBox.hasIcon ? 36 : Style.current.smallPadding
|
||||
anchors.bottomMargin: Style.current.smallPadding
|
||||
anchors.topMargin: Style.current.smallPadding
|
||||
anchors.fill: parent
|
||||
font.family: Style.current.baseFont.name
|
||||
color: Style.current.textColor
|
||||
placeholderTextColor: Style.current.secondaryText
|
||||
selectionColor: Style.current.primarySelectionColor
|
||||
|
||||
Keys.onPressed: inputBox.keyPressed(event)
|
||||
}
|
||||
}
|
||||
|
||||
TextEdit {
|
||||
visible: !!validationError
|
||||
id: validationErrorText
|
||||
text: validationError
|
||||
anchors.top: inputRectangle.bottom
|
||||
anchors.topMargin: 1
|
||||
selectByMouse: true
|
||||
readOnly: true
|
||||
font.pixelSize: 12
|
||||
color: Style.current.red
|
||||
selectedTextColor: Style.current.textColor
|
||||
selectionColor: Style.current.primarySelectionColor
|
||||
}
|
||||
}
|
||||
|
||||
/*##^##
|
||||
Designer {
|
||||
D{i:0;formeditorColor:"#ffffff";formeditorZoom:1.25}
|
||||
}
|
||||
##^##*/
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.13
|
||||
|
||||
import utils 1.0
|
||||
|
||||
import StatusQ.Components 0.1
|
||||
|
||||
TextField {
|
||||
id: root
|
||||
|
||||
font.family: Style.current.baseFont.name
|
||||
color: readOnly ? Style.current.secondaryText : Style.current.textColor
|
||||
selectByMouse: !readOnly
|
||||
selectedTextColor: Style.current.textColor
|
||||
selectionColor: Style.current.primarySelectionColor
|
||||
|
||||
cursorDelegate: StatusCursorDelegate {
|
||||
cursorVisible: root.cursorVisible
|
||||
}
|
||||
}
|
|
@ -1,60 +0,0 @@
|
|||
import QtQuick 2.3
|
||||
import shared.controls 1.0
|
||||
import shared 1.0
|
||||
import shared.panels 1.0
|
||||
|
||||
import utils 1.0
|
||||
|
||||
Item {
|
||||
id: root
|
||||
property bool isHovered: false
|
||||
height: childrenRect.height
|
||||
width: chatName.width + (ensOrAlias.visible ? ensOrAlias.width + ensOrAlias.anchors.leftMargin : 0)
|
||||
property alias label: chatName
|
||||
|
||||
property string displayName
|
||||
property string localName
|
||||
property bool amISender
|
||||
property bool disabled
|
||||
|
||||
signal clickMessage(bool isProfileClick)
|
||||
|
||||
StyledTextEdit {
|
||||
id: chatName
|
||||
text: root.amISender ? qsTr("You") : displayName
|
||||
color: text.startsWith("@") || root.amISender || localName !== "" ? Style.current.blue : Style.current.secondaryText
|
||||
font.weight: Font.Medium
|
||||
font.pixelSize: Style.current.secondaryTextFontSize
|
||||
font.underline: root.isHovered && !root.disabled
|
||||
readOnly: true
|
||||
wrapMode: Text.WordWrap
|
||||
selectByMouse: true
|
||||
MouseArea {
|
||||
cursorShape: hoverEnabled ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
anchors.fill: parent
|
||||
hoverEnabled: !root.disabled
|
||||
onEntered: {
|
||||
root.isHovered = true
|
||||
}
|
||||
onExited: {
|
||||
root.isHovered = false
|
||||
}
|
||||
onClicked: {
|
||||
if (!root.disabled) {
|
||||
root.clickMessage(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
id: ensOrAlias
|
||||
visible: localName !== "" && displayName.startsWith("@")
|
||||
text: displayName
|
||||
color: Style.current.secondaryText
|
||||
font.pixelSize: chatName.font.pixelSize
|
||||
anchors.left: chatName.right
|
||||
anchors.leftMargin: chatName.visible ? 4 : 0
|
||||
}
|
||||
}
|
|
@ -19,5 +19,4 @@ SendTransactionButton 1.0 SendTransactionButton.qml
|
|||
SentMessage 1.0 SentMessage.qml
|
||||
StateBubble 1.0 StateBubble.qml
|
||||
UserImage 1.0 UserImage.qml
|
||||
UsernameLabel 1.0 UsernameLabel.qml
|
||||
VerificationLabel 1.0 VerificationLabel.qml
|
||||
|
|
|
@ -38,11 +38,8 @@ SocialLinkPreview 1.0 SocialLinkPreview.qml
|
|||
StatusSyncCodeInput 1.0 StatusSyncCodeInput.qml
|
||||
StatusSyncCodeScan 1.0 StatusSyncCodeScan.qml
|
||||
StatusSyncingInstructions 1.0 StatusSyncingInstructions.qml
|
||||
StyledButton 1.0 StyledButton.qml
|
||||
StyledTextArea 1.0 StyledTextArea.qml
|
||||
StyledTextEdit 1.0 StyledTextEdit.qml
|
||||
StyledTextEditWithLoadingState 1.0 StyledTextEditWithLoadingState.qml
|
||||
StyledTextField 1.0 StyledTextField.qml
|
||||
Timer 1.0 Timer.qml
|
||||
TokenDelegate 1.0 TokenDelegate.qml
|
||||
TransactionAddress 1.0 TransactionAddress.qml
|
||||
|
|
|
@ -6,6 +6,7 @@ import StatusQ.Core 0.1
|
|||
import StatusQ.Core.Theme 0.1
|
||||
import StatusQ.Core.Utils 0.1 as SQUtils
|
||||
import StatusQ.Components 0.1
|
||||
import StatusQ.Controls 0.1
|
||||
import StatusQ.Validators 0.1
|
||||
|
||||
import utils 1.0
|
||||
|
@ -172,7 +173,7 @@ Control {
|
|||
}
|
||||
|
||||
RowLayout {
|
||||
StyledTextField {
|
||||
StatusTextField {
|
||||
id: textField
|
||||
|
||||
objectName: "amountToSend_textField"
|
||||
|
|
|
@ -1,118 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.13
|
||||
import QtQuick.Layouts 1.13
|
||||
|
||||
import StatusQ.Controls 0.1 as StatusQ
|
||||
import utils 1.0
|
||||
|
||||
import "../status"
|
||||
import "../panels"
|
||||
import "../controls"
|
||||
|
||||
import StatusQ.Controls 0.1 as StatusQControls
|
||||
|
||||
Item {
|
||||
id: root
|
||||
height: signingPhraseItem.height + signingPhrase.height + txtPassword.height + Style.current.smallPadding + Style.current.bigPadding
|
||||
|
||||
property alias signingPhrase: signingPhrase.text
|
||||
property string enteredPassword
|
||||
property alias validationError: txtPassword.validationError
|
||||
property string noInputErrorMessage: qsTr("You need to enter a password")
|
||||
property string invalidInputErrorMessage: qsTr("Password needs to be 6 characters or more")
|
||||
property bool isValid: false
|
||||
|
||||
function forceActiveFocus(reason) {
|
||||
txtPassword.forceActiveFocus(reason)
|
||||
}
|
||||
|
||||
function validate() {
|
||||
txtPassword.validationError = ""
|
||||
const noInput = txtPassword.text === ""
|
||||
if (noInput) {
|
||||
txtPassword.validationError = noInputErrorMessage
|
||||
} else if (txtPassword.text.length < 6) {
|
||||
txtPassword.validationError = invalidInputErrorMessage
|
||||
}
|
||||
isValid = txtPassword.validationError === ""
|
||||
return isValid
|
||||
}
|
||||
|
||||
Item {
|
||||
id: signingPhraseItem
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
height: labelSigningPhrase.height
|
||||
width: labelSigningPhrase.width + infoButton.width + infoButton.anchors.leftMargin
|
||||
|
||||
StyledText {
|
||||
id: labelSigningPhrase
|
||||
color: Style.current.secondaryText
|
||||
font.pixelSize: 15
|
||||
text: qsTr("Signing phrase")
|
||||
}
|
||||
|
||||
StatusQControls.StatusRoundButton {
|
||||
id: infoButton
|
||||
anchors.left: labelSigningPhrase.right
|
||||
anchors.leftMargin: 7
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: 13
|
||||
height: 13
|
||||
icon.width: width
|
||||
icon.height: height
|
||||
icon.name: "info"
|
||||
StatusQ.StatusToolTip {
|
||||
visible: infoButton.hovered
|
||||
text: qsTr("Signing phrase is a 3 word combination that displayed when you entered the wallet on this device for the first time.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
id: signingPhrase
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.top: signingPhraseItem.bottom
|
||||
anchors.topMargin: Style.current.smallPadding
|
||||
font.pixelSize: 15
|
||||
text: root.signingPhrase
|
||||
}
|
||||
|
||||
StatusQControls.StatusRoundButton {
|
||||
id: passwordInfoButton
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 67
|
||||
anchors.top: txtPassword.top
|
||||
anchors.topMargin: 2
|
||||
width: 13
|
||||
height: 13
|
||||
icon.width: width
|
||||
icon.height: height
|
||||
icon.name: "info"
|
||||
StatusQ.StatusToolTip {
|
||||
visible: passwordInfoButton.hovered
|
||||
text: qsTr("Enter the password you use to unlock this device")
|
||||
}
|
||||
}
|
||||
|
||||
Input {
|
||||
id: txtPassword
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: signingPhrase.bottom
|
||||
anchors.topMargin: Style.current.bigPadding
|
||||
textField.objectName: "transactionSignerPasswordInput"
|
||||
focus: true
|
||||
customHeight: 56
|
||||
label: qsTr("Password")
|
||||
placeholderText: qsTr("Enter password")
|
||||
textField.echoMode: TextInput.Password
|
||||
validationErrorAlignment: TextEdit.AlignRight
|
||||
validationErrorTopMargin: 8
|
||||
onTextChanged: {
|
||||
if(root.validate()) {
|
||||
root.enteredPassword = this.text
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -17,4 +17,3 @@ SyncingDeviceView 1.0 SyncingDeviceView.qml
|
|||
SyncingDisplayCode 1.0 SyncingDisplayCode.qml
|
||||
SyncingEnterCode 1.0 SyncingEnterCode.qml
|
||||
SyncingErrorMessage 1.0 SyncingErrorMessage.qml
|
||||
TransactionSigner 1.0 TransactionSigner.qml
|
||||
|
|
Loading…
Reference in New Issue