Skip to content

Commit

Permalink
update editor for password modal
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeBoy committed Mar 18, 2024
1 parent 943e0ad commit 655bfd4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions ui/cryptomaterial/editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ type Editor struct {
eventKey int
isShowMenu bool
isDisableMenu bool

// add space for error lable if it is true
isSpaceError bool
}

func (t *Theme) EditorPassword(editor *widget.Editor, hint string) Editor {
Expand Down Expand Up @@ -254,6 +257,9 @@ func (e *Editor) layout(gtx C) D {
}
return inset.Layout(gtx, e.errorLabel.Layout)
}
if e.isSpaceError {
return layout.Spacer{Height: values.MarginPadding18}.Layout(gtx)
}
return D{}
}),
)
Expand Down Expand Up @@ -486,3 +492,7 @@ func (e *Editor) ClearError() {
func (e *Editor) IsDirty() bool {
return e.errorLabel.Text == ""
}

func (e *Editor) AllowSpaceError(allow bool) {
e.isSpaceError = allow
}
1 change: 1 addition & 0 deletions ui/modal/create_password_modal.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ func NewCreatePasswordModal(l *load.Load) *CreatePasswordModal {

cm.confirmPasswordEditor = l.Theme.EditorPassword(new(widget.Editor), values.String(values.StrConfirmSpendingPassword))
cm.confirmPasswordEditor.Editor.SingleLine, cm.confirmPasswordEditor.Editor.Submit = true, true
cm.confirmPasswordEditor.AllowSpaceError(true)

// Set the default click functions
cm.negativeButtonClicked = func() {}
Expand Down
2 changes: 1 addition & 1 deletion ui/values/localizable/en.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ const EN = `
"owned" = "Valid address owned by you."
"pageWarningNotSync" = "Page cannot be accessed because the wallet is not synced, please sync your wallet and try again"
"pageWarningSync" = "Page cannot be accessed because the wallet sync is in progress, please wait for the sync to complete"
"passwordNotMatch" = "Passwords do not match"
"passwordNotMatch" = "Passwords do not match."
"pasteSeedWords" = "Paste Seed Words"
"peer" = "Peer"
"peers" = "peers"
Expand Down

0 comments on commit 655bfd4

Please sign in to comment.