Skip to content

Commit 184882e

Browse files
authored
Fix: Fixed layout mode icon not reflecting current folder layout (#12897)
1 parent dcc849d commit 184882e

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public Task ExecuteAsync()
175175
private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e)
176176
{
177177
if (e.PropertyName is nameof(IDisplayPageContext.LayoutType))
178-
OnContextChanged(nameof(IsOn));
178+
OnPropertyChanged(nameof(IsOn));
179179

180180
if (e.PropertyName is not null)
181181
OnContextChanged(e.PropertyName);

src/Files.App/Commands/Manager/CommandManager.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -465,11 +465,11 @@ public Task ExecuteAsync()
465465
{
466466
if (IsExecutable)
467467
{
468-
Analytics.TrackEvent($"Triggered {Code} action");
469-
return Action.ExecuteAsync();
470-
}
468+
Analytics.TrackEvent($"Triggered {Code} action");
469+
return Action.ExecuteAsync();
470+
}
471471

472-
return Task.CompletedTask;
472+
return Task.CompletedTask;
473473
}
474474

475475
public async void ExecuteTapped(object sender, TappedRoutedEventArgs e) => await ExecuteAsync();

src/Files.App/Contexts/DisplayPage/DisplayPageContext.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ private void FolderSettings_PropertyChanged(object? sender, PropertyChangedEvent
160160
{
161161
case nameof(FolderSettingsViewModel.LayoutMode):
162162
case nameof(FolderSettingsViewModel.GridViewSize):
163+
case nameof(FolderSettingsViewModel.IsAdaptiveLayoutEnabled):
163164
SetProperty(ref _LayoutType, GetLayoutType(), nameof(LayoutType));
164165
break;
165166
case nameof(FolderSettingsViewModel.DirectorySortOption):

src/Files.App/UserControls/InnerNavigationToolbar.xaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,7 @@
643643
AutomationProperties.Name="{x:Bind Commands.LayoutDetails.AutomationName}"
644644
Command="{x:Bind Commands.LayoutDetails}"
645645
CornerRadius="{StaticResource ControlCornerRadius}"
646+
GroupName="LayoutRadio"
646647
IsChecked="{x:Bind Commands.LayoutDetails.IsOn, Mode=OneWay}"
647648
Style="{StaticResource DefaultToggleButtonStyle}"
648649
ToolTipService.ToolTip="{x:Bind Commands.LayoutDetails.LabelWithHotKey, Mode=OneWay}">
@@ -674,6 +675,7 @@
674675
AutomationProperties.Name="{x:Bind Commands.LayoutTiles.AutomationName}"
675676
Command="{x:Bind Commands.LayoutTiles}"
676677
CornerRadius="{StaticResource ControlCornerRadius}"
678+
GroupName="LayoutRadio"
677679
IsChecked="{x:Bind Commands.LayoutTiles.IsOn, Mode=OneWay}"
678680
Style="{StaticResource DefaultToggleButtonStyle}"
679681
ToolTipService.ToolTip="{x:Bind Commands.LayoutTiles.LabelWithHotKey, Mode=OneWay}">
@@ -705,6 +707,7 @@
705707
AutomationProperties.Name="{x:Bind Commands.LayoutGridSmall.AutomationName}"
706708
Command="{x:Bind Commands.LayoutGridSmall}"
707709
CornerRadius="{StaticResource ControlCornerRadius}"
710+
GroupName="LayoutRadio"
708711
IsChecked="{x:Bind Commands.LayoutGridSmall.IsOn, Mode=OneWay}"
709712
Style="{StaticResource DefaultToggleButtonStyle}"
710713
ToolTipService.ToolTip="{x:Bind Commands.LayoutGridSmall.LabelWithHotKey, Mode=OneWay}">
@@ -736,6 +739,7 @@
736739
AutomationProperties.Name="{x:Bind Commands.LayoutGridMedium.AutomationName}"
737740
Command="{x:Bind Commands.LayoutGridMedium}"
738741
CornerRadius="{StaticResource ControlCornerRadius}"
742+
GroupName="LayoutRadio"
739743
IsChecked="{x:Bind Commands.LayoutGridMedium.IsOn, Mode=OneWay}"
740744
Style="{StaticResource DefaultToggleButtonStyle}"
741745
ToolTipService.ToolTip="{x:Bind Commands.LayoutGridMedium.LabelWithHotKey, Mode=OneWay}">
@@ -777,6 +781,7 @@
777781
AutomationProperties.Name="{x:Bind Commands.LayoutGridLarge.AutomationName}"
778782
Command="{x:Bind Commands.LayoutGridLarge}"
779783
CornerRadius="{StaticResource ControlCornerRadius}"
784+
GroupName="LayoutRadio"
780785
IsChecked="{x:Bind Commands.LayoutGridLarge.IsOn, Mode=OneWay}"
781786
Style="{StaticResource DefaultToggleButtonStyle}"
782787
ToolTipService.ToolTip="{x:Bind Commands.LayoutGridLarge.LabelWithHotKey, Mode=OneWay}">
@@ -808,6 +813,7 @@
808813
AutomationProperties.Name="{x:Bind Commands.LayoutColumns.AutomationName}"
809814
Command="{x:Bind Commands.LayoutColumns}"
810815
CornerRadius="{StaticResource ControlCornerRadius}"
816+
GroupName="LayoutRadio"
811817
IsChecked="{x:Bind Commands.LayoutColumns.IsOn, Mode=OneWay}"
812818
Style="{StaticResource DefaultToggleButtonStyle}"
813819
ToolTipService.ToolTip="{x:Bind Commands.LayoutColumns.LabelWithHotKey, Mode=OneWay}">
@@ -894,16 +900,10 @@
894900
Grid.Column="1"
895901
HorizontalAlignment="Right"
896902
AutomationProperties.Name="{x:Bind Commands.LayoutAdaptive.AutomationName}"
897-
IsOn="{x:Bind Commands.LayoutAdaptive.IsOn, Mode=OneWay}"
903+
IsOn="{x:Bind Commands.LayoutAdaptive.IsOn, Mode=TwoWay}"
898904
Rotation="1"
899905
Style="{StaticResource RightAlignedToggleSwitchStyle}"
900-
ToolTipService.ToolTip="{x:Bind Commands.LayoutAdaptive.LabelWithHotKey, Mode=OneWay}">
901-
<i:Interaction.Behaviors>
902-
<icore:EventTriggerBehavior EventName="Toggled">
903-
<icore:InvokeCommandAction Command="{x:Bind Commands.LayoutAdaptive}" />
904-
</icore:EventTriggerBehavior>
905-
</i:Interaction.Behaviors>
906-
</ToggleSwitch>
906+
ToolTipService.ToolTip="{x:Bind Commands.LayoutAdaptive.LabelWithHotKey, Mode=OneWay}" />
907907

908908
</Grid>
909909

0 commit comments

Comments
 (0)