Skip to content

Commit

Permalink
CQ: Fix MainPropertiesPage drag area for RTL
Browse files Browse the repository at this point in the history
  • Loading branch information
XTorLukas committed Dec 2, 2024
1 parent 0bd2cd5 commit 05b3046
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Files.App/Views/Properties/MainPropertiesPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,12 @@ private void Page_Loaded(object sender, RoutedEventArgs e)

private int SetTitleBarDragRegion(InputNonClientPointerSource source, SizeInt32 size, double scaleFactor, Func<UIElement, RectInt32?, RectInt32> getScaledRect)
{
source.SetRegionRects(NonClientRegionKind.Passthrough, [getScaledRect(BackwardNavigationButton, null)]);
return (int)TitlebarArea.ActualHeight;
var height = (int)TitlebarArea.ActualHeight;
var x = RealTimeLayoutService.FlowDirection == FlowDirection.LeftToRight ? 0 : (int)((TitleDragArea.ActualWidth + 50) * scaleFactor);
var width = (int)((BackwardNavigationButton.ActualWidth + 2) * scaleFactor);

source.SetRegionRects(NonClientRegionKind.Passthrough, [getScaledRect(BackwardNavigationButton, new RectInt32(x, 0, width, height))]);
return height;
}

private void Page_SizeChanged(object sender, SizeChangedEventArgs e)
Expand Down

0 comments on commit 05b3046

Please sign in to comment.