22// Licensed under the MIT License. See the LICENSE.
33
44using CommunityToolkit . WinUI . UI ;
5- using Microsoft . UI . Input ;
65using Microsoft . UI . Xaml ;
76using Microsoft . UI . Xaml . Controls ;
87using Microsoft . UI . Xaml . Input ;
98using Microsoft . UI . Xaml . Shapes ;
109using Windows . ApplicationModel . DataTransfer ;
11- using Windows . Graphics ;
1210using Windows . Storage ;
1311using 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