Skip to content

Commit f5733ba

Browse files
committed
CQ: Fix TitleBarDragRegion
1 parent 06056d9 commit f5733ba

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Files.App/Views/MainPage.xaml.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,11 @@ private void HorizontalMultitaskingControl_Loaded(object sender, RoutedEventArgs
138138
private int SetTitleBarDragRegion(InputNonClientPointerSource source, SizeInt32 size, double scaleFactor, Func<UIElement, RectInt32?, RectInt32> getScaledRect)
139139
{
140140
var height = (int)TabControl.ActualHeight;
141-
source.SetRegionRects(NonClientRegionKind.Passthrough, [getScaledRect(this, new RectInt32(0, 0, (int)(TabControl.ActualWidth + TabControl.Margin.Left - TabControl.DragArea.ActualWidth), height))]);
141+
142+
var x = AppLanguageHelper.FlowDirection == FlowDirection.LeftToRight ? 0 : (int)TabControl.DragArea.ActualWidth;
143+
var width = (int)(TabControl.ActualWidth + TabControl.Margin.Left - TabControl.DragArea.ActualWidth);
144+
145+
source.SetRegionRects(NonClientRegionKind.Passthrough, [getScaledRect(this, new RectInt32(x, 0, width, height))]);
142146
return height;
143147
}
144148

0 commit comments

Comments
 (0)