Widen amount field to support large values with large precision #58

Open
opened 3 years ago by duke · 6 comments
duke commented 3 years ago
Owner

Make sure 123456789.12345678 renders correctly

Make sure 123456789.12345678 renders correctly
Collaborator

This is easy change to regex here but wondering if necessary as it supports 12345678.12345678 and max supply. https://git.hush.is/hush/SilentDragon/src/branch/master/src/sendtab.cpp#L17

This is easy change to regex here but wondering if necessary as it supports 12345678.12345678 and max supply. https://git.hush.is/hush/SilentDragon/src/branch/master/src/sendtab.cpp#L17
Poster
Owner

@fekt not sure if that code needs to change, the issue is not validation, but rendering the amount in the GUI, without overflowing/scrolling the input area, which can make the number look different than the data that is actually in the input field. I think we need a GUI change, not a validation change.

@fekt not sure if that code needs to change, the issue is not validation, but rendering the amount in the GUI, without overflowing/scrolling the input area, which can make the number look different than the data that is actually in the input field. I think we need a GUI change, not a validation change.
Collaborator

@duke Can you maybe add screenshot of what you're referring to? I was looking at the receipient amount field on send tab. I thought maybe you were describing an issue with the GUI and number getting cut off but I wasn't able to reproduce. The width for the input on form seemed fine. Might depend on screen resolution. Some other balance fields look not wide enough to support large balances.

I don't really know QT, but that validator and regex seems to perform live validation as typing and restricts to 16 digits total and a max of 8 digits before or after decimal. If you type more than 8 digits, it won't let you enter a decimal but will let you enter a number like 1234567812345678. I thought maybe this is what you were experiencing where you were typing 123456789 and then couldn't enter decimnal. If changed to [0-9]{0,9}\\.?[0-9]{0,8}, it'll let you enter 123456789.12345678

There is also an inputMask that can be used instead or in conjunction with a validator but probably not needed. This post has some info: https://www.ics.com/blog/qt-support-input-masks-and-validators

@duke Can you maybe add screenshot of what you're referring to? I was looking at the receipient amount field on send tab. I thought maybe you were describing an issue with the GUI and number getting cut off but I wasn't able to reproduce. The width for the input on form seemed fine. Might depend on screen resolution. Some other balance fields look not wide enough to support large balances. I don't really know QT, but that validator and regex seems to perform live validation as typing and restricts to 16 digits total and a max of 8 digits before or after decimal. If you type more than 8 digits, it won't let you enter a decimal but will let you enter a number like 1234567812345678. I thought maybe this is what you were experiencing where you were typing 123456789 and then couldn't enter decimnal. If changed to `[0-9]{0,9}\\.?[0-9]{0,8}`, it'll let you enter 123456789.12345678 There is also an inputMask that can be used instead or in conjunction with a validator but probably not needed. This post has some info: https://www.ics.com/blog/qt-support-input-masks-and-validators
Collaborator

Screenshot would still be helpful just to be sure I'm looking at same thing but I was able to reproduce by scaling SD window as small as possible. It is worse on different monitors/resolution. The problem then is something on that line would have to move down for the input field to scale wider. Maybe only move the BTC amount under the field?

Screenshot would still be helpful just to be sure I'm looking at same thing but I was able to reproduce by scaling SD window as small as possible. It is worse on different monitors/resolution. The problem then is something on that line would have to move down for the input field to scale wider. Maybe only move the BTC amount under the field?
Collaborator

Latest commits have some changes. I opted to move the memo button down on same line where memo shows up to get a little more space. Also made UI match more closesly when adding additional receipients as it had some slight variances in buttons/spacing due to additional recipents GUI being all in code and first receipient being in .ui form.

At some point working on this I must have grabbed a copy of mainwindow.ui from master branch and committed changes with that version. Think I added everything back that was in dev version. Tabbing order is a little funky and I need to fix.

Latest commits have some changes. I opted to move the memo button down on same line where memo shows up to get a little more space. Also made UI match more closesly when adding additional receipients as it had some slight variances in buttons/spacing due to additional recipents GUI being all in code and first receipient being in .ui form. At some point working on this I must have grabbed a copy of mainwindow.ui from master branch and committed changes with that version. Think I added everything back that was in dev version. Tabbing order is a little funky and I need to fix.
Poster
Owner

@fekt the version of QT used might also affect this. I will see if I can reproduce the problem and make a screenshot when I am on the correct machine

@fekt the version of QT used might also affect this. I will see if I can reproduce the problem and make a screenshot when I am on the correct machine
duke added the
bug
label 1 year ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.