mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Reset Gamut dropdown to default on Dimming change https://github.com/seerge/g-helper/issues/2543
This commit is contained in:
@@ -51,6 +51,8 @@ namespace GHelper.Display
|
||||
public const int DefaultColorTemp = 50;
|
||||
|
||||
public static bool forceVisual = false;
|
||||
public static bool skipGamut = false;
|
||||
|
||||
static VisualControl()
|
||||
{
|
||||
brightnessTimer.Elapsed += BrightnessTimerTimer_Elapsed;
|
||||
@@ -169,6 +171,7 @@ namespace GHelper.Display
|
||||
|
||||
public static void SetGamut(int mode = -1)
|
||||
{
|
||||
if (skipGamut) return;
|
||||
if (mode < 0) mode = (int)GetDefaultGamut();
|
||||
|
||||
AppConfig.Set("gamut", mode);
|
||||
@@ -198,7 +201,8 @@ namespace GHelper.Display
|
||||
|
||||
int? balance;
|
||||
|
||||
switch (mode) {
|
||||
switch (mode)
|
||||
{
|
||||
case SplendidCommand.Eyecare:
|
||||
balance = 2;
|
||||
break;
|
||||
@@ -296,10 +300,23 @@ namespace GHelper.Display
|
||||
brightnessTimer.Start();
|
||||
|
||||
Program.settingsForm.VisualiseBrightness();
|
||||
if (brightness < 100) ResetGamut();
|
||||
|
||||
return _brightness;
|
||||
}
|
||||
|
||||
public static void ResetGamut()
|
||||
{
|
||||
int defaultGamut = (int)GetDefaultGamut();
|
||||
|
||||
if (AppConfig.Get("gamut") != defaultGamut)
|
||||
{
|
||||
skipGamut = true;
|
||||
AppConfig.Set("gamut", defaultGamut);
|
||||
Program.settingsForm.VisualiseGamut();
|
||||
skipGamut = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void SetGamma(int brightness = 100)
|
||||
|
||||
@@ -443,6 +443,14 @@ namespace GHelper
|
||||
});
|
||||
}
|
||||
|
||||
public void VisualiseGamut()
|
||||
{
|
||||
Invoke(delegate
|
||||
{
|
||||
if (comboGamut.Items.Count > 0) comboGamut.SelectedIndex = 0;
|
||||
});
|
||||
}
|
||||
|
||||
private void SliderGamma_ValueChanged(object? sender, EventArgs e)
|
||||
{
|
||||
if (sliderGammaIgnore) return;
|
||||
|
||||
Reference in New Issue
Block a user