Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeBoy committed Jul 31, 2024
1 parent b8d2698 commit 7f9f1a3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions ui/cryptomaterial/editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ type Editor struct {

isFirstFocus bool

submitted bool
changed bool
selected bool
isFocusShowHit bool
submitted bool
changed bool
selected bool
showHintOnFocus bool
}

func (t *Theme) EditorPassword(editor *widget.Editor, hint string) Editor {
Expand Down Expand Up @@ -225,8 +225,8 @@ func (e *Editor) Selected() bool {
return selected
}

func (e *Editor) AlwayShowHit() {
e.isFocusShowHit = true
func (e *Editor) AlwaysShowHint() {
e.showHintOnFocus = true
}

func (e *Editor) Layout(gtx C) D {
Expand Down Expand Up @@ -285,7 +285,7 @@ func (e *Editor) layout(gtx C) D {
if focused {
e.TitleLabel.Text = e.Hint
e.TitleLabel.Color, e.LineColor = e.t.Color.Primary, e.t.Color.Primary
if !e.isFocusShowHit {
if !e.showHintOnFocus {
e.Hint = ""
}
}
Expand Down
2 changes: 1 addition & 1 deletion ui/page/send/recipient.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func newRecipient(l *load.Load, selectedWallet sharedW.Asset, pageParam getPageF
// Set the maximum characters the editor can accept.
rp.description.Editor.MaxLen = MaxTxLabelSize
rp.description.TextSize = values.TextSizeTransform(l.IsMobileView(), values.TextSize16)
rp.description.AlwayShowHit()
rp.description.AlwaysShowHint()

return rp
}
Expand Down
4 changes: 2 additions & 2 deletions ui/page/send/send_amount.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func newSendAmount(theme *cryptomaterial.Theme, assetType libUtil.AssetType) *se
sa.amountEditor.HasCustomButton = true
sa.amountEditor.Editor.SingleLine = true
sa.amountEditor.IsTitleLabel = false
sa.amountEditor.AlwayShowHit()
sa.amountEditor.AlwaysShowHint()

sa.amountEditor.CustomButton.Inset = layout.UniformInset(values.MarginPadding2)
sa.amountEditor.CustomButton.Text = values.String(values.StrMax)
Expand All @@ -59,7 +59,7 @@ func newSendAmount(theme *cryptomaterial.Theme, assetType libUtil.AssetType) *se
sa.usdAmountEditor.HasCustomButton = true
sa.usdAmountEditor.Editor.SingleLine = true
sa.usdAmountEditor.IsTitleLabel = false
sa.usdAmountEditor.AlwayShowHit()
sa.usdAmountEditor.AlwaysShowHint()

sa.usdAmountEditor.CustomButton.Inset = layout.UniformInset(values.MarginPadding2)
sa.usdAmountEditor.CustomButton.Text = values.String(values.StrMax)
Expand Down

0 comments on commit 7f9f1a3

Please sign in to comment.