This commit is contained in:
Serge
2024-03-09 11:28:08 +01:00
parent 24067a2c96
commit f04d06815e
2 changed files with 11 additions and 2 deletions

View File

@@ -13,6 +13,8 @@ namespace GHelper.Display
public enum SplendidCommand : int
{
None = -1,
Init = 10,
DimmingAsus = 9,
DimmingVisual = 19,
@@ -108,8 +110,11 @@ namespace GHelper.Display
}
}
public static void SetVisual(SplendidCommand mode = SplendidCommand.Default, int whiteBalance = 50)
public static void SetVisual(SplendidCommand mode = SplendidCommand.Default, int whiteBalance = 50, bool init = false)
{
if (mode == SplendidCommand.None) return;
if (mode == SplendidCommand.Default && init) return; // Skip default setting on init
int balance = mode == SplendidCommand.Eyecare ? 2 : whiteBalance;
if (RunSplendid(mode, 0, balance)) return;

View File

@@ -285,11 +285,15 @@ namespace GHelper
panelGamma.Visible = true;
tableVisual.Visible = true;
var visualValue = (SplendidCommand)AppConfig.Get("visual", (int)SplendidCommand.Default);
comboVisual.DropDownStyle = ComboBoxStyle.DropDownList;
comboVisual.DataSource = new BindingSource(VisualControl.GetVisualModes(), null);
comboVisual.DisplayMember = "Value";
comboVisual.ValueMember = "Key";
comboVisual.SelectedValue = (SplendidCommand)AppConfig.Get("visual", (int)SplendidCommand.Default);
comboVisual.SelectedValue = visualValue;
VisualControl.SetVisual(mode : visualValue, init : true);
comboVisual.SelectedValueChanged += ComboVisual_SelectedValueChanged;
comboVisual.Visible = true;