NavigationView: clamp the pane toggle button width to zero

With a PaneTitle and an open overlay pane showing the back/close button, the
toggle button width is OpenPaneLength - 40, which is negative for a small
OpenPaneLength. FrameworkElement.Width rejects negative values.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ec9a38b2-2629-4a10-bfb5-552decfe6848
This commit is contained in:
ayushjai19andCopilot committed 2026-10-19 20:08:40 +05:30
1 parent baa4b97a6a
commit e04412063f
1 file changed
+2 -1
@@ -4655,7 +4655,8 @@ void NavigationView::UpdatePaneToggleSize()
if (auto toggleButton = m_paneToggleButton.get())
{
toggleButton.Width(togglePaneButtonWidth);
// OpenPaneLength can be smaller than the back/close button, and Width rejects negative values.
toggleButton.Width(std::max(0.0, togglePaneButtonWidth));
}
}
}