-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dcr: Reimplemint privacy screens. #248
Conversation
3f385c0
to
2bb9f5f
Compare
}), | ||
layout.Rigid(func(gtx C) D { | ||
txt := `<span style="text-color: grayText2"> | ||
<b>Make sure to select the same accounts from the previous privacy setup. </b><br>Failing to do so could compromise wallet privacy.<br> You may not select the same account for mixed and unmixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this would allow to bold text in the middle of a sentence, the font ends up being different from the rest of the page so not using. Could also make everything html...
dcrUniqueImpl := wal.(*dcr.Asset) | ||
err = dcrUniqueImpl.CreateMixerAccounts(values.String(values.StrMixed), values.String(values.StrUnmixed), pg.passwordEditor.Editor.Text()) | ||
if err != nil { | ||
errModal := modal.NewErrorModal(pg.Load, err.Error(), modal.DefaultClickFunc()) | ||
pg.ParentWindow().ShowModal(errModal) | ||
return | ||
} | ||
wal.SetBoolConfigValueForKey(sharedW.AccountMixerConfigSet, true) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So not creating the accounts until the user turns mixing on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2bb9f5f
to
a49d0ec
Compare
a49d0ec
to
befab2b
Compare
Fixed the spacing around the manual screen back arrow https://github.com/crypto-power/cryptopower/compare/a49d0ec318d0122b549cc9d5915815830317ee89..befab2bf2ef08de596310212857243a6b593b33c |
Another pr would be good if that's alright, this one focuses on desktop. This solves the main intent of the issue I was trying to make, that privacy should be opt in. Actually I forgot about the default receive account after you turn on can't send from default. Let me check that out will probably add more to this pr. |
befab2b
to
28be9d5
Compare
The default sending account is already ok. Made it impossible to toggle off the spend unmixed funds if mixing is not set up. https://github.com/crypto-power/cryptopower/compare/befab2bf2ef08de596310212857243a6b593b33c..28be9d560bcf5ab875620b4aa37524419980e297 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass. Please add screenshots of the UI developed to the PR desc.
return layout.Flex{Axis: layout.Vertical, Alignment: layout.Start}.Layout(gtx, | ||
layout.Rigid(func(gtx C) D { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lines are not needed and seem repeated. I would recommend using the linear Layout widget for this though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, was able to remove the Flex
layout here and it looks the same.
Linear in place of the Center below or the Card above?
layout.Flexed(1, func(gtx C) D { | ||
return layout.Flex{Axis: layout.Vertical, Alignment: layout.Middle, Spacing: layout.SpaceAround}.Layout(gtx, | ||
layout.Rigid(func(gtx C) D { | ||
gtx.Constraints.Max.X = int(values.MarginPadding40) | ||
return pg.Theme.Icons.ActionInfo.Layout(gtx, pg.Theme.Color.Gray1) | ||
}), | ||
) | ||
}), | ||
layout.Flexed(7, func(gtx C) D { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flexed(1) and Flexed(7) seems off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would be good values here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JoeGruffins I think it just:
return layout.Flex{Alignment: layout.Start}.Layout(gtx,
layout.Rigid(func(gtx C) D {
gtx.Constraints.Max.X = int(values.MarginPadding40)
return layout.Center.Layout(gtx, func(gtx layout.Context) layout.Dimensions {
return pg.Theme.Icons.ActionInfo.Layout(gtx, pg.Theme.Color.Gray1)
})
}),
layout.Rigid(func(gtx C) D {
return layout.Inset{
Left: values.MarginPadding10,
}.Layout(gtx, func(gtx C) D {
return layout.Flex{Axis: layout.Vertical}.Layout(gtx,
layout.Rigid(func(gtx C) D {
label := pg.Theme.H6(values.String(values.StrSetUpStakeShuffleWarningTitle))
return label.Layout(gtx)
}),
layout.Rigid(func(gtx C) D {
label := pg.Theme.Body1(values.String(values.StrSetUpStakeShuffleWarningDesc))
return label.Layout(gtx)
}),
)
})
}),
)
this is my suggestion code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.
return layout.Flex{Axis: layout.Vertical, Alignment: layout.Middle}.Layout(gtx, | ||
layout.Rigid(func(gtx C) D { | ||
return layout.Center.Layout(gtx, func(gtx C) D { | ||
return layout.Inset{Top: values.MarginPadding25}.Layout(gtx, func(gtx C) D { | ||
return layout.Flex{Axis: layout.Vertical, Alignment: layout.Start}.Layout(gtx, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the linear layout widget will technically remove these lines of code as you can align the layout by passing the necessary params.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was able to remove the Flex further above like you suggested in another place.
Linear in place of Center?
b2dd44e
to
4b6cb72
Compare
Fixing all but three of the inline comments so far https://github.com/crypto-power/cryptopower/compare/b2dd44e2eac4e31ab45a48699ffa3845a8fc1ac7..4b6cb728c2272b91dfa10e73598ff8fbfde8406c |
@dreacot Not funds, accounts. You need three accounts to set up mixing. Automatic will create them but if manual you already need them. I will look into the other error now. |
4b6cb72
to
6f807e5
Compare
@dreacot hopefully this fixes the no funds bug https://github.com/crypto-power/cryptopower/compare/4b6cb728c2272b91dfa10e73598ff8fbfde8406c..6f807e50846b3423fb9e7b49ce14cc2dae0254a1 |
i'm still having the issue where i can't see the button |
it does |
What button. |
Ohh. On desktop? I guess the card needs a set minimum thats higher than it is currently |
I think the top padding is too much as well |
379d9f3
to
c63e287
Compare
@dreacot reduced a lot of the space https://github.com/crypto-power/cryptopower/compare/379d9f3c1fcfbe9ea63e7f49ebd9160689332b31..c63e28790fbd65d581fd10524348bc1fd62c80a5 Setting a max Y in the layout doesn't seem to be respected. These changes make the buttons viewable with as small a screen as I can make. I guess there is a minimum size I cannot makes the window smaller than? |
the app window? yeah its 650px minimum |
c63e287
to
c74b566
Compare
I just rebased and there's still conflicts lol |
c74b566
to
4d7340b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -77,6 +77,7 @@ func (asset *Asset) CreateMixerAccounts(mixedAccount, unmixedAccount, privPass s | |||
asset.SetInt32ConfigValueForKey(sharedW.AccountMixerMixedAccount, mixedAccountNumber) | |||
asset.SetInt32ConfigValueForKey(sharedW.AccountMixerUnmixedAccount, unmixedAccountNumber) | |||
asset.SetBoolConfigValueForKey(sharedW.AccountMixerConfigSet, true) | |||
asset.SetBoolConfigValueForKey(sharedW.SpendUnmixedFundsKey, false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set false for sharedW.SpendUnmixedFundsKey not need because when read it, default value return is false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I set the default to true in this commit I believe. Please see the CreateNewDCRWallet variants in libwallet/dcr.go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it fine
@@ -108,6 +109,7 @@ func (asset *Asset) SetAccountMixerConfig(mixedAccount, unmixedAccount int32, pr | |||
asset.SetInt32ConfigValueForKey(sharedW.AccountMixerMixedAccount, mixedAccount) | |||
asset.SetInt32ConfigValueForKey(sharedW.AccountMixerUnmixedAccount, unmixedAccount) | |||
asset.SetBoolConfigValueForKey(sharedW.AccountMixerConfigSet, true) | |||
asset.SetBoolConfigValueForKey(sharedW.SpendUnmixedFundsKey, false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same above
Do you suggest just the arrow or arrow and "Manual Setup" label I did the entire row because it's easier to click on mobile, if these screens can be reused. |
i think the arrow and manual setup label should be fine |
5aa3fff
to
c8d5703
Compare
Just the arrow and label area are clickable. Does it look alright? https://github.com/crypto-power/cryptopower/compare/5aa3fff4a054bd4a938b2c35f6e797a64b51d641..c8d5703a4f149541dd003dcc6d8db35eaf2d50c8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return layout.Inset{Top: values.MarginPadding25}.Layout(gtx, func(gtx C) D { | ||
return layout.Flex{Axis: layout.Vertical, Alignment: layout.Start}.Layout(gtx, | ||
layout.Rigid(func(gtx C) D { | ||
label := pg.Theme.H6(values.String(values.StrSetUpStakeShuffleAutoOrManualA)) | ||
return layout.Inset{ | ||
Left: values.MarginPadding24, | ||
}.Layout(gtx, label.Layout) | ||
}), | ||
layout.Rigid(func(gtx C) D { | ||
label := pg.Theme.Body1(values.String(values.StrSetUpStakeShuffleAutoOrManualB)) | ||
return layout.Inset{ | ||
Left: values.MarginPadding24, | ||
}.Layout(gtx, label.Layout) | ||
}), | ||
layout.Rigid(func(gtx C) D { | ||
// TODO: Find a way to make Mixed and Unmixed bold while keeping to the theme. | ||
label := pg.Theme.Body1(values.String(values.StrSetUpStakeShuffleAutoOrManualC)) | ||
return layout.Inset{ | ||
Top: values.MarginPadding10, | ||
Left: values.MarginPadding24, | ||
}.Layout(gtx, label.Layout) | ||
}), | ||
layout.Rigid(func(gtx C) D { | ||
label := pg.Theme.Body1(values.String(values.StrSetUpStakeShuffleAutoOrManualD)) | ||
return layout.Inset{ | ||
Top: values.MarginPadding10, | ||
Left: values.MarginPadding24, | ||
}.Layout(gtx, label.Layout) | ||
}), | ||
layout.Rigid(func(gtx C) D { | ||
return layout.Spacer{Height: values.MarginPadding80}.Layout(gtx) | ||
}), | ||
layout.Rigid(func(gtx C) D { | ||
line := pg.Theme.Separator() | ||
return layout.Inset{ | ||
Top: values.MarginPadding10, | ||
Left: values.MarginPadding24, | ||
Right: values.MarginPadding24, | ||
}.Layout(gtx, line.Layout) | ||
}), | ||
layout.Rigid(func(gtx C) D { | ||
return pg.autoSetupClickable.Layout(gtx, pg.autoSetupLayout) | ||
}), | ||
layout.Rigid(func(gtx C) D { | ||
return pg.manualSetupClickable.Layout(gtx, pg.manualSetupLayout) | ||
}), | ||
layout.Rigid(func(gtx C) D { | ||
return layout.Spacer{Height: values.MarginPadding10}.Layout(gtx) | ||
}), | ||
) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
too many repeated Insets
you can try:
return layout.Inset{
Top: values.MarginPadding25,
Left: values.MarginPadding24,
Right: values.MarginPadding24,
}.Layout(gtx, func(gtx C) D {...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Prevents the buttons from covering the whole width of the screen but I guess thats fine.
In order to make mixing opt in, start with it off and do not create the accounts. Allow sending from the default account on creation.
3822f66
to
da8ba79
Compare
da8ba79
to
ec869d0
Compare
closes #171