Remove "Link all monitor brightness" feature

Eliminates the UI and backend logic for synchronizing all monitor brightness levels. Refactors monitor list update logic to distinguish between initial load and refresh, introducing RestoreMonitorSettings for startup state restoration. Streamlines feature visibility application and settings handling for improved maintainability.
This commit is contained in:
Yu Leng
2025-12-10 11:42:23 +08:00
parent 97560ea6c0
commit 102077a29b
6 changed files with 40 additions and 166 deletions

View File

@@ -182,28 +182,6 @@ namespace PowerDisplay.Helpers
(mon, val) => mon.UpdateStatus(val, true),
cancellationToken);
/// <summary>
/// Set brightness of all monitors
/// </summary>
public async Task<IEnumerable<MonitorOperationResult>> SetAllBrightnessAsync(int brightness, CancellationToken cancellationToken = default)
{
var tasks = _monitors
.Where(m => m.IsAvailable)
.Select(async monitor =>
{
try
{
return await SetBrightnessAsync(monitor.Id, brightness, cancellationToken);
}
catch (Exception ex)
{
return MonitorOperationResult.Failure($"Failed to set brightness for {monitor.Name}: {ex.Message}");
}
});
return await Task.WhenAll(tasks);
}
/// <summary>
/// Set contrast of the specified monitor
/// </summary>