From f61f49b70c2e1675715a7384b73a5f59bc36aaab Mon Sep 17 00:00:00 2001 From: cinqmilleans <46631671+cinqmilleans@users.noreply.github.com> Date: Tue, 7 Feb 2023 18:31:59 +0100 Subject: [PATCH] Fix: Fixed issue where HorizontalMultitaskingControl could have negative margin (#10888) --- .../MultitaskingControl/HorizontalMultitaskingControl.xaml.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Files.App/UserControls/MultitaskingControl/HorizontalMultitaskingControl.xaml.cs b/src/Files.App/UserControls/MultitaskingControl/HorizontalMultitaskingControl.xaml.cs index 4f88df73d912..42d0a14f9171 100644 --- a/src/Files.App/UserControls/MultitaskingControl/HorizontalMultitaskingControl.xaml.cs +++ b/src/Files.App/UserControls/MultitaskingControl/HorizontalMultitaskingControl.xaml.cs @@ -27,7 +27,8 @@ public HorizontalMultitaskingControl() var flowDirectionSetting = new Microsoft.Windows.ApplicationModel.Resources.ResourceManager().CreateResourceContext().QualifierValues["LayoutDirection"]; var appWindowTitleBar = App.GetAppWindow(App.Window).TitleBar; - RightPaddingColumn.Width = (flowDirectionSetting == "RTL") ? new GridLength(appWindowTitleBar.LeftInset) : new GridLength(appWindowTitleBar.RightInset); + double rightPaddingColumnWidth = flowDirectionSetting is "RTL" ? appWindowTitleBar.LeftInset : appWindowTitleBar.RightInset; + RightPaddingColumn.Width = new GridLength(rightPaddingColumnWidth >= 0 ? rightPaddingColumnWidth : 0); } private void HorizontalTabView_TabItemsChanged(TabView sender, Windows.Foundation.Collections.IVectorChangedEventArgs args)