Skip to content
6 changes: 6 additions & 0 deletions src/Files.App/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<Application.Resources>
<ResourceDictionary>

<x:Boolean x:Key="App.ScrollInertiaEnabled">True</x:Boolean>

<!-- Fix caption buttons background -->
<SolidColorBrush x:Key="WindowCaptionBackground" Color="Transparent" />
<SolidColorBrush x:Key="WindowCaptionBackgroundDisabled" Color="Transparent" />
Expand Down Expand Up @@ -49,6 +51,10 @@

<Style BasedOn="{StaticResource DefaultComboBoxStyle}" TargetType="uc:ComboBoxEx" />

<Style TargetType="ScrollViewer">
<Setter Property="IsScrollInertiaEnabled" Value="{ThemeResource App.ScrollInertiaEnabled}" />
</Style>

<ResourceDictionary.MergedDictionaries>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
<ResourceDictionary Source="ms-appx:///Files.App.Controls/Themes/Generic.xaml" />
Expand Down
5 changes: 5 additions & 0 deletions src/Files.App/Data/Contracts/IAppearanceSettingsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,10 @@ public interface IAppearanceSettingsService : IBaseSettingsService, INotifyPrope
/// Gets or sets a value indicating when to display the Status Center button.
/// </summary>
StatusCenterVisibility StatusCenterVisibility { get; set; }

/// <summary>
/// Gets or sets a value indicating whether smooth scrolling is enabled.
/// </summary>
bool EnableSmoothScrolling { get; set; }
}
}
6 changes: 6 additions & 0 deletions src/Files.App/Data/Contracts/IResourcesService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,11 @@ public interface IResourcesService
/// </summary>
/// <param name="contentControlThemeFontFamily"></param>
void SetAppThemeFontFamily(string contentControlThemeFontFamily);

/// <summary>
/// Overrides the XAML resource for scroll inertia enabled state
/// </summary>
/// <param name="enableScrollInertia"></param>
void SetScrollInertiaEnabled(bool enableScrollInertia);
}
}
23 changes: 23 additions & 0 deletions src/Files.App/Services/App/AppResourcesService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,23 @@ namespace Files.App.Services
public sealed class ResourcesService : IResourcesService
{
private IAppThemeModeService AppThemeModeService { get; } = Ioc.Default.GetRequiredService<IAppThemeModeService>();
private IUserSettingsService UserSettingsService { get; } = Ioc.Default.GetRequiredService<IUserSettingsService>();

public ResourcesService()
{
SetScrollInertiaEnabled(UserSettingsService.AppearanceSettingsService.EnableSmoothScrolling);

UserSettingsService.AppearanceSettingsService.PropertyChanged += AppearanceSettingsService_PropertyChanged;
}

private void AppearanceSettingsService_PropertyChanged(object? sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == nameof(IAppearanceSettingsService.EnableSmoothScrolling))
{
SetScrollInertiaEnabled(UserSettingsService.AppearanceSettingsService.EnableSmoothScrolling);
ApplyResources();
}
}

/// <inheritdoc/>
public void SetAppThemeBackgroundColor(Color appThemeBackgroundColor)
Expand Down Expand Up @@ -62,6 +79,12 @@ public void SetAppThemeFontFamily(string contentControlThemeFontFamily)
Application.Current.Resources["ContentControlThemeFontFamily"] = contentControlThemeFontFamily;
}

/// <inheritdoc/>
public void SetScrollInertiaEnabled(bool enableScrollInertia)
{
Application.Current.Resources["App.ScrollInertiaEnabled"] = enableScrollInertia;
}

/// <inheritdoc/>
public void ApplyResources()
{
Expand Down
7 changes: 7 additions & 0 deletions src/Files.App/Services/Settings/AppearanceSettingsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,13 @@ public StatusCenterVisibility StatusCenterVisibility
set => Set(value);
}

/// <inheritdoc/>
public bool EnableSmoothScrolling
Copy link
Member

@0x5bfa 0x5bfa Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe IsScrollInertiaEnabled to align with the name in the codebase?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SmoothScrolling is more understandable.

{
get => Get(true);
set => Set(value);
}

protected override void RaiseOnSettingChangedEvent(object sender, SettingChangedEventArgs e)
{
base.RaiseOnSettingChangedEvent(sender, e);
Expand Down
3 changes: 3 additions & 0 deletions src/Files.App/Strings/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -4350,4 +4350,7 @@
<data name="CreateNewFile" xml:space="preserve">
<value>New {0}</value>
</data>
<data name="EnableSmoothScrolling" xml:space="preserve">
<value>Enable smooth scrolling</value>
</data>
</root>
14 changes: 14 additions & 0 deletions src/Files.App/ViewModels/Settings/AppearanceViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,20 @@ public string SelectedStatusCenterVisibilityOption
}
}

public bool EnableSmoothScrolling
{
get => UserSettingsService.AppearanceSettingsService.EnableSmoothScrolling;
set
{
if (value != UserSettingsService.AppearanceSettingsService.EnableSmoothScrolling)
{
UserSettingsService.AppearanceSettingsService.EnableSmoothScrolling = value;

OnPropertyChanged();
}
}
}

public bool IsAppEnvironmentDev
{
get => AppLifecycleHelper.AppEnvironment is AppEnvironment.Dev;
Expand Down
1 change: 0 additions & 1 deletion src/Files.App/Views/Layouts/ColumnLayoutPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@
Loaded="FileList_Loaded"
PreviewKeyDown="FileList_PreviewKeyDown"
RightTapped="FileList_RightTapped"
ScrollViewer.IsScrollInertiaEnabled="True"
SelectionChanged="FileList_SelectionChanged"
SelectionMode="Extended"
Tapped="FileList_ItemTapped">
Expand Down
11 changes: 11 additions & 0 deletions src/Files.App/Views/Settings/AppearancePage.xaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<!-- Copyright (c) Files Community. Licensed under the MIT License. -->
<Page
x:Class="Files.App.Views.Settings.AppearancePage"
Expand Down Expand Up @@ -283,6 +283,17 @@
AutomationProperties.Name="{helpers:ResourceString Name=ShowStatusBar}"
IsOn="{x:Bind ViewModel.ShowStatusBar, Mode=TwoWay}" />
</wctcontrols:SettingsCard>

<!-- Enable Smooth Scrolling -->
<wctcontrols:SettingsCard
Header="{helpers:ResourceString Name=EnableSmoothScrolling}">
<wctcontrols:SettingsCard.HeaderIcon>
<FontIcon Glyph="&#xE7C4;" />
</wctcontrols:SettingsCard.HeaderIcon>
<ToggleSwitch
AutomationProperties.Name="{helpers:ResourceString Name=EnableSmoothScrolling}"
IsOn="{x:Bind ViewModel.EnableSmoothScrolling, Mode=TwoWay}" />
</wctcontrols:SettingsCard>
</StackPanel>
</Grid>
</Page>
Loading