11// Copyright (c) 2023 Files Community
22// Licensed under the MIT License. See the LICENSE.
33
4- using Files . App . Services ;
5- using Files . App . UserControls . Widgets ;
6-
74namespace Files . App . Actions
85{
9- internal class UnpinItemAction : ObservableObject , IAction
6+ internal sealed class UnpinFolderFromSidebarAction : ObservableObject , IAction
107 {
118 private readonly IContentPageContext context ;
12-
139 private readonly IQuickAccessService service ;
1410
1511 public string Label
16- => "UnpinFromFavorites " . GetLocalizedResource ( ) ;
12+ => "UnpinFolderFromSidebar " . GetLocalizedResource ( ) ;
1713
1814 public string Description
19- => "UnpinItemFromFavoritesDescription " . GetLocalizedResource ( ) ;
15+ => "UnpinFolderFromSidebarDescription " . GetLocalizedResource ( ) ;
2016
2117 public RichGlyph Glyph
22- => new ( opacityStyle : "ColorIconUnpinFromFavorites " ) ;
18+ => new ( opacityStyle : "Icons.Unpin.16x16 " ) ;
2319
2420 public bool IsExecutable
2521 => GetIsExecutable ( ) ;
2622
27- public UnpinItemAction ( )
23+ public UnpinFolderFromSidebarAction ( )
2824 {
2925 context = Ioc . Default . GetRequiredService < IContentPageContext > ( ) ;
3026 service = Ioc . Default . GetRequiredService < IQuickAccessService > ( ) ;
@@ -48,15 +44,15 @@ public async Task ExecuteAsync()
4844
4945 private bool GetIsExecutable ( )
5046 {
51- string [ ] favorites = App . QuickAccessManager . Model . FavoriteItems . ToArray ( ) ;
47+ string [ ] pinnedFolders = App . QuickAccessManager . Model . PinnedFolders . ToArray ( ) ;
5248
5349 return context . HasSelection
5450 ? context . SelectedItems . All ( IsPinned )
5551 : context . Folder is not null && IsPinned ( context . Folder ) ;
5652
5753 bool IsPinned ( ListedItem item )
5854 {
59- return favorites . Contains ( item . ItemPath ) ;
55+ return pinnedFolders . Contains ( item . ItemPath ) ;
6056 }
6157 }
6258
0 commit comments