mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Visual init on startup https://github.com/seerge/g-helper/issues/2185
This commit is contained in:
@@ -13,6 +13,8 @@ namespace GHelper.Display
|
|||||||
|
|
||||||
public enum SplendidCommand : int
|
public enum SplendidCommand : int
|
||||||
{
|
{
|
||||||
|
None = -1,
|
||||||
|
|
||||||
Init = 10,
|
Init = 10,
|
||||||
DimmingAsus = 9,
|
DimmingAsus = 9,
|
||||||
DimmingVisual = 19,
|
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;
|
int balance = mode == SplendidCommand.Eyecare ? 2 : whiteBalance;
|
||||||
if (RunSplendid(mode, 0, balance)) return;
|
if (RunSplendid(mode, 0, balance)) return;
|
||||||
|
|
||||||
|
|||||||
@@ -285,11 +285,15 @@ namespace GHelper
|
|||||||
panelGamma.Visible = true;
|
panelGamma.Visible = true;
|
||||||
tableVisual.Visible = true;
|
tableVisual.Visible = true;
|
||||||
|
|
||||||
|
var visualValue = (SplendidCommand)AppConfig.Get("visual", (int)SplendidCommand.Default);
|
||||||
|
|
||||||
comboVisual.DropDownStyle = ComboBoxStyle.DropDownList;
|
comboVisual.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
comboVisual.DataSource = new BindingSource(VisualControl.GetVisualModes(), null);
|
comboVisual.DataSource = new BindingSource(VisualControl.GetVisualModes(), null);
|
||||||
comboVisual.DisplayMember = "Value";
|
comboVisual.DisplayMember = "Value";
|
||||||
comboVisual.ValueMember = "Key";
|
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.SelectedValueChanged += ComboVisual_SelectedValueChanged;
|
||||||
comboVisual.Visible = true;
|
comboVisual.Visible = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user