Skip to content

Commit e26ba18

Browse files
committed
Merged backlight flags for Z13 #3615
1 parent 0434fc1 commit e26ba18

File tree

2 files changed

+34
-8
lines changed

2 files changed

+34
-8
lines changed

app/Extra.cs

+25-8
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public Extra()
177177
numericBacklightPluggedTime.AccessibleName = Properties.Strings.BacklightTimeoutPlugged;
178178
numericBacklightTime.AccessibleName = Properties.Strings.BacklightTimeoutBattery;
179179

180-
comboKeyboardSpeed.AccessibleName = Properties.Strings.LaptopBacklight + " " +Properties.Strings.AnimationSpeed;
180+
comboKeyboardSpeed.AccessibleName = Properties.Strings.LaptopBacklight + " " + Properties.Strings.AnimationSpeed;
181181
comboAPU.AccessibleName = Properties.Strings.LaptopBacklight + " " + Properties.Strings.AnimationSpeed;
182182

183183
checkBoot.AccessibleName = Properties.Strings.Boot + " " + Properties.Strings.LaptopBacklight;
@@ -371,6 +371,9 @@ public Extra()
371371
checkBootBar.Visible = false;
372372
checkSleepBar.Visible = false;
373373
checkShutdownBar.Visible = false;
374+
375+
labelBacklightKeyboard.Visible = false;
376+
checkBattery.Visible = false;
374377
}
375378

376379
labelBacklightLid.Visible = false;
@@ -388,10 +391,21 @@ public Extra()
388391
checkShutdownLogo.Visible = false;
389392
}
390393

391-
if (!AppConfig.IsBacklightZones())
394+
if (AppConfig.IsZ13())
392395
{
393-
labelBacklightKeyboard.Visible = false;
394-
checkBattery.Visible = false;
396+
labelBacklightBar.Visible = false;
397+
checkAwakeBar.Visible = false;
398+
checkBatteryBar.Visible = false;
399+
checkBootBar.Visible = false;
400+
checkSleepBar.Visible = false;
401+
checkShutdownBar.Visible = false;
402+
403+
labelBacklightLid.Visible = false;
404+
checkAwakeLid.Visible = false;
405+
checkBatteryLid.Visible = false;
406+
checkBootLid.Visible = false;
407+
checkSleepLid.Visible = false;
408+
checkShutdownLid.Visible = false;
395409
}
396410

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

505519
private void ButtonACPISend_Click(object? sender, EventArgs e)
506520
{
507-
try {
521+
try
522+
{
508523
int deviceID = Convert.ToInt32(textACPICommand.Text, 16);
509524
int status = Convert.ToInt32(textACPIParam.Text, textACPIParam.Text.Contains("x") ? 16 : 10);
510525
int result = Program.acpi.DeviceSet((uint)deviceID, status, "TestACPI " + deviceID.ToString("X8") + " " + status.ToString("X4"));
511526
labelACPITitle.Text = "ACPI DEVS Test : " + result.ToString();
512-
} catch (Exception ex)
527+
}
528+
catch (Exception ex)
513529
{
514530
Logger.WriteLine(ex.Message);
515531
}
@@ -813,7 +829,7 @@ private void CheckPower_CheckedChanged(object? sender, EventArgs e)
813829
AppConfig.Set("keyboard_awake_bar_bat", (checkBatteryBar.Checked ? 1 : 0));
814830
AppConfig.Set("keyboard_awake_lid_bat", (checkBatteryLid.Checked ? 1 : 0));
815831
AppConfig.Set("keyboard_awake_logo_bat", (checkBatteryLogo.Checked ? 1 : 0));
816-
}
832+
}
817833

818834
Aura.ApplyPower();
819835

@@ -836,7 +852,8 @@ private void Keyboard_Shown(object? sender, EventArgs e)
836852
{
837853
MaximumSize = new Size(Width, Program.settingsForm.Height);
838854
Top = Program.settingsForm.Top;
839-
} else
855+
}
856+
else
840857
{
841858
Top = top;
842859
}

app/USB/Aura.cs

+9
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,15 @@ public static void ApplyPower()
403403
flags.SleepRear = AppConfig.IsNotFalse("keyboard_sleep_lid");
404404
flags.ShutdownRear = AppConfig.IsNotFalse("keyboard_shutdown_lid");
405405

406+
// On Z13 back panel light is controlled by mix of different flags, so merging them together
407+
if (AppConfig.IsZ13())
408+
{
409+
flags.AwakeBar = flags.AwakeLid = flags.AwakeLogo;
410+
flags.BootBar = flags.BootLid = flags.BootLogo;
411+
flags.SleepBar = flags.SleepLid = flags.SleepLogo;
412+
flags.ShutdownBar = flags.ShutdownLid = flags.ShutdownLogo;
413+
}
414+
406415
if (AppConfig.IsAlly())
407416
{
408417
ApplyAllyPower(flags);

0 commit comments

Comments
 (0)