Skip to content

Code Quality: Connected drag events to Omnibar #17245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 6, 2025
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
7 changes: 6 additions & 1 deletion src/Files.App/UserControls/NavigationToolbar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 +384,15 @@
<controls:BreadcrumbBar.ItemTemplate>
<DataTemplate x:DataType="dataitems:PathBoxItem">
<controls:BreadcrumbBarItem
AllowDrop="True"
AutomationProperties.AccessibilityView="Content"
AutomationProperties.Name="{x:Bind Title, Mode=OneWay}"
ChevronToolTip="{helpers:ResourceString Name=BreadcrumbBarChevronButtonToolTip}"
Content="{x:Bind Title, Mode=OneWay}" />
Content="{x:Bind Title, Mode=OneWay}"
DataContext="{x:Bind}"
DragLeave="BreadcrumbBarItem_DragLeave"
DragOver="BreadcrumbBarItem_DragOver"
Drop="BreadcrumbBarItem_Drop" />
</DataTemplate>
</controls:BreadcrumbBar.ItemTemplate>
</controls:BreadcrumbBar>
Expand Down
15 changes: 15 additions & 0 deletions src/Files.App/UserControls/NavigationToolbar.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -461,5 +461,20 @@ private void NavigationButtonOverflowFlyoutButton_LosingFocus(UIElement sender,
if (args.NewFocusedElement is TextBox)
args.Cancel = true;
}

private void BreadcrumbBarItem_DragLeave(object sender, DragEventArgs e)
{
ViewModel.PathBoxItem_DragLeave(sender, e);
}

private async void BreadcrumbBarItem_DragOver(object sender, DragEventArgs e)
{
await ViewModel.PathBoxItem_DragOver(sender, e);
}

private async void BreadcrumbBarItem_Drop(object sender, DragEventArgs e)
{
await ViewModel.PathBoxItem_Drop(sender, e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ private void UserSettingsService_OnSettingChangedEvent(object? sender, SettingCh

public void PathBoxItem_DragLeave(object sender, DragEventArgs e)
{
if (((StackPanel)sender).DataContext is not PathBoxItem pathBoxItem ||
if (((FrameworkElement)sender).DataContext is not PathBoxItem pathBoxItem ||
pathBoxItem.Path == "Home" ||
pathBoxItem.Path == "ReleaseNotes" ||
pathBoxItem.Path == "Settings")
Expand All @@ -490,7 +490,7 @@ public async Task PathBoxItem_Drop(object sender, DragEventArgs e)
// Reset dragged over pathbox item
_dragOverPath = null;

if (((StackPanel)sender).DataContext is not PathBoxItem pathBoxItem ||
if (((FrameworkElement)sender).DataContext is not PathBoxItem pathBoxItem ||
pathBoxItem.Path == "Home" ||
pathBoxItem.Path == "ReleaseNotes" ||
pathBoxItem.Path == "Settings")
Expand Down Expand Up @@ -521,7 +521,7 @@ public async Task PathBoxItem_Drop(object sender, DragEventArgs e)
public async Task PathBoxItem_DragOver(object sender, DragEventArgs e)
{
if (IsSingleItemOverride ||
((StackPanel)sender).DataContext is not PathBoxItem pathBoxItem ||
((FrameworkElement)sender).DataContext is not PathBoxItem pathBoxItem ||
pathBoxItem.Path == "Home" ||
pathBoxItem.Path == "ReleaseNotes" ||
pathBoxItem.Path == "Settings")
Expand Down
Loading