diff --git a/src/Calculator/Controls/OverflowTextBlock.cpp b/src/Calculator/Controls/OverflowTextBlock.cpp index 2e020c9..7b4adc2 100644 --- a/src/Calculator/Controls/OverflowTextBlock.cpp +++ b/src/Calculator/Controls/OverflowTextBlock.cpp @@ -27,9 +27,12 @@ using namespace Windows::UI::Xaml::Navigation; DEPENDENCY_PROPERTY_INITIALIZATION(OverflowTextBlock, IsActive); DEPENDENCY_PROPERTY_INITIALIZATION(OverflowTextBlock, TextStyle); DEPENDENCY_PROPERTY_INITIALIZATION(OverflowTextBlock, TokensUpdated); -DEPENDENCY_PROPERTY_INITIALIZATION(OverflowTextBlock, ColumnWidth); -DEPENDENCY_PROPERTY_INITIALIZATION(OverflowTextBlock, ColumnHeight); -DEPENDENCY_PROPERTY_INITIALIZATION(OverflowTextBlock, ScrollButtonFontSize); +DEPENDENCY_PROPERTY_INITIALIZATION(OverflowTextBlock, ScrollButtonsWidth); +DEPENDENCY_PROPERTY_INITIALIZATION(OverflowTextBlock, ScrollButtonsFontSize); +DEPENDENCY_PROPERTY_INITIALIZATION(OverflowTextBlock, ScrollButtonsPlacement); + +static constexpr unsigned int SCROLL_BUTTONS_APPROXIMATION_RANGE = 4; +static constexpr double SCROLL_RATIO = 0.7; void OverflowTextBlock::OnApplyTemplate() { @@ -44,35 +47,32 @@ void OverflowTextBlock::OnApplyTemplate() ref new EventHandler(this, &OverflowTextBlock::OnViewChanged); } + uiElement = GetTemplateChild("ExpressionContent"); + if (uiElement != nullptr) + { + m_expressionContent = safe_cast(uiElement); + } + uiElement = GetTemplateChild("ScrollLeft"); if (uiElement != nullptr) { m_scrollLeft = safe_cast