Compare commits

...

1 Commits

Author SHA1 Message Date
Niels Laute
38aa3d8328 [CmdPal] Rename DockSettings.DockSize to BandSize for safe upgrade
The Compact Mode PR (#46699) replaced the DockSize enum (Small/Medium/Large)
with a new one (Default/Compact). Existing settings.json files contain a
legacy 'DockSize: Small' value which the source-generated EnumConverter
cannot parse, causing the entire settings file to fail loading.

Rename the persisted property to BandSize so the old key becomes an unknown
property (silently ignored by System.Text.Json) and the new property starts
at its default (DockSize.Default), preserving the user's existing visual
experience after upgrading.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-25 17:19:09 +02:00
4 changed files with 5 additions and 5 deletions

View File

@@ -18,7 +18,7 @@ public record DockSettings
{
public DockSide Side { get; init; } = DockSide.Top;
public DockSize DockSize { get; init; } = DockSize.Default;
public DockSize BandSize { get; init; } = DockSize.Default;
public bool AlwaysOnTop { get; set; } = true;

View File

@@ -201,10 +201,10 @@ public partial class SettingsViewModel : INotifyPropertyChanged
public DockSize Dock_DockSize
{
get => _settingsService.Settings.DockSettings.DockSize;
get => _settingsService.Settings.DockSettings.BandSize;
set
{
_settingsService.UpdateSettings(s => s with { DockSettings = s.DockSettings with { DockSize = value } });
_settingsService.UpdateSettings(s => s with { DockSettings = s.DockSettings with { BandSize = value } });
}
}

View File

@@ -245,7 +245,7 @@ public sealed partial class DockControl : UserControl, IRecipient<CloseContextMe
// Compact mode is only supported for Top/Bottom positions
var isHorizontal = settings.Side == DockSide.Top || settings.Side == DockSide.Bottom;
var effectiveSize = isHorizontal ? settings.DockSize : DockSize.Default;
var effectiveSize = isHorizontal ? settings.BandSize : DockSize.Default;
DockSize = effectiveSize;
ItemsOrientation = isHorizontal ? Orientation.Horizontal : Orientation.Vertical;

View File

@@ -449,7 +449,7 @@ public sealed partial class DockWindow : WindowEx,
private static DockSize EffectiveDockSize(DockSettings settings)
{
var isHorizontal = settings.Side == DockSide.Top || settings.Side == DockSide.Bottom;
return isHorizontal ? settings.DockSize : DockSize.Default;
return isHorizontal ? settings.BandSize : DockSize.Default;
}
private void UpdateAppBarDataForEdge(DockSide side, DockSize size, double scaleFactor)