[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:
Lukáš Tinkl 2024-09-11 13:49:20 +02:00 committed by Lukáš Tinkl
parent 69605f5965
commit 0c6a602336
24 changed files with 54 additions and 417 deletions

View File

@ -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_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} 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} 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} 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_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} add_update_statusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "id": "addOrUpdateButton", "type": "StatusButton", "unnamed": 1, "visible": True}

View File

@ -507,7 +507,7 @@ o_StatusTabBar = {"container": statusDesktop_mainWindow_overlay, "type": "Status
tab_Status_template = {"container": o_StatusTabBar, "type": "StatusBaseText", "unnamed": 1, "visible": True} 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_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} 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} 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} 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} accountSelectionTabBar_StatusTabBar = {"container": statusDesktop_mainWindow_overlay, "id": "accountSelectionTabBar", "type": "StatusTabBar", "unnamed": 1, "visible": True}

View File

@ -103,7 +103,7 @@ mainWindow_passwordView_PasswordConfirmationView = {"container": statusDesktop_m
# Login View # Login View
mainWindow_LoginView = {"container": statusDesktop_mainWindow, "type": "LoginView", "unnamed": 1, "visible": True} mainWindow_LoginView = {"container": statusDesktop_mainWindow, "type": "LoginView", "unnamed": 1, "visible": True}
loginView_submitBtn = {"container": mainWindow_LoginView, "type": "StatusRoundButton", "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_currentUserNameLabel = {"container": mainWindow_LoginView, "objectName": "currentUserNameLabel", "type": "StatusBaseText"}
loginView_changeAccountBtn = {"container": mainWindow_LoginView, "objectName": "loginChangeAccountButton", "type": "StatusFlatRoundButton"} loginView_changeAccountBtn = {"container": mainWindow_LoginView, "objectName": "loginChangeAccountButton", "type": "StatusFlatRoundButton"}
accountsView_accountListPanel = {"container": statusDesktop_mainWindow, "objectName": "LoginView_AccountsRepeater", "type": "Repeater", "visible": True} accountsView_accountListPanel = {"container": statusDesktop_mainWindow, "objectName": "LoginView_AccountsRepeater", "type": "Repeater", "visible": True}

View File

@ -164,7 +164,7 @@ signOutConfirmationButton = {"container": statusDesktop_mainWindow_overlay, "obj
mainWindow_EnsWelcomeView = {"container": statusDesktop_mainWindow, "type": "EnsWelcomeView", "unnamed": 1, "visible": True} 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_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_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} mainWindow_ensNextButton_StatusRoundButton = {"container": statusDesktop_mainWindow, "objectName": "ensNextButton", "type": "StatusRoundButton", "visible": True}
ens_StatusBaseText = {"container": mainWindow_EnsSearchView, "type": "StatusBaseText", "unnamed": 1, "visible": True} ens_StatusBaseText = {"container": mainWindow_EnsSearchView, "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_EnsTermsAndConditionsView = {"container": statusDesktop_mainWindow, "type": "EnsTermsAndConditionsView", "unnamed": 1, "visible": True} mainWindow_EnsTermsAndConditionsView = {"container": statusDesktop_mainWindow, "type": "EnsTermsAndConditionsView", "unnamed": 1, "visible": True}

View File

@ -1,7 +1,7 @@
from scripts.global_names import * from scripts.global_names import *
# Main: # 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_changeAccountBtn = {"container": statusDesktop_mainWindow, "objectName": "loginChangeAccountButton", "type": "StatusFlatRoundButton"}
loginView_currentUserNameLabel = {"container": statusDesktop_mainWindow, "objectName": "currentUserNameLabel", "type": "StatusBaseText"} loginView_currentUserNameLabel = {"container": statusDesktop_mainWindow, "objectName": "currentUserNameLabel", "type": "StatusBaseText"}
loginView_submitBtn = {"container": statusDesktop_mainWindow, "type": "StatusRoundButton", "visible": True} loginView_submitBtn = {"container": statusDesktop_mainWindow, "type": "StatusRoundButton", "visible": True}

View File

@ -41,12 +41,12 @@ LeftTabView_ScrollView = {"container": mainWindow_LeftTabView, "type": "StatusSc
# ENS view; # ENS view;
settings_ENS_Start_Button = {"container": statusDesktop_mainWindow, "objectName": "ensStartButton", "type": "StatusButton"} 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_Search_Next_Button = {"container": statusDesktop_mainWindow, "objectName": "ensNextButton", "type": "StatusRoundButton"}
settings_ENS_Terms_Agree = {"container": statusDesktop_mainWindow, "objectName": "ensAgreeTerms", "type": "StatusCheckBox"} 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_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_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): # Side bar items (Secondary navigation):
wallet_StatusNavigationListItem = {"container": mainWindow_ScrollView, "objectName": SettingsSubsection.WALLET.value, "type": "StatusNavigationListItem", "visible": True} wallet_StatusNavigationListItem = {"container": mainWindow_ScrollView, "objectName": SettingsSubsection.WALLET.value, "type": "StatusNavigationListItem", "visible": True}

View File

@ -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_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_Selector = {"container": statusDesktop_mainWindow, "objectName": "assetSelectorButton", "type": "StatusComboBox"}
mainWallet_Send_Popup_Asset_List = {"container": statusDesktop_mainWindow, "objectName": "assetSelectorList", "type": "StatusListView"} 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: # Add/Edit account popup:
grid_Grid = {"container": statusDesktop_mainWindow_overlay, "id": "grid", "type": "Grid", "unnamed": 1, "visible": True} grid_Grid = {"container": statusDesktop_mainWindow_overlay, "id": "grid", "type": "Grid", "unnamed": 1, "visible": True}

View File

@ -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_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} 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} 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} 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} 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} CustomPermissionListItem = {"container": statusDesktop_mainWindow_overlay, "objectName": "becomeAdmin", "type": "CustomPermissionListItem", "visible": True}

View File

@ -1,6 +1,6 @@
import QtQuick 2.14 import QtQuick 2.15
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.15
import QtQuick.Controls 2.14 import QtQuick.Controls 2.15
import StatusQ.Core 0.1 import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1 import StatusQ.Core.Theme 0.1
@ -9,7 +9,7 @@ import StatusQ.Components 0.1
/*! /*!
\qmltype StatusPasswordInput \qmltype StatusPasswordInput
\inherits Item \inherits StatusTextField
\inqmlmodule StatusQ.Controls \inqmlmodule StatusQ.Controls
\since StatusQ.Controls 0.1 \since StatusQ.Controls 0.1
\brief The StatusPasswordInput control provides a generic user password input with an option to display signing phrase \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. For a list of available components see StatusQ.
*/ */
TextField { StatusTextField {
id: root id: root
/*! /*!
@ -39,7 +39,6 @@ TextField {
id: d id: d
readonly property int inputTextPadding: 16 readonly property int inputTextPadding: 16
readonly property int pixelSize: 15
readonly property int radius: 8 readonly property int radius: 8
readonly property int signingPhrasePadding: 8 readonly property int signingPhrasePadding: 8
readonly property int signingPhraseWordPadding: 8 readonly property int signingPhraseWordPadding: 8
@ -57,30 +56,14 @@ TextField {
implicitHeight: 44 implicitHeight: 44
selectByMouse: true selectByMouse: true
placeholderTextColor: Theme.palette.baseColor1
echoMode: TextInput.Password echoMode: TextInput.Password
font.pixelSize: d.pixelSize
font.family: Theme.palette.baseFont.name
color: Theme.palette.directColor1 color: Theme.palette.directColor1
selectionColor: Theme.palette.primaryColor2
selectedTextColor: Theme.palette.directColor1
background: Rectangle { background: Rectangle {
id: inputRectangle
anchors.fill: parent
color: Theme.palette.baseColor2 color: Theme.palette.baseColor2
radius: d.radius radius: d.radius
border.width: root.focus ? 1 : 0 border.width: root.focus ? 1 : 0
border.color: { border.color: Theme.palette.primaryColor1
if (root.focus) {
return Theme.palette.primaryColor1
}
return "transparent"
}
}
cursorDelegate: StatusCursorDelegate {
cursorVisible: root.cursorVisible
} }
RowLayout { RowLayout {

View File

@ -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
}
}

View File

@ -53,6 +53,7 @@ StatusScrollBar 0.1 StatusScrollBar.qml
StatusComboBox 0.1 StatusComboBox.qml StatusComboBox 0.1 StatusComboBox.qml
StatusItemDelegate 0.1 StatusItemDelegate.qml StatusItemDelegate 0.1 StatusItemDelegate.qml
StatusTextArea 0.1 StatusTextArea.qml StatusTextArea 0.1 StatusTextArea.qml
StatusTextField 0.1 StatusTextField.qml
StatusBackButton 0.1 StatusBackButton.qml StatusBackButton 0.1 StatusBackButton.qml
StatusPasswordInput 0.1 StatusPasswordInput.qml StatusPasswordInput 0.1 StatusPasswordInput.qml
StatusTextWithLoadingState 0.1 StatusTextWithLoadingState.qml StatusTextWithLoadingState 0.1 StatusTextWithLoadingState.qml

View File

@ -146,6 +146,7 @@
<file>StatusQ/Controls/StatusTabButton.qml</file> <file>StatusQ/Controls/StatusTabButton.qml</file>
<file>StatusQ/Controls/StatusTagItem.qml</file> <file>StatusQ/Controls/StatusTagItem.qml</file>
<file>StatusQ/Controls/StatusTextArea.qml</file> <file>StatusQ/Controls/StatusTextArea.qml</file>
<file>StatusQ/Controls/StatusTextField.qml</file>
<file>StatusQ/Controls/StatusTextWithLoadingState.qml</file> <file>StatusQ/Controls/StatusTextWithLoadingState.qml</file>
<file>StatusQ/Controls/StatusTokenInlineSelector.qml</file> <file>StatusQ/Controls/StatusTokenInlineSelector.qml</file>
<file>StatusQ/Controls/StatusToolTip.qml</file> <file>StatusQ/Controls/StatusToolTip.qml</file>

View File

@ -72,15 +72,14 @@ StatusSectionLayout {
font.weight: Font.Medium font.weight: Font.Medium
font.pixelSize: 20 font.pixelSize: 20
} }
// TODO: replace with StatusTextArea once it lives in StatusQ. StatusTextArea {
StyledTextArea {
id: mailserverLogTxt id: mailserverLogTxt
Layout.rightMargin: Style.current.padding Layout.rightMargin: Style.current.padding
Layout.leftMargin: Style.current.padding Layout.leftMargin: Style.current.padding
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 200
text: "" text: ""
customHeight: 200 readOnly: true
textField.readOnly: true
} }
} }
@ -97,15 +96,14 @@ StatusSectionLayout {
font.weight: Font.Medium font.weight: Font.Medium
font.pixelSize: 20 font.pixelSize: 20
} }
// TODO: replace with StatusTextArea once it lives in StatusQ. StatusTextArea {
StyledTextArea {
id: logsTxt id: logsTxt
Layout.rightMargin: Style.current.padding Layout.rightMargin: Style.current.padding
Layout.leftMargin: Style.current.padding Layout.leftMargin: Style.current.padding
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 200
text: "" text: ""
customHeight: 200 readOnly: true
textField.readOnly: true
} }
} }
@ -201,13 +199,12 @@ StatusSectionLayout {
} }
} }
StyledTextField { StatusTextField {
id: txtData id: txtData
text: "" text: ""
leftPadding: 0 leftPadding: 0
padding: 0 padding: 0
font.pixelSize: 14 font.pixelSize: 14
selectByMouse: true
placeholderText: qsTr("Type json-rpc message... e.g {\"method\": \"eth_accounts\"}") placeholderText: qsTr("Type json-rpc message... e.g {\"method\": \"eth_accounts\"}")
anchors.right: rpcSendBtn.left anchors.right: rpcSendBtn.left
anchors.rightMargin: 16 anchors.rightMargin: 16
@ -215,11 +212,7 @@ StatusSectionLayout {
anchors.topMargin: 24 anchors.topMargin: 24
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: 24 anchors.leftMargin: 24
Keys.onEnterPressed: { onAccepted: {
root.store.onSend(txtData.text)
txtData.text = ""
}
Keys.onReturnPressed: {
root.store.onSend(txtData.text) root.store.onSend(txtData.text)
txtData.text = "" txtData.text = ""
} }

View File

@ -11,7 +11,7 @@ import utils 1.0
/*! /*!
\qmltype CurrencyAmountInput \qmltype CurrencyAmountInput
\inherits TextField \inherits StatusTextField
\brief Provides a text input field that accepts a numeric value, with optional (currency) symbol (defaults to "USD"). \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. 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. 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. Internally it uses FormattedDoubleProperty object that keeps track of the value.
*/ */
TextField { StatusTextField {
id: root id: root
property alias value: internalProp.value // accepts double/float or string representation, rejects NaN property alias value: internalProp.value // accepts double/float or string representation, rejects NaN
@ -62,9 +62,6 @@ TextField {
Component.onCompleted: text = internalProp.asLocaleString(decimals) Component.onCompleted: text = internalProp.asLocaleString(decimals)
onTextEdited: value = text onTextEdited: value = text
font.family: Style.current.baseFont.name
font.pixelSize: Style.current.primaryTextFontSize
leftPadding: Style.current.padding leftPadding: Style.current.padding
rightPadding: currencySymbol !== "" ? rightPadding: currencySymbol !== "" ?
currencySymbolText.width + currencySymbolText.anchors.leftMargin + currencySymbolText.anchors.rightMargin : currencySymbolText.width + currencySymbolText.anchors.leftMargin + currencySymbolText.anchors.rightMargin :
@ -72,14 +69,7 @@ TextField {
topPadding: 10 topPadding: 10
bottomPadding: 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 hoverEnabled: !readOnly
selectByMouse: true
inputMethodHints: Qt.ImhFormattedNumbersOnly inputMethodHints: Qt.ImhFormattedNumbersOnly
validator: DoubleValidator { validator: DoubleValidator {
@ -106,10 +96,6 @@ TextField {
Behavior on border.color { ColorAnimation {} } Behavior on border.color { ColorAnimation {} }
} }
cursorDelegate: StatusCursorDelegate {
cursorVisible: root.cursorVisible
}
StatusBaseText { StatusBaseText {
id: currencySymbolText id: currencySymbolText
anchors.right: parent.right anchors.right: parent.right

View File

@ -79,7 +79,7 @@ Item {
height: customHeight height: customHeight
anchors.top: inputBox.hasLabel ? inputLabel.bottom : parent.top anchors.top: inputBox.hasLabel ? inputLabel.bottom : parent.top
anchors.topMargin: inputBox.hasLabel ? inputBox.labelMargin : 0 anchors.topMargin: inputBox.hasLabel ? inputBox.labelMargin : 0
StyledTextField { StatusTextField {
id: inputValue id: inputValue
visible: !inputBox.isTextArea && !inputBox.isSelect visible: !inputBox.isTextArea && !inputBox.isSelect
placeholderText: inputBox.placeholderText placeholderText: inputBox.placeholderText
@ -88,7 +88,6 @@ Item {
anchors.right: clipboardButtonLoader.active ? clipboardButtonLoader.left : parent.right anchors.right: clipboardButtonLoader.active ? clipboardButtonLoader.left : parent.right
anchors.rightMargin: clipboardButtonLoader.active ? Style.current.padding : 0 anchors.rightMargin: clipboardButtonLoader.active ? Style.current.padding : 0
leftPadding: inputBox.hasIcon ? iconWidth + 20 : Style.current.padding leftPadding: inputBox.hasIcon ? iconWidth + 20 : Style.current.padding
selectByMouse: true
font.pixelSize: fontPixelSize font.pixelSize: fontPixelSize
readOnly: inputBox.readOnly readOnly: inputBox.readOnly
background: Rectangle { background: Rectangle {
@ -159,7 +158,7 @@ Item {
if (inputBox.copyToClipboard) { if (inputBox.copyToClipboard) {
ClipboardUtils.setText(inputBox.textToCopy ? inputBox.textToCopy : inputValue.text) ClipboardUtils.setText(inputBox.textToCopy ? inputBox.textToCopy : inputValue.text)
} else { } else {
inputValue.paste() inputValue.paste()
} }
copyBtn.copied = true copyBtn.copied = true
@ -188,9 +187,3 @@ Item {
wrapMode: TextEdit.Wrap wrapMode: TextEdit.Wrap
} }
} }
/*##^##
Designer {
D{i:0;formeditorColor:"#c0c0c0";formeditorZoom:1.25}
}
##^##*/

View File

@ -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()
}
}
}

View File

@ -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}
}
##^##*/

View File

@ -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
}
}

View File

@ -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
}
}

View File

@ -19,5 +19,4 @@ SendTransactionButton 1.0 SendTransactionButton.qml
SentMessage 1.0 SentMessage.qml SentMessage 1.0 SentMessage.qml
StateBubble 1.0 StateBubble.qml StateBubble 1.0 StateBubble.qml
UserImage 1.0 UserImage.qml UserImage 1.0 UserImage.qml
UsernameLabel 1.0 UsernameLabel.qml
VerificationLabel 1.0 VerificationLabel.qml VerificationLabel 1.0 VerificationLabel.qml

View File

@ -38,11 +38,8 @@ SocialLinkPreview 1.0 SocialLinkPreview.qml
StatusSyncCodeInput 1.0 StatusSyncCodeInput.qml StatusSyncCodeInput 1.0 StatusSyncCodeInput.qml
StatusSyncCodeScan 1.0 StatusSyncCodeScan.qml StatusSyncCodeScan 1.0 StatusSyncCodeScan.qml
StatusSyncingInstructions 1.0 StatusSyncingInstructions.qml StatusSyncingInstructions 1.0 StatusSyncingInstructions.qml
StyledButton 1.0 StyledButton.qml
StyledTextArea 1.0 StyledTextArea.qml
StyledTextEdit 1.0 StyledTextEdit.qml StyledTextEdit 1.0 StyledTextEdit.qml
StyledTextEditWithLoadingState 1.0 StyledTextEditWithLoadingState.qml StyledTextEditWithLoadingState 1.0 StyledTextEditWithLoadingState.qml
StyledTextField 1.0 StyledTextField.qml
Timer 1.0 Timer.qml Timer 1.0 Timer.qml
TokenDelegate 1.0 TokenDelegate.qml TokenDelegate 1.0 TokenDelegate.qml
TransactionAddress 1.0 TransactionAddress.qml TransactionAddress 1.0 TransactionAddress.qml

View File

@ -6,6 +6,7 @@ import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1 import StatusQ.Core.Theme 0.1
import StatusQ.Core.Utils 0.1 as SQUtils import StatusQ.Core.Utils 0.1 as SQUtils
import StatusQ.Components 0.1 import StatusQ.Components 0.1
import StatusQ.Controls 0.1
import StatusQ.Validators 0.1 import StatusQ.Validators 0.1
import utils 1.0 import utils 1.0
@ -172,7 +173,7 @@ Control {
} }
RowLayout { RowLayout {
StyledTextField { StatusTextField {
id: textField id: textField
objectName: "amountToSend_textField" objectName: "amountToSend_textField"

View File

@ -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
}
}
}
}

View File

@ -17,4 +17,3 @@ SyncingDeviceView 1.0 SyncingDeviceView.qml
SyncingDisplayCode 1.0 SyncingDisplayCode.qml SyncingDisplayCode 1.0 SyncingDisplayCode.qml
SyncingEnterCode 1.0 SyncingEnterCode.qml SyncingEnterCode 1.0 SyncingEnterCode.qml
SyncingErrorMessage 1.0 SyncingErrorMessage.qml SyncingErrorMessage 1.0 SyncingErrorMessage.qml
TransactionSigner 1.0 TransactionSigner.qml