[GUI] Add inline per-game settings and unify options styling (#728)

* [GUI] Add inline per-game settings and unify options styling

* [GUI] Update options styling & add scrollable area

* [GUI] Remove focus and pointover styles for options
This commit is contained in:
Daniel Freak
2026-07-31 12:14:21 +03:00
committed by GitHub
parent 97bd8c422e
commit a7ec3d5a77
28 changed files with 1782 additions and 772 deletions
@@ -57,4 +57,86 @@ public sealed class PerGameSettingsTests
Assert.NotNull(settings);
Assert.Equal(["SHARPEMU_TRACE", "SHARPEMU_NO_JIT"], settings.EnvironmentToggles);
}
[Fact]
public void RemoveInheritedValues_AllMatchingValues_ProducesEmptySettings()
{
var global = new GuiSettings
{
LogLevel = "Info",
ImportTraceLimit = 32,
StrictDynlibResolution = true,
LogToFile = false,
WindowMode = "Borderless",
Resolution = "2560x1440",
DisplayIndex = 1,
RefreshRate = 144,
ScalingMode = "Fit",
VSync = true,
HdrMode = "Auto",
EnvironmentToggles = ["SHARPEMU_LOG_IO", "SHARPEMU_VK_VALIDATION"],
};
var perGame = new PerGameSettings
{
LogLevel = "info",
ImportTraceLimit = 32,
StrictDynlibResolution = true,
LogToFile = false,
WindowMode = "borderless",
Resolution = "2560x1440",
DisplayIndex = 1,
RefreshRate = 144,
ScalingMode = "fit",
VSync = true,
HdrMode = "auto",
EnvironmentToggles = ["SHARPEMU_VK_VALIDATION=1", "sharpemu_log_io"],
};
perGame.RemoveInheritedValues(global);
Assert.True(perGame.IsEmpty);
}
[Fact]
public void RemoveInheritedValues_DifferentValues_RemainOverrides()
{
var global = new GuiSettings
{
LogLevel = "Info",
Resolution = "1920x1080",
VSync = true,
EnvironmentToggles = ["SHARPEMU_LOG_IO"],
};
var perGame = new PerGameSettings
{
LogLevel = "Debug",
Resolution = "2560x1440",
VSync = false,
EnvironmentToggles = ["SHARPEMU_VK_VALIDATION"],
};
perGame.RemoveInheritedValues(global);
Assert.Equal("Debug", perGame.LogLevel);
Assert.Equal("2560x1440", perGame.Resolution);
Assert.False(perGame.VSync);
Assert.Equal(["SHARPEMU_VK_VALIDATION"], perGame.EnvironmentToggles);
}
[Fact]
public void RemoveInheritedValues_DisabledEnvironmentEntry_MatchesMissingEntry()
{
var global = new GuiSettings
{
EnvironmentToggles = ["SHARPEMU_LOG_IO=0"],
};
var perGame = new PerGameSettings
{
EnvironmentToggles = [],
};
perGame.RemoveInheritedValues(global);
Assert.Null(perGame.EnvironmentToggles);
}
}