mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 14:13:30 -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);
|
auto lastChild = Children->GetAt(Children->Size - 1);
|
||||||
float lastChildWidth = 0;
|
float lastChildWidth = 0;
|
||||||
if (Children->Size > 2 && ShouldPrioritizeLastItem())
|
if (Children->Size > 2 && ShouldPrioritizeLastItem())
|
||||||
|
{
|
||||||
lastChildWidth = lastChild->DesiredSize.Width;
|
lastChildWidth = lastChild->DesiredSize.Width;
|
||||||
|
}
|
||||||
for (auto item : Children)
|
for (auto item : Children)
|
||||||
{
|
{
|
||||||
auto widthAvailable = finalSize.Width - posX;
|
auto widthAvailable = finalSize.Width - posX;
|
||||||
|
|
|
@ -72,12 +72,14 @@ SupplementaryResults::SupplementaryResults()
|
||||||
bool SupplementaryResultNoOverflowStackPanel::ShouldPrioritizeLastItem()
|
bool SupplementaryResultNoOverflowStackPanel::ShouldPrioritizeLastItem()
|
||||||
{
|
{
|
||||||
if (Children->Size == 0)
|
if (Children->Size == 0)
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
auto lastChild = dynamic_cast<FrameworkElement^>(Children->GetAt(Children->Size - 1));
|
auto lastChild = dynamic_cast<FrameworkElement^>(Children->GetAt(Children->Size - 1));
|
||||||
if (lastChild == nullptr)
|
if (lastChild == nullptr)
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
auto suppResult = dynamic_cast<SupplementaryResult^>(lastChild->DataContext);
|
auto suppResult = dynamic_cast<SupplementaryResult^>(lastChild->DataContext);
|
||||||
if (suppResult == nullptr)
|
return suppResult == nullptr? false: suppResult->IsWhimsical();
|
||||||
return false;
|
|
||||||
return suppResult->IsWhimsical();
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue