Material icon indicating copy to clipboard operation
Material copied to clipboard

Switch Too narrow;

Open Ccmi opened this issue 9 years ago • 12 comments

Ccmi avatar Aug 23 '17 03:08 Ccmi

You will need to describe more than this please.

daniel-jonathan avatar Aug 23 '17 03:08 daniel-jonathan

Set the size to medium or large,width too narrow; image

Ccmi avatar Aug 23 '17 03:08 Ccmi

hmmm... okay, I will take a look. Thanks.

daniel-jonathan avatar Aug 23 '17 03:08 daniel-jonathan

The width for .small is also smaller than intended

This is my Switch:

theSwitch = Switch(state: .off, style: .light, size: .small)
theCell.layout(theSwitch).right(16).top(16).bottom(16)

which leads to screen shot 2017-08-25 at 08 53 22 This is the Switch from https://github.com/CosmicMind/Material#switch screen shot 2017-08-25 at 08 53 06

theolof avatar Aug 25 '17 06:08 theolof

As a workaround you can subclass it and return custom intrinsicContentSize.

OrkhanAlikhanov avatar Aug 25 '17 20:08 OrkhanAlikhanov

I am not sure if this is an issue or just an incorrect use of the Switch control. If there is an issue here to solve, please reopen this. Thank you!

daniel-jonathan avatar Oct 20 '17 03:10 daniel-jonathan

I can confirm that this is an issue. As you can see @theolof comment. I face the same problem that the switch is too short for all swith size.

aemgtz avatar Oct 23 '17 10:10 aemgtz

I see, okay I have reopened the issue and will run the sample project and see what's up. Thanks for the feedback :)

daniel-jonathan avatar Oct 24 '17 01:10 daniel-jonathan

Has this already fixed?

Recouse avatar Feb 03 '18 09:02 Recouse

Can someone test this commit, who has been facing this issue: 4433996f6f89bce19b11f917182d89f4877b5077, thank you!

daniel-jonathan avatar Feb 07 '18 19:02 daniel-jonathan

It's better now. screen shot 2018-02-08 at 08 15 49

Recouse avatar Feb 08 '18 03:02 Recouse

Cool, so unless there is further need to adjust the sizing, I am going to close this issue and the next release will include this fix. Thank you!

daniel-jonathan avatar Feb 08 '18 14:02 daniel-jonathan