-
Notifications
You must be signed in to change notification settings - Fork 678
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
ToggleSwitch Visual Update #3869
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
I updated the xaml to use |
Maybe using an SVG for this would be better? SVG was also the way how I was able to get the inset corner radii for TabView. |
A motion mockup ToggleSwitch.Motion.mp4 |
@mdtauk I opted to use ScaleX and Y transformations to not make it an independent animation out of concerns for performance. But you're right, it looks WAY better, so may be a worthwhile compromise. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@karenbtlai can you merge with latest? That should fix the build failure. |
c3a98d4
to
ce6b761
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Please move this into master branch. |
</ObjectAnimationUsingKeyFrames> | ||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="SwitchKnobOn" Storyboard.TargetProperty="Width" EnableDependentAnimation="True" > | ||
<SplineDoubleKeyFrame KeyTime="0:0:0.25" KeySpline="0.0,0.0 0.0,1.0" Value="12" /> |
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.
Wondering if this number can be defined an x:double somewhere else? (Same with 14 and 17 below.) -- in case it's related to other sizes.
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.
Wondering if this number can be defined an x:double somewhere else? (Same with 14 and 17 below.) -- in case it's related to other sizes.
You could, but the ToggleSwitch is a pretty unique control design, and it does not support resizing like other controls, so it would not be changed commonly. So making them generalised resources, would not be super helpful.
Having said that, if the Thumb's size at rest is changeable with lightweight styling, the PointerOver, Pressed, and Disabled sizes could be added. But they would still be something like:
ToggleSwitchKnobDefaultSize
ToggleSwitchKnobPointerOverSize
ToggleSwitchKnobPressedSize
ToggleSwitchKnobDisabledSize
You would want to do the same with the SliderThumbSizes, and the RadioButtonCheckMarkSize etc
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.
The 12px and 14px sizes are the same as RadioButtons and SliderThumbs. That also poses the question whether that should those be a shared resource?
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.
The 12px and 14px sizes are the same as RadioButtons and SliderThumbs. That also poses the question whether that should those be a shared resource?
In that case, you could have a generalised value with the pixel sizes - but then use Lightweight styles for the controls, which reference those generalised values.
This would allow developers an easy way to modify the controls, if say they wanted to have the Slider Thumb parts be larger.
It is a little more complicated with some animations as you are putting in scale factors, rather than discreet values.
f6a9c8d
to
20f687e
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Description
ToggleSwitch visual updates + animation
How Has This Been Tested?
Visual Verification