Skip to content

Commit

Permalink
Vertical Alignment for Cards (webex#397)
Browse files Browse the repository at this point in the history
* Card Vertical Alignment

* Height Calculation FIxed
  • Loading branch information
ggovardh authored Jul 12, 2023
1 parent 83cd795 commit 26c4e28
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion source/qml/Library/RendererQml/AdaptiveCardQmlRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,20 @@ namespace RendererQml

if (card->GetMinHeight() > 0)
{
rectangle->Property("Layout.minimumHeight", std::to_string(cardMinHeight));
columnLayout->Property("height", Formatter() << "Math.max(" << std::to_string(card->GetMinHeight()) << ", " << rectangle->GetId() << ".height + " << tempMargin << ")");
}

switch (card->GetVerticalContentAlignment())
{
case AdaptiveCards::VerticalContentAlignment::Top:
rectangle->Property("Layout.alignment", "Qt.AlignTop");
break;
case AdaptiveCards::VerticalContentAlignment::Bottom:
rectangle->Property("Layout.alignment", "Qt.AlignBottom");
break;
}
uiCard->Property("Layout.preferredHeight", Formatter() << columnLayout->GetId() << ".height");

//Add submit onclick event
addSubmitActionButtonClickFunc(context);
addShowCardLoaderComponents(context);
Expand Down

0 comments on commit 26c4e28

Please sign in to comment.