mirror of
https://github.com/microsoft/microsoft-ui-xaml.git
synced 2026-10-29 00:46:30 +08:00
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:
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user