Added a setting to change the size of the interface (#1136)

Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
Paul KoudelkaandThorsten Sommer authored and GitHub committed 2026-10-30 20:01:57 +01:00
1 parent c2b62c6dbd
commit e0337a99bc
27 files changed
+1742 -27

No files matched your search

@@ -1,3 +1,4 @@
using System.Globalization;
using System.Numerics;
using Microsoft.AspNetCore.Components;
@@ -42,6 +43,22 @@ public partial class ConfigurationSlider<T> : ConfigurationBaseCore where T : st
[Parameter]
public Action<T> ValueUpdate { get; set; } = _ => { };
/// <summary>
/// Whether the option changes while the user drags the slider, or only once they release it.
/// </summary>
/// <remarks>
/// Defaults to true. An option which changes the layout of the page, such as the interface size,
/// should wait for the release: a page which changes under the pointer moves the slider away from
/// it. The slider shows the value it is dragged to either way.
/// </remarks>
[Parameter]
public bool Immediate { get; set; } = true;
/// <summary>
/// The value the user drags the slider to, while the option waits for the release, see Immediate.
/// </summary>
private T? draggedValue;
#region Overrides of ConfigurationBase
/// <inheritdoc />
@@ -72,10 +89,24 @@ public partial class ConfigurationSlider<T> : ConfigurationBaseCore where T : st
private async Task OptionChanged(T updatedValue)
{
this.draggedValue = null;
this.ValueUpdate(updatedValue);
await this.SettingsManager.StoreSettings();
await this.InformAboutChange();
}
/// <summary>
/// Shows the value the user drags the slider to, while the option waits for the release.
/// </summary>
private void ShowDraggedValue(ChangeEventArgs args)
{
if (this.Immediate)
return;
// The range input reports its value with a dot as decimal separator, whatever the language:
if (T.TryParse(args.Value?.ToString(), CultureInfo.InvariantCulture, out var value))
this.draggedValue = value;
}
private async Task EnsureMinMax()
{