File tree Expand file tree Collapse file tree 1 file changed +7
-18
lines changed
src/Files.App/UserControls/TabBar Expand file tree Collapse file tree 1 file changed +7
-18
lines changed Original file line number Diff line number Diff line change @@ -362,25 +362,14 @@ private void TabViewItem_Loaded(object sender, RoutedEventArgs e)
362362
363363 private void DragAreaRectangle_Loaded ( object sender , RoutedEventArgs e )
364364 {
365- if ( HorizontalTabView . ActualWidth > 0 && TabBarAddNewTabButton . Width > 0 )
366- {
367- var appWindow = MainWindow . Instance . AppWindow ;
368- var titleBarInset = ( FilePropertiesHelpers . FlowDirectionSettingIsRightToLeft
369- ? appWindow . TitleBar . LeftInset
370- : appWindow . TitleBar . RightInset ) / DragAreaRectangle . XamlRoot . RasterizationScale ;
371-
372- if ( titleBarInset > 0 )
373- {
374- titleBarInset += 40 ; // Add 40px gap
375- RightPaddingColumn . Width = new ( titleBarInset ) ;
376-
377- HorizontalTabView . Measure ( new (
378- HorizontalTabView . ActualWidth - TabBarAddNewTabButton . Width - titleBarInset ,
379- HorizontalTabView . ActualHeight ) ) ;
365+ double scaleAdjustment = DragAreaRectangle . XamlRoot . RasterizationScale ;
366+ double titleBarInset = ( ( FilePropertiesHelpers . FlowDirectionSettingIsRightToLeft
367+ ? MainWindow . Instance . AppWindow . TitleBar . LeftInset
368+ : MainWindow . Instance . AppWindow . TitleBar . RightInset ) / scaleAdjustment ) + 40 ;
380369
381- return ;
382- }
383- }
370+ HorizontalTabView . Measure ( new ( HorizontalTabView . ActualWidth - TabBarAddNewTabButton . Width - titleBarInset , HorizontalTabView . ActualHeight ) ) ;
371+ RightPaddingColumn . Width = new ( titleBarInset >= 0 ? titleBarInset : 0 ) ;
372+ }
384373
385374 DispatcherQueue . TryEnqueue ( ( ) => DragAreaRectangle_Loaded ( sender , e ) ) ;
386375 }
You can’t perform that action at this time.
0 commit comments