Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Files.App/UserControls/TabBar/TabBar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@
Grid.ColumnSpan="2"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Fill="Transparent" />
Fill="Transparent"
Loaded="DragAreaRectangle_Loaded" />

</Grid>
</TabView.TabStripFooter>
Expand Down
22 changes: 12 additions & 10 deletions src/Files.App/UserControls/TabBar/TabBar.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,6 @@ public TabBar()
tabHoverTimer.Interval = TimeSpan.FromMilliseconds(Constants.DragAndDrop.HoverToOpenTimespan);
tabHoverTimer.Tick += TabHoverSelected;

var appWindow = MainWindow.Instance.AppWindow;

double rightPaddingColumnWidth =
FilePropertiesHelpers.FlowDirectionSettingIsRightToLeft
? appWindow.TitleBar.LeftInset
: appWindow.TitleBar.RightInset;

RightPaddingColumn.Width = new(rightPaddingColumnWidth >= 0 ? rightPaddingColumnWidth : 0);

AppearanceSettingsService.PropertyChanged += (s, e) =>
{
switch (e.PropertyName)
Expand Down Expand Up @@ -366,5 +357,16 @@ private void TabViewItem_Loaded(object sender, RoutedEventArgs e)
});
}
}

private void DragAreaRectangle_Loaded(object sender, RoutedEventArgs e)
{
double scaleAdjustment = DragAreaRectangle.XamlRoot.RasterizationScale;
double titleBarInset = ((FilePropertiesHelpers.FlowDirectionSettingIsRightToLeft
? MainWindow.Instance.AppWindow.TitleBar.LeftInset
: MainWindow.Instance.AppWindow.TitleBar.RightInset) / scaleAdjustment) + 40;

HorizontalTabView.Measure(new(HorizontalTabView.ActualWidth - TabBarAddNewTabButton.Width - titleBarInset, HorizontalTabView.ActualHeight));
RightPaddingColumn.Width = new(titleBarInset >= 0 ? titleBarInset : 0);
}
}
}
}
2 changes: 1 addition & 1 deletion src/Files.App/Views/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -487,4 +487,4 @@ private void PaneSplitter_ManipulationStarted(object sender, ManipulationStarted
InputSystemCursorShape.SizeWestEast : InputSystemCursorShape.SizeNorthSouth));
}
}
}
}