@@ -21,6 +21,8 @@ public static class FilePropertiesHelpers
2121 {
2222 private static IAppThemeModeService AppThemeModeService { get ; } = Ioc . Default . GetRequiredService < IAppThemeModeService > ( ) ;
2323
24+ private static IRealTimeLayoutService RealTimeLayoutService { get ; } = Ioc . Default . GetRequiredService < IRealTimeLayoutService > ( ) ;
25+
2426 /// <summary>
2527 /// Whether LayoutDirection (FlowDirection) is set to right-to-left (RTL)
2628 /// </summary>
@@ -121,6 +123,7 @@ public static void OpenPropertiesWindow(object item, IShellPage associatedInstan
121123 appWindow . TitleBar . ExtendsContentIntoTitleBar = true ;
122124 appWindow . TitleBar . ButtonBackgroundColor = Colors . Transparent ;
123125 appWindow . TitleBar . ButtonInactiveBackgroundColor = Colors . Transparent ;
126+ RealTimeLayoutService . UpdateTitleBar ( propertiesWindow ) ;
124127
125128 appWindow . SetIcon ( AppLifecycleHelper . AppIconPath ) ;
126129
@@ -136,11 +139,12 @@ public static void OpenPropertiesWindow(object item, IShellPage associatedInstan
136139
137140 // WINUI3: Move window to cursor position
138141 PInvoke . GetCursorPos ( out var pointerPosition ) ;
142+ var rePos = RealTimeLayoutService . FlowDirection is FlowDirection . LeftToRight ? 1 : - 1 ;
139143 var displayArea = DisplayArea . GetFromPoint ( new PointInt32 ( pointerPosition . X , pointerPosition . Y ) , DisplayAreaFallback . Nearest ) ;
140144 var appWindowPos = new PointInt32
141145 {
142146 X = displayArea . WorkArea . X
143- + Math . Max ( 0 , Math . Min ( displayArea . WorkArea . Width - appWindow . Size . Width , pointerPosition . X - displayArea . WorkArea . X ) ) ,
147+ + Math . Max ( 0 , Math . Min ( displayArea . WorkArea . Width - appWindow . Size . Width , ( pointerPosition . X * rePos ) - displayArea . WorkArea . X ) ) ,
144148 Y = displayArea . WorkArea . Y
145149 + Math . Max ( 0 , Math . Min ( displayArea . WorkArea . Height - appWindow . Size . Height , pointerPosition . Y - displayArea . WorkArea . Y ) ) ,
146150 } ;
0 commit comments