Use comfort for TwoPanelWidth.
Some checks failed
.NET Build / build (push) Has been cancelled

This commit is contained in:
Ottermandias 2026-02-18 18:05:32 +01:00
parent cdf9ea1b87
commit 8e7bffc8af
2 changed files with 5 additions and 21 deletions

2
Luna

@ -1 +1 @@
Subproject commit 3fa2195ba9b34c4ce21e3180bf238edb488a4d35
Subproject commit bff400eb44aeded41fb6b1b3d35948881b578737

View file

@ -17,30 +17,14 @@ public sealed partial class UiConfig : ConfigurationFile<FilenameService>
protected override void AddData(JsonTextWriter j)
{
j.WritePropertyName("CollectionsTab");
j.WriteStartObject();
j.WritePropertyName("Mode");
j.WriteValue(CollectionsTabScale.Mode.ToString());
j.WritePropertyName("Width");
j.WriteValue(CollectionsTabScale.Width);
j.WriteEndObject();
j.WritePropertyName("ModsTab");
j.WriteStartObject();
j.WritePropertyName("Mode");
j.WriteValue(ModTabScale.Mode.ToString());
j.WritePropertyName("Width");
j.WriteValue(ModTabScale.Width);
j.WriteEndObject();
CollectionsTabScale.WriteJson(j, "CollectionsTab");
ModTabScale.WriteJson(j, "ModsTab");
}
protected override void LoadData(JObject j)
{
if (j["CollectionsTab"] is JObject collections)
_collectionsTabScale = new TwoPanelWidth(collections["Width"].ValueOr(float.NaN),
collections["Mode"].TextEnum(ScalingMode.Percentage));
if (j["ModsTab"] is JObject mods)
_modTabScale = new TwoPanelWidth(mods["Width"].ValueOr(float.NaN), mods["Mode"].TextEnum(ScalingMode.Percentage));
_collectionsTabScale = TwoPanelWidth.ReadJson(j, "CollectionsTab", new TwoPanelWidth(0.25f, ScalingMode.Percentage));
_modTabScale = TwoPanelWidth.ReadJson(j, "ModsTab", new TwoPanelWidth(0.3f, ScalingMode.Percentage));
}
public override int CurrentVersion