Skip to content

Commit f9c0d6b

Browse files
committed
Update DetailsLayoutPage.xaml.cs
1 parent e962ee7 commit f9c0d6b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/Files.App/Views/Layouts/DetailsLayoutPage.xaml.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public sealed partial class DetailsLayoutPage : BaseGroupableLayoutPage
2929
// Fields
3030

3131
private ListedItem? _nextItemToSelect;
32+
private uint currentIconSize;
3233

3334
// Properties
3435

@@ -136,6 +137,8 @@ protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
136137

137138
base.OnNavigatedTo(eventArgs);
138139

140+
currentIconSize = FolderSettings.GetRoundedIconSize();
141+
139142
if (FolderSettings?.ColumnsViewModel is not null)
140143
{
141144
ColumnsViewModel.DateCreatedColumn = FolderSettings.ColumnsViewModel.DateCreatedColumn;
@@ -206,8 +209,13 @@ private async void LayoutSettingsService_PropertyChanged(object? sender, Propert
206209
// Restore correct scroll position
207210
ContentScroller?.ChangeView(null, previousOffset, null);
208211

209-
// Reload icons with correct size
210-
await ReloadItemIconsAsync();
212+
// Reload icons with correct size but only if the size changed
213+
var requestedIconSize = FolderSettings.GetRoundedIconSize();
214+
if (requestedIconSize != currentIconSize)
215+
{
216+
currentIconSize = requestedIconSize;
217+
_ = ReloadItemIconsAsync();
218+
}
211219
}
212220
else
213221
{

0 commit comments

Comments
 (0)