Skip to content

Commit

Permalink
Merged backlight flags for Z13 #3615
Browse files Browse the repository at this point in the history
  • Loading branch information
seerge committed Jan 24, 2025
1 parent 0434fc1 commit e26ba18
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 8 deletions.
33 changes: 25 additions & 8 deletions app/Extra.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public Extra()
numericBacklightPluggedTime.AccessibleName = Properties.Strings.BacklightTimeoutPlugged;
numericBacklightTime.AccessibleName = Properties.Strings.BacklightTimeoutBattery;

comboKeyboardSpeed.AccessibleName = Properties.Strings.LaptopBacklight + " " +Properties.Strings.AnimationSpeed;
comboKeyboardSpeed.AccessibleName = Properties.Strings.LaptopBacklight + " " + Properties.Strings.AnimationSpeed;
comboAPU.AccessibleName = Properties.Strings.LaptopBacklight + " " + Properties.Strings.AnimationSpeed;

checkBoot.AccessibleName = Properties.Strings.Boot + " " + Properties.Strings.LaptopBacklight;
Expand Down Expand Up @@ -371,6 +371,9 @@ public Extra()
checkBootBar.Visible = false;
checkSleepBar.Visible = false;
checkShutdownBar.Visible = false;

labelBacklightKeyboard.Visible = false;
checkBattery.Visible = false;
}

labelBacklightLid.Visible = false;
Expand All @@ -388,10 +391,21 @@ public Extra()
checkShutdownLogo.Visible = false;
}

if (!AppConfig.IsBacklightZones())
if (AppConfig.IsZ13())
{
labelBacklightKeyboard.Visible = false;
checkBattery.Visible = false;
labelBacklightBar.Visible = false;
checkAwakeBar.Visible = false;
checkBatteryBar.Visible = false;
checkBootBar.Visible = false;
checkSleepBar.Visible = false;
checkShutdownBar.Visible = false;

labelBacklightLid.Visible = false;
checkAwakeLid.Visible = false;
checkBatteryLid.Visible = false;
checkBootLid.Visible = false;
checkSleepLid.Visible = false;
checkShutdownLid.Visible = false;
}

//checkAutoToggleClamshellMode.Visible = clamshellControl.IsExternalDisplayConnected();
Expand Down Expand Up @@ -504,12 +518,14 @@ private void InitACPITesting()

private void ButtonACPISend_Click(object? sender, EventArgs e)
{
try {
try
{
int deviceID = Convert.ToInt32(textACPICommand.Text, 16);
int status = Convert.ToInt32(textACPIParam.Text, textACPIParam.Text.Contains("x") ? 16 : 10);
int result = Program.acpi.DeviceSet((uint)deviceID, status, "TestACPI " + deviceID.ToString("X8") + " " + status.ToString("X4"));
labelACPITitle.Text = "ACPI DEVS Test : " + result.ToString();
} catch (Exception ex)
}
catch (Exception ex)
{
Logger.WriteLine(ex.Message);
}
Expand Down Expand Up @@ -813,7 +829,7 @@ private void CheckPower_CheckedChanged(object? sender, EventArgs e)
AppConfig.Set("keyboard_awake_bar_bat", (checkBatteryBar.Checked ? 1 : 0));
AppConfig.Set("keyboard_awake_lid_bat", (checkBatteryLid.Checked ? 1 : 0));
AppConfig.Set("keyboard_awake_logo_bat", (checkBatteryLogo.Checked ? 1 : 0));
}
}

Aura.ApplyPower();

Expand All @@ -836,7 +852,8 @@ private void Keyboard_Shown(object? sender, EventArgs e)
{
MaximumSize = new Size(Width, Program.settingsForm.Height);
Top = Program.settingsForm.Top;
} else
}
else
{
Top = top;
}
Expand Down
9 changes: 9 additions & 0 deletions app/USB/Aura.cs
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,15 @@ public static void ApplyPower()
flags.SleepRear = AppConfig.IsNotFalse("keyboard_sleep_lid");
flags.ShutdownRear = AppConfig.IsNotFalse("keyboard_shutdown_lid");

// On Z13 back panel light is controlled by mix of different flags, so merging them together
if (AppConfig.IsZ13())
{
flags.AwakeBar = flags.AwakeLid = flags.AwakeLogo;
flags.BootBar = flags.BootLid = flags.BootLogo;
flags.SleepBar = flags.SleepLid = flags.SleepLogo;
flags.ShutdownBar = flags.ShutdownLid = flags.ShutdownLogo;
}

if (AppConfig.IsAlly())
{
ApplyAllyPower(flags);
Expand Down

0 comments on commit e26ba18

Please sign in to comment.