Skip to content

Fix: Fixed layout mode icon not reflecting current folder layout #12897

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 2 commits into from
Jul 9, 2023
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
2 changes: 1 addition & 1 deletion src/Files.App/Actions/Display/LayoutAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public Task ExecuteAsync()
private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e)
{
if (e.PropertyName is nameof(IDisplayPageContext.LayoutType))
OnContextChanged(nameof(IsOn));
OnPropertyChanged(nameof(IsOn));

if (e.PropertyName is not null)
OnContextChanged(e.PropertyName);
Expand Down
8 changes: 4 additions & 4 deletions src/Files.App/Commands/Manager/CommandManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -465,11 +465,11 @@ public Task ExecuteAsync()
{
if (IsExecutable)
{
Analytics.TrackEvent($"Triggered {Code} action");
return Action.ExecuteAsync();
}
Analytics.TrackEvent($"Triggered {Code} action");
return Action.ExecuteAsync();
}

return Task.CompletedTask;
return Task.CompletedTask;
}

public async void ExecuteTapped(object sender, TappedRoutedEventArgs e) => await ExecuteAsync();
Expand Down
1 change: 1 addition & 0 deletions src/Files.App/Contexts/DisplayPage/DisplayPageContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ private void FolderSettings_PropertyChanged(object? sender, PropertyChangedEvent
{
case nameof(FolderSettingsViewModel.LayoutMode):
case nameof(FolderSettingsViewModel.GridViewSize):
case nameof(FolderSettingsViewModel.IsAdaptiveLayoutEnabled):
SetProperty(ref _LayoutType, GetLayoutType(), nameof(LayoutType));
break;
case nameof(FolderSettingsViewModel.DirectorySortOption):
Expand Down
16 changes: 8 additions & 8 deletions src/Files.App/UserControls/InnerNavigationToolbar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@
AutomationProperties.Name="{x:Bind Commands.LayoutDetails.AutomationName}"
Command="{x:Bind Commands.LayoutDetails}"
CornerRadius="{StaticResource ControlCornerRadius}"
GroupName="LayoutRadio"
IsChecked="{x:Bind Commands.LayoutDetails.IsOn, Mode=OneWay}"
Style="{StaticResource DefaultToggleButtonStyle}"
ToolTipService.ToolTip="{x:Bind Commands.LayoutDetails.LabelWithHotKey, Mode=OneWay}">
Expand Down Expand Up @@ -674,6 +675,7 @@
AutomationProperties.Name="{x:Bind Commands.LayoutTiles.AutomationName}"
Command="{x:Bind Commands.LayoutTiles}"
CornerRadius="{StaticResource ControlCornerRadius}"
GroupName="LayoutRadio"
IsChecked="{x:Bind Commands.LayoutTiles.IsOn, Mode=OneWay}"
Style="{StaticResource DefaultToggleButtonStyle}"
ToolTipService.ToolTip="{x:Bind Commands.LayoutTiles.LabelWithHotKey, Mode=OneWay}">
Expand Down Expand Up @@ -705,6 +707,7 @@
AutomationProperties.Name="{x:Bind Commands.LayoutGridSmall.AutomationName}"
Command="{x:Bind Commands.LayoutGridSmall}"
CornerRadius="{StaticResource ControlCornerRadius}"
GroupName="LayoutRadio"
IsChecked="{x:Bind Commands.LayoutGridSmall.IsOn, Mode=OneWay}"
Style="{StaticResource DefaultToggleButtonStyle}"
ToolTipService.ToolTip="{x:Bind Commands.LayoutGridSmall.LabelWithHotKey, Mode=OneWay}">
Expand Down Expand Up @@ -736,6 +739,7 @@
AutomationProperties.Name="{x:Bind Commands.LayoutGridMedium.AutomationName}"
Command="{x:Bind Commands.LayoutGridMedium}"
CornerRadius="{StaticResource ControlCornerRadius}"
GroupName="LayoutRadio"
IsChecked="{x:Bind Commands.LayoutGridMedium.IsOn, Mode=OneWay}"
Style="{StaticResource DefaultToggleButtonStyle}"
ToolTipService.ToolTip="{x:Bind Commands.LayoutGridMedium.LabelWithHotKey, Mode=OneWay}">
Expand Down Expand Up @@ -777,6 +781,7 @@
AutomationProperties.Name="{x:Bind Commands.LayoutGridLarge.AutomationName}"
Command="{x:Bind Commands.LayoutGridLarge}"
CornerRadius="{StaticResource ControlCornerRadius}"
GroupName="LayoutRadio"
IsChecked="{x:Bind Commands.LayoutGridLarge.IsOn, Mode=OneWay}"
Style="{StaticResource DefaultToggleButtonStyle}"
ToolTipService.ToolTip="{x:Bind Commands.LayoutGridLarge.LabelWithHotKey, Mode=OneWay}">
Expand Down Expand Up @@ -808,6 +813,7 @@
AutomationProperties.Name="{x:Bind Commands.LayoutColumns.AutomationName}"
Command="{x:Bind Commands.LayoutColumns}"
CornerRadius="{StaticResource ControlCornerRadius}"
GroupName="LayoutRadio"
IsChecked="{x:Bind Commands.LayoutColumns.IsOn, Mode=OneWay}"
Style="{StaticResource DefaultToggleButtonStyle}"
ToolTipService.ToolTip="{x:Bind Commands.LayoutColumns.LabelWithHotKey, Mode=OneWay}">
Expand Down Expand Up @@ -894,16 +900,10 @@
Grid.Column="1"
HorizontalAlignment="Right"
AutomationProperties.Name="{x:Bind Commands.LayoutAdaptive.AutomationName}"
IsOn="{x:Bind Commands.LayoutAdaptive.IsOn, Mode=OneWay}"
IsOn="{x:Bind Commands.LayoutAdaptive.IsOn, Mode=TwoWay}"
Rotation="1"
Style="{StaticResource RightAlignedToggleSwitchStyle}"
ToolTipService.ToolTip="{x:Bind Commands.LayoutAdaptive.LabelWithHotKey, Mode=OneWay}">
<i:Interaction.Behaviors>
<icore:EventTriggerBehavior EventName="Toggled">
<icore:InvokeCommandAction Command="{x:Bind Commands.LayoutAdaptive}" />
</icore:EventTriggerBehavior>
</i:Interaction.Behaviors>
</ToggleSwitch>
ToolTipService.ToolTip="{x:Bind Commands.LayoutAdaptive.LabelWithHotKey, Mode=OneWay}" />

</Grid>

Expand Down