Skip to content
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

Fix: Added tooltip to the eject button #13554

Merged
merged 5 commits into from
Oct 25, 2023
Merged
Changes from 3 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
9 changes: 7 additions & 2 deletions src/Files.App/Data/Items/DriveItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ public FrameworkElement? ItemDecorator
{
if (!IsRemovable)
return null; // Removable items don't need the eject button

var itemDecorator = new Button()
{
Style = Application.Current.Resources["SidebarEjectButtonStyle"] as Style,
Expand All @@ -214,12 +215,16 @@ public FrameworkElement? ItemDecorator
Width = 16
}
};
itemDecorator.Click += ItemDecorator_ClickAsync;

ToolTipService.SetToolTip(itemDecorator, "SideBarEjectDevice/Text".GetLocalizedResource());
yaira2 marked this conversation as resolved.
Show resolved Hide resolved

itemDecorator.Click += ItemDecorator_Click;

return itemDecorator;
}
}

private async void ItemDecorator_ClickAsync(object sender, RoutedEventArgs e)
private async void ItemDecorator_Click(object sender, RoutedEventArgs e)
yaira2 marked this conversation as resolved.
Show resolved Hide resolved
{
var result = await DriveHelpers.EjectDeviceAsync(Path);
await UIHelpers.ShowDeviceEjectResultAsync(Type, result);
Expand Down