Skip to content

Commit c9691aa

Browse files
workbysaranyaira2
authored andcommitted
Fix: Fixed an issue where using Column View in the Recycle Bin caused unexpected behavior with file system hierarchy display. The Columns layout is now disabled when viewing the Recycle Bin to prevent navigation issues.
1 parent 5ddc007 commit c9691aa

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/Files.App/Actions/Display/LayoutAction.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ public override HotKey HotKey
8282
[GeneratedRichCommand]
8383
internal sealed partial class LayoutColumnsAction : ToggleLayoutAction
8484
{
85+
private readonly IContentPageContext ContentPageContext = Ioc.Default.GetRequiredService<IContentPageContext>();
86+
8587
protected override LayoutTypes LayoutType
8688
=> LayoutTypes.Columns;
8789

@@ -96,6 +98,24 @@ public override RichGlyph Glyph
9698

9799
public override HotKey HotKey
98100
=> new(Keys.Number5, KeyModifiers.CtrlShift);
101+
102+
public override bool IsExecutable
103+
=> ContentPageContext.PageType is not ContentPageTypes.RecycleBin;
104+
105+
public LayoutColumnsAction()
106+
{
107+
ContentPageContext.PropertyChanged += ContentPageContext_PropertyChanged;
108+
}
109+
110+
private void ContentPageContext_PropertyChanged(object? sender, PropertyChangedEventArgs e)
111+
{
112+
switch (e.PropertyName)
113+
{
114+
case nameof(IContentPageContext.PageType):
115+
OnPropertyChanged(nameof(IsExecutable));
116+
break;
117+
}
118+
}
99119
}
100120

101121
[GeneratedRichCommand]

0 commit comments

Comments
 (0)