Skip to content

Commit 899e49c

Browse files
committed
fix some Nvidia issues, improve color profiles, add GPU info to new UI
1 parent f42a46e commit 899e49c

File tree

30 files changed

+2082
-1689
lines changed

30 files changed

+2082
-1689
lines changed

ColorControl.UI/Components/Pages/AMD/AmdSummary.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ else
116116
<button class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#presetModal" @onclick="() => PresetOnEditClick(preset)" @onclick:preventDefault @onclick:stopPropagation>Edit</button>
117117
</span>
118118
<div class="d-lg-none" @onclick:preventDefault @onclick:stopPropagation>
119-
<button type="button" class="btn btn-outline-secondary" data-bs-toggle="dropdown" aria-expanded="false">
119+
<button type="button" class="btn btn-sm btn-outline-secondary" data-bs-toggle="dropdown" aria-expanded="false">
120120
<i class="bi bi-three-dots-vertical"></i>
121121
</button>
122122
<ul class="dropdown-menu">

ColorControl.UI/Components/Pages/ColorProfile/ColorProfilePage.razor

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@
261261
</div>
262262
<div class="modal-footer">
263263
<button type="submit" class="btn btn-primary" @onclick="InstallOnClick" disabled="@(ColorProfile == null)">Install and set as default</button>
264-
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" @onclick="() => IsVisible = false">Close</button>
264+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" @onclick="CloseOnClick">Close</button>
265265
<button type="submit" class="btn btn-primary" @onclick="ApplyClick" disabled="@(ColorProfile == null)">Save</button>
266266
</div>
267267
</div>
@@ -305,7 +305,7 @@
305305
}
306306
else
307307
{
308-
ColorProfile = await _rpcClientService.CallAsync<ColorProfileDto>("ColorProfileService", "GetColorProfile", ColorProfileName);
308+
ColorProfile = await _rpcClientService.CallAsync<ColorProfileDto>("ColorProfileService", "GetColorProfile", ColorProfileName, DisplayInfo?.IsHdrSupportedAndEnabled ?? false);
309309
}
310310

311311
if (ColorProfile != null)
@@ -390,6 +390,16 @@
390390
IsInstalled = true;
391391
}
392392

393+
private async Task CloseOnClick()
394+
{
395+
IsVisible = false;
396+
397+
if (ColorProfile != null && AfterApply != null)
398+
{
399+
await AfterApply.Invoke(ColorProfile);
400+
}
401+
}
402+
393403
private void ModalOnFocus(FocusEventArgs e)
394404
{
395405
if (!IsVisible)

ColorControl.UI/Components/Pages/ColorProfile/ColorProfileSummary.razor

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ else
210210
return;
211211
}
212212

213-
var result = await _rpcClientService.CallAsync<bool>("ColorProfileService", "SetDisplayDefaultColorProfile", SelectedDisplay.DeviceName, colorProfile);
213+
var result = await _rpcClientService.CallAsync<bool>("ColorProfileService", "SetDisplayDefaultColorProfile", SelectedDisplay.DeviceName, colorProfile, Type.Missing, SelectedDisplay.IsHdrSupportedAndEnabled);
214214
if (result)
215215
{
216216
SelectedDisplay.DefaultColorProfile = colorProfile;
@@ -250,7 +250,7 @@ else
250250
return;
251251
}
252252

253-
await _rpcClientService.CallAsync<bool>("ColorProfileService", "RemoveDisplayColorProfile", SelectedDisplay.DeviceName, SelectedColorProfileName);
253+
await _rpcClientService.CallAsync<bool>("ColorProfileService", "RemoveDisplayColorProfile", SelectedDisplay.DeviceName, SelectedColorProfileName, SelectedDisplay.IsHdrSupportedAndEnabled);
254254

255255
SelectedColorProfileName = null;
256256

@@ -265,7 +265,7 @@ else
265265
return;
266266
}
267267

268-
await _rpcClientService.CallAsync<bool>("ColorProfileService", "AddDisplayColorProfile", SelectedDisplay.DeviceName, SelectedColorProfileName, false);
268+
await _rpcClientService.CallAsync<bool>("ColorProfileService", "AddDisplayColorProfile", SelectedDisplay.DeviceName, SelectedColorProfileName, false, SelectedDisplay.IsHdrSupportedAndEnabled);
269269

270270
SelectedColorProfileName = null;
271271

ColorControl.UI/Components/Pages/Game/GamePresetPage.razor

Lines changed: 140 additions & 95 deletions
Large diffs are not rendered by default.

ColorControl.UI/Components/Pages/Game/GameSummary.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ else
7676
<button class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#presetModal" @onclick="() => PresetOnEditClick(preset)" @onclick:preventDefault @onclick:stopPropagation>Edit</button>
7777
</span>
7878
<div class="d-lg-none" @onclick:preventDefault @onclick:stopPropagation>
79-
<button type="button" class="btn btn-outline-secondary" data-bs-toggle="dropdown" aria-expanded="false">
79+
<button type="button" class="btn btn-sm btn-outline-secondary" data-bs-toggle="dropdown" aria-expanded="false">
8080
<i class="bi bi-three-dots-vertical"></i>
8181
</button>
8282
<ul class="dropdown-menu">

ColorControl.UI/Components/Pages/Generic/StepsInput.razor

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@
122122
<button type="button" class="btn btn-outline-primary dropdown-toggle text-break text-wrap" data-bs-toggle="dropdown" aria-expanded="false" data-bs-auto-close="outside">@step.Raw</button>
123123
<form class="dropdown-menu p-4 dropdown-menu-end" style="width: 200px">
124124
<div class="mb-2">
125+
<button type="button" class="btn btn-primary btn-sm" data-bs-dismiss="dropdown" title="Move left" disabled="@(stepIndex == 0)" @onclick="() => MoveLeftOnClick(stepIndex)">&lt;</button>
126+
<button type="button" class="btn btn-primary btn-sm" data-bs-dismiss="dropdown" title="Move right" disabled="@(stepIndex == PresetSteps.Count - 1)" @onclick="() => MoveRightOnClick(stepIndex)">&gt;</button>
125127
<button type="button" class="btn btn-primary btn-sm" data-bs-dismiss="dropdown" @onclick="() => RemoveOnClick(stepIndex)">Remove</button>
126128
</div>
127129
<div class="mb-2">
@@ -260,6 +262,32 @@
260262
await EmitSteps();
261263
}
262264

265+
private async Task MoveLeftOnClick(int index)
266+
{
267+
if (PresetSteps.Count > index && index > 0)
268+
{
269+
var step = PresetSteps[index];
270+
271+
PresetSteps.RemoveAt(index);
272+
PresetSteps.Insert(index - 1, step);
273+
}
274+
275+
await EmitSteps();
276+
}
277+
278+
private async Task MoveRightOnClick(int index)
279+
{
280+
if (PresetSteps.Count > index + 1)
281+
{
282+
var step = PresetSteps[index];
283+
284+
PresetSteps.RemoveAt(index);
285+
PresetSteps.Insert(index + 1, step);
286+
}
287+
288+
await EmitSteps();
289+
}
290+
263291
private async Task AfterDelayChanged()
264292
{
265293
await EmitSteps();

ColorControl.UI/Components/Pages/LG/LgSummary.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ else
178178
<button class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#presetModal" @onclick="() => PresetOnEditClick(preset)" @onclick:preventDefault @onclick:stopPropagation>Edit</button>
179179
</span>
180180
<div class="d-lg-none" @onclick:preventDefault @onclick:stopPropagation>
181-
<button type="button" class="btn btn-outline-secondary" data-bs-toggle="dropdown" aria-expanded="false">
181+
<button type="button" class="btn btn-sm btn-outline-secondary" data-bs-toggle="dropdown" aria-expanded="false">
182182
<i class="bi bi-three-dots-vertical"></i>
183183
</button>
184184
<ul class="dropdown-menu">

ColorControl.UI/Components/Pages/Nvidia/NvidiaSummary.razor

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,39 @@ else
9696
</div>
9797
}
9898

99+
<h2>Display Adapters</h2>
100+
101+
@if (GpuInfos == null)
102+
{
103+
<div>Loading...</div>
104+
}
105+
else
106+
{
107+
<div class="row mb-3">
108+
@if (!GpuInfos.Any())
109+
{
110+
<span>No display adapters found</span>
111+
}
112+
@foreach (var gpuInfo in GpuInfos)
113+
{
114+
<div class="col-lg-6 mb-3">
115+
<div class="card h-100">
116+
<div class="card-header d-flex align-items-baseline">
117+
<span>
118+
@gpuInfo.Name
119+
</span>
120+
</div>
121+
<div class="card-body">
122+
<small class="text-body">GPU: @gpuInfo.GpuFrequencyInKhz.ToUnitString() @@ @gpuInfo.VoltageInMv mV, @Utils.ToUnitString(values: [gpuInfo.GpuTemperature, gpuInfo.HotSpotTemperature])</small>
123+
<small class="text-body">Memory: @gpuInfo.GpuFrequencyInKhz.ToUnitString(), @Utils.ToUnitString(values: [gpuInfo.MemoryTemperature])</small>
124+
<small class="text-muted">Power: @(gpuInfo.PowerInWatts)W</small>
125+
</div>
126+
</div>
127+
</div>
128+
}
129+
</div>
130+
}
131+
99132
@if (Presets == null)
100133
{
101134
<div>Loading...</div>
@@ -142,7 +175,7 @@ else
142175
<button class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#presetModal" @onclick="() => PresetOnEditClick(preset)" @onclick:preventDefault @onclick:stopPropagation>Edit</button>
143176
</span>
144177
<div class="d-lg-none" @onclick:preventDefault @onclick:stopPropagation>
145-
<button type="button" class="btn btn-outline-secondary" data-bs-toggle="dropdown" aria-expanded="false">
178+
<button type="button" class="btn btn-sm btn-outline-secondary" data-bs-toggle="dropdown" aria-expanded="false">
146179
<i class="bi bi-three-dots-vertical"></i>
147180
</button>
148181
<ul class="dropdown-menu">
@@ -207,6 +240,7 @@ else
207240
@code {
208241
private List<NvPreset>? Presets;
209242
private List<NvPreset>? DisplayPresets;
243+
private List<NvGpuInfoDto>? GpuInfos;
210244

211245
private NvPreset? CurrentPreset;
212246
private NvPreset? CurrentDriverSettingsPreset;
@@ -218,6 +252,7 @@ else
218252
{
219253
await RefreshPresets();
220254
DisplayPresets = await _rpcClientService.CallAsync<List<NvPreset>>("NvService", "GetDisplayPresets");
255+
GpuInfos = await _rpcClientService.CallAsync<List<NvGpuInfoDto>>("NvService", "GetGpuInfos");
221256
}
222257

223258
protected override async Task OnAfterRenderAsync(bool firstTime)

ColorControl.UI/Components/Pages/Samsung/SamsungSummary.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ else
176176
<button class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#presetModal" @onclick="() => PresetOnEditClick(preset)" @onclick:preventDefault @onclick:stopPropagation>Edit</button>
177177
</span>
178178
<div class="d-lg-none" @onclick:preventDefault @onclick:stopPropagation>
179-
<button type="button" class="btn btn-outline-secondary" data-bs-toggle="dropdown" aria-expanded="false">
179+
<button type="button" class="btn btn-sm btn-outline-secondary" data-bs-toggle="dropdown" aria-expanded="false">
180180
<i class="bi bi-three-dots-vertical"></i>
181181
</button>
182182
<ul class="dropdown-menu">

ColorControl/ColorControl.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
<PublisherName>Maassoft</PublisherName>
1919
<Company>Maassoft</Company>
2020
<ApplicationRevision>0</ApplicationRevision>
21-
<ApplicationVersion>10.0.1.0</ApplicationVersion>
22-
<Version>10.0.1.0</Version>
21+
<ApplicationVersion>10.0.2.0</ApplicationVersion>
22+
<Version>10.0.2.0</Version>
2323
<UseApplicationTrust>false</UseApplicationTrust>
2424
<PublishWizardCompleted>true</PublishWizardCompleted>
2525
<BootstrapperEnabled>false</BootstrapperEnabled>

0 commit comments

Comments
 (0)