Only instanciate if needed.

This commit is contained in:
IceStormNG
2023-07-21 15:40:24 +02:00
parent 5498bb9398
commit fbc792cb1d

View File

@@ -474,10 +474,10 @@ namespace GHelper
private void checkAutoToggleClamshellMode_CheckedChanged(object sender, EventArgs e)
{
AppConfig.Set("toggle_clamshell_mode", checkAutoToggleClamshellMode.Checked ? 1 : 0);
ClamshellModeControl ctrl = new ClamshellModeControl();
if (checkAutoToggleClamshellMode.Checked)
{
ClamshellModeControl ctrl = new ClamshellModeControl();
ctrl.ToggleLidAction();
}
else