Backlight fixes

This commit is contained in:
Serge
2023-06-02 13:37:43 +02:00
parent 846cc6e867
commit 65b4192393
4 changed files with 19 additions and 12 deletions

View File

@@ -207,10 +207,7 @@ namespace GHelper
checkAutoApplyWindowsPowerMode.Checked = (AppConfig.getConfig("auto_apply_power_plan") != 0);
checkAutoApplyWindowsPowerMode.CheckedChanged += checkAutoApplyWindowsPowerMode_CheckedChanged;
int kb_brightness = AppConfig.getConfig("keyboard_brightness");
trackBrightness.Value = (kb_brightness >= 0 && kb_brightness <= 3) ? kb_brightness : 3;
pictureHelp.Click += PictureHelp_Click;
trackBrightness.Value = InputDispatcher.GetBacklight();
trackBrightness.Scroll += TrackBrightness_Scroll;
panelXMG.Visible = (Program.acpi.DeviceGet(AsusACPI.GPUXGConnected) == 1);
@@ -228,6 +225,8 @@ namespace GHelper
checkFnLock.Checked = AppConfig.isConfig("fn_lock");
checkFnLock.CheckedChanged += CheckFnLock_CheckedChanged; ;
pictureHelp.Click += PictureHelp_Click;
}
private void CheckFnLock_CheckedChanged(object? sender, EventArgs e)
@@ -265,6 +264,7 @@ namespace GHelper
private void TrackBrightness_Scroll(object? sender, EventArgs e)
{
AppConfig.setConfig("keyboard_brightness", trackBrightness.Value);
AppConfig.setConfig("keyboard_brightness_ac", trackBrightness.Value);
AsusUSB.ApplyBrightness(trackBrightness.Value, "Slider");
}