mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 06:13:14 -07:00
format conditionals
This commit is contained in:
parent
a24204e448
commit
c213768121
2 changed files with 7 additions and 3 deletions
|
@ -42,7 +42,9 @@ Size HorizontalNoOverflowStackPanel::ArrangeOverride(Size finalSize)
|
|||
auto lastChild = Children->GetAt(Children->Size - 1);
|
||||
float lastChildWidth = 0;
|
||||
if (Children->Size > 2 && ShouldPrioritizeLastItem())
|
||||
{
|
||||
lastChildWidth = lastChild->DesiredSize.Width;
|
||||
}
|
||||
for (auto item : Children)
|
||||
{
|
||||
auto widthAvailable = finalSize.Width - posX;
|
||||
|
|
|
@ -72,12 +72,14 @@ SupplementaryResults::SupplementaryResults()
|
|||
bool SupplementaryResultNoOverflowStackPanel::ShouldPrioritizeLastItem()
|
||||
{
|
||||
if (Children->Size == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
auto lastChild = dynamic_cast<FrameworkElement^>(Children->GetAt(Children->Size - 1));
|
||||
if (lastChild == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
auto suppResult = dynamic_cast<SupplementaryResult^>(lastChild->DataContext);
|
||||
if (suppResult == nullptr)
|
||||
return false;
|
||||
return suppResult->IsWhimsical();
|
||||
return suppResult == nullptr? false: suppResult->IsWhimsical();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue