Skip to content

Commit e6f7f97

Browse files
committed
Update TabBar.xaml.cs
1 parent 379782d commit e6f7f97

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

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

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
// Licensed under the MIT License. See the LICENSE.
33

44
using CommunityToolkit.WinUI.UI;
5-
using Microsoft.UI.Input;
65
using Microsoft.UI.Xaml;
76
using Microsoft.UI.Xaml.Controls;
87
using Microsoft.UI.Xaml.Input;
98
using Microsoft.UI.Xaml.Shapes;
109
using Windows.ApplicationModel.DataTransfer;
11-
using Windows.Graphics;
1210
using Windows.Storage;
1311
using Windows.Win32;
1412

@@ -363,24 +361,12 @@ private void TabViewItem_Loaded(object sender, RoutedEventArgs e)
363361
private void DragAreaRectangle_Loaded(object sender, RoutedEventArgs e)
364362
{
365363
double scaleAdjustment = DragAreaRectangle.XamlRoot.RasterizationScale;
366-
double titleBarInset = ((FilePropertiesHelpers.FlowDirectionSettingIsRightToLeft
367-
? MainWindow.Instance.AppWindow.TitleBar.LeftInset
368-
: MainWindow.Instance.AppWindow.TitleBar.RightInset) / scaleAdjustment) + 40;
364+
double titleBarInset = ((FilePropertiesHelpers.FlowDirectionSettingIsRightToLeft
365+
? MainWindow.Instance.AppWindow.TitleBar.LeftInset
366+
: MainWindow.Instance.AppWindow.TitleBar.RightInset) / scaleAdjustment) + 40;
369367

370-
HorizontalTabView.Measure(new(HorizontalTabView.ActualWidth - TabBarAddNewTabButton.Width - titleBarInset, HorizontalTabView.ActualHeight));
371-
RightPaddingColumn.Width = new(titleBarInset >= 0 ? titleBarInset : 0);
372-
}
373-
374-
DispatcherQueue.TryEnqueue(() => DragAreaRectangle_Loaded(sender, e));
375-
}
376-
377-
public int SetTitleBarDragRegion(InputNonClientPointerSource source, SizeInt32 size, double scaleFactor, Func<UIElement, RectInt32?, RectInt32> getScaledRect)
378-
{
379-
var height = (int)ActualHeight;
380-
var width = (int)(ActualWidth - DragArea.ActualWidth);
381-
382-
source.SetRegionRects(NonClientRegionKind.Passthrough, [getScaledRect(this, new RectInt32(0, 0, width, height))]);
383-
return height;
368+
HorizontalTabView.Measure(new(HorizontalTabView.ActualWidth - TabBarAddNewTabButton.Width - titleBarInset, HorizontalTabView.ActualHeight));
369+
RightPaddingColumn.Width = new(titleBarInset >= 0 ? titleBarInset : 0);
384370
}
385371
}
386-
}
372+
}

0 commit comments

Comments
 (0)