This commit is contained in:
Zihan Chen
2020-12-10 19:42:18 -08:00
parent 6dcc1f2cbd
commit 79c6ae548b
3 changed files with 24 additions and 3 deletions

View File

@@ -167,10 +167,31 @@
lastAnimation = newAnimation;
AddAnimation(lastAnimation);
}
func GetAlignment(): presentation::Margin
{
return {
left:0
top:0
bottom:0
right:-(
cast int (
self.animationBuilder.Current.Length * (
self.boundary.Bounds.x2 - self.boundary.Bounds.x1 - 10
)
)
)
};
}
]]></ref.Members>
<SelectableButtonTemplate ref.Name="self" ContainerComposition-ref="container" MinSizeLimitation="LimitToElementAndChildren">
<Bounds AlignmentToParent="left:0 top:0 right:-1 bottom:0" PreferredMinSize="x:10">
<SolidBorder Color="#FFFF00" Shape="shapeType:RoundRect radiusX:5 radiusY:5"/>
<Bounds ref.Name="boundary" AlignmentToParent="left:0 top:0 right:-1 bottom:0">
<Bounds AlignmentToParent-bind="self.observe as _ (_.GetAlignment() on _.boundary.BoundsChanged, _.animationBuilder.Current.LengthChanged)">
<SolidBorder Color-bind="self.animationBuilder.Current.Border" Shape="shapeType:RoundRect radiusX:5 radiusY:5"/>
</Bounds>
<Bounds AlignmentToParent-bind="self.observe as _ (_.GetAlignment() on _.boundary.BoundsChanged, _.animationBuilder.Current.LengthChanged)">
<SolidBackground Color-bind="self.animationBuilder.Current.Background" Shape="shapeType:RoundRect radiusX:5 radiusY:5"/>
</Bounds>
</Bounds>
<Table AlignmentToParent="left:0 top:0 right:0 bottom:0" MinSizeLimitation="LimitToElementAndChildren">
@@ -193,7 +214,7 @@
<Bounds AlignmentToParent="left:0 top:0 right:0 bottom:0" MinSizeLimitation="LimitToElementAndChildren">
</Bounds>
<Bounds AlignmentToParent="left:1 top:1 right:1 bottom:1" MinSizeLimitation="LimitToElementAndChildren">
<SolidLabel Text-bind="self.Text" Font-bind="self.Font" Color="#FFFFFF"/>
<SolidLabel Text-bind="self.Text" Font-bind="self.Font" Color-bind="self.animationBuilder.Current.Text"/>
</Bounds>
<Bounds ref.Name="container" AlignmentToParent="left:1 top:1 right:1 bottom:1" MinSizeLimitation="LimitToElementAndChildren"/>
</Cell>