Skip to content

Commit 48abf01

Browse files
committed
Revert changes TabBar.xaml.cs
1 parent 25285c4 commit 48abf01

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

src/Files.App/UserControls/TabBar/TabBar.xaml.cs

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -360,13 +360,27 @@ private void TabViewItem_Loaded(object sender, RoutedEventArgs e)
360360

361361
private void DragAreaRectangle_Loaded(object sender, RoutedEventArgs e)
362362
{
363-
var scaleAdjustment = DragAreaRectangle.XamlRoot.RasterizationScale;
364-
var titleBarInset = ((FilePropertiesHelpers.FlowDirectionSettingIsRightToLeft
365-
? MainWindow.Instance.AppWindow.TitleBar.LeftInset
366-
: MainWindow.Instance.AppWindow.TitleBar.RightInset) / scaleAdjustment) + 40;
363+
if (HorizontalTabView.ActualWidth > 0 && TabBarAddNewTabButton.Width > 0)
364+
{
365+
var appWindow = MainWindow.Instance.AppWindow;
366+
var titleBarInset = (FilePropertiesHelpers.FlowDirectionSettingIsRightToLeft
367+
? appWindow.TitleBar.LeftInset
368+
: appWindow.TitleBar.RightInset) / DragAreaRectangle.XamlRoot.RasterizationScale;
369+
370+
if (titleBarInset > 0)
371+
{
372+
titleBarInset += 40; // Add 40px gap
373+
RightPaddingColumn.Width = new(titleBarInset);
374+
375+
HorizontalTabView.Measure(new(
376+
HorizontalTabView.ActualWidth - TabBarAddNewTabButton.Width - titleBarInset,
377+
HorizontalTabView.ActualHeight));
378+
379+
return;
380+
}
381+
}
367382

368-
HorizontalTabView.Measure(new(HorizontalTabView.ActualWidth - TabBarAddNewTabButton.Width - titleBarInset, HorizontalTabView.ActualHeight));
369-
RightPaddingColumn.Width = new(titleBarInset);
383+
DispatcherQueue.TryEnqueue(() => DragAreaRectangle_Loaded(sender, e));
370384
}
371385
}
372386
}

0 commit comments

Comments
 (0)