Allow clicking on visual-modes label to enable them again

This commit is contained in:
Serge
2024-03-27 18:11:57 +01:00
parent af7823ffe9
commit 731a6c845f
3 changed files with 12 additions and 2 deletions

View File

@@ -40,6 +40,8 @@ namespace GHelper.Display
private static System.Timers.Timer brightnessTimer = new System.Timers.Timer(200); private static System.Timers.Timer brightnessTimer = new System.Timers.Timer(200);
public const int DefaultColorTemp = 50; public const int DefaultColorTemp = 50;
public static bool forceVisual = false;
static VisualControl() static VisualControl()
{ {
brightnessTimer.Elapsed += BrightnessTimerTimer_Elapsed; brightnessTimer.Elapsed += BrightnessTimerTimer_Elapsed;
@@ -129,8 +131,8 @@ namespace GHelper.Display
if (mode == SplendidCommand.None) return; if (mode == SplendidCommand.None) return;
if (mode == SplendidCommand.Default && init) return; // Skip default setting on init if (mode == SplendidCommand.Default && init) return; // Skip default setting on init
if (ScreenCCD.GetHDRStatus(true)) return; if (!forceVisual && ScreenCCD.GetHDRStatus(true)) return;
if (ScreenNative.GetRefreshRate(ScreenNative.FindLaptopScreen(true)) < 0) return; if (!forceVisual && ScreenNative.GetRefreshRate(ScreenNative.FindLaptopScreen(true)) < 0) return;
if (whiteBalance != DefaultColorTemp && !init) ProcessHelper.RunAsAdmin(); if (whiteBalance != DefaultColorTemp && !init) ProcessHelper.RunAsAdmin();

View File

@@ -1714,6 +1714,7 @@ namespace GHelper
labelVisual.TabIndex = 42; labelVisual.TabIndex = 42;
labelVisual.Text = "Visual Modes are not available when HDR is active"; labelVisual.Text = "Visual Modes are not available when HDR is active";
labelVisual.Visible = false; labelVisual.Visible = false;
labelVisual.Cursor = Cursors.Hand;
// //
// tableVisual // tableVisual
// //

View File

@@ -256,10 +256,17 @@ namespace GHelper
VisualiseFnLock(); VisualiseFnLock();
buttonFnLock.Click += ButtonFnLock_Click; buttonFnLock.Click += ButtonFnLock_Click;
labelVisual.Click += LabelVisual_Click;
panelPerformance.Focus(); panelPerformance.Focus();
InitVisual(); InitVisual();
} }
private void LabelVisual_Click(object? sender, EventArgs e)
{
labelVisual.Visible = false;
VisualControl.forceVisual = true;
}
public void InitVisual() public void InitVisual()
{ {