File tree Expand file tree Collapse file tree 1 file changed +20
-6
lines changed
src/Files.App/UserControls/TabBar Expand file tree Collapse file tree 1 file changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -360,13 +360,27 @@ private void TabViewItem_Loaded(object sender, RoutedEventArgs e)
360360
361361 private void DragAreaRectangle_Loaded ( object sender , RoutedEventArgs e )
362362 {
363- var scaleAdjustment = DragAreaRectangle . XamlRoot . RasterizationScale ;
364- var titleBarInset = ( ( FilePropertiesHelpers . FlowDirectionSettingIsRightToLeft
365- ? MainWindow . Instance . AppWindow . TitleBar . LeftInset
366- : MainWindow . Instance . AppWindow . TitleBar . RightInset ) / scaleAdjustment ) + 40 ;
363+ if ( HorizontalTabView . ActualWidth > 0 && TabBarAddNewTabButton . Width > 0 )
364+ {
365+ var appWindow = MainWindow . Instance . AppWindow ;
366+ var titleBarInset = ( FilePropertiesHelpers . FlowDirectionSettingIsRightToLeft
367+ ? appWindow . TitleBar . LeftInset
368+ : appWindow . TitleBar . RightInset ) / DragAreaRectangle . XamlRoot . RasterizationScale ;
369+
370+ if ( titleBarInset > 0 )
371+ {
372+ titleBarInset += 40 ; // Add 40px gap
373+ RightPaddingColumn . Width = new ( titleBarInset ) ;
374+
375+ HorizontalTabView . Measure ( new (
376+ HorizontalTabView . ActualWidth - TabBarAddNewTabButton . Width - titleBarInset ,
377+ HorizontalTabView . ActualHeight ) ) ;
378+
379+ return ;
380+ }
381+ }
367382
368- HorizontalTabView . Measure ( new ( HorizontalTabView . ActualWidth - TabBarAddNewTabButton . Width - titleBarInset , HorizontalTabView . ActualHeight ) ) ;
369- RightPaddingColumn . Width = new ( titleBarInset ) ;
383+ DispatcherQueue . TryEnqueue ( ( ) => DragAreaRectangle_Loaded ( sender , e ) ) ;
370384 }
371385 }
372386}
You can’t perform that action at this time.
0 commit comments