This commit is contained in:
Serge
2024-01-01 20:05:44 +01:00
parent 0823e8efa2
commit 82f76b8d80
2 changed files with 46 additions and 0 deletions

View File

@@ -1263,6 +1263,10 @@ namespace GHelper
{
labelBatteryTitle.Text = Properties.Strings.BatteryChargeLimit + ": " + limit.ToString() + "%";
sliderBattery.Value = limit;
sliderBattery.AccessibleName = Properties.Strings.BatteryChargeLimit + ": " + limit.ToString() + "%";
sliderBattery.AccessibilityObject.Select(AccessibleSelection.TakeFocus);
VisualiseBatteryFull();
}
@@ -1272,11 +1276,13 @@ namespace GHelper
{
buttonBatteryFull.BackColor = colorStandard;
buttonBatteryFull.ForeColor = SystemColors.ControlLightLight;
buttonBatteryFull.AccessibleName = Properties.Strings.BatteryChargeLimit + "100% on";
}
else
{
buttonBatteryFull.BackColor = buttonSecond;
buttonBatteryFull.ForeColor = SystemColors.ControlDark;
buttonBatteryFull.AccessibleName = Properties.Strings.BatteryChargeLimit + "100% off";
}
}
@@ -1422,11 +1428,13 @@ namespace GHelper
{
buttonFnLock.BackColor = colorStandard;
buttonFnLock.ForeColor = SystemColors.ControlLightLight;
buttonFnLock.AccessibleName = "Fn-Lock on";
}
else
{
buttonFnLock.BackColor = buttonSecond;
buttonFnLock.ForeColor = SystemColors.ControlDark;
buttonFnLock.AccessibleName = "Fn-Lock off";
}
}

View File

@@ -36,6 +36,7 @@ namespace GHelper.UI
{
// This reduces flicker
DoubleBuffered = true;
TabStop = true;
}
@@ -89,6 +90,41 @@ namespace GHelper.UI
}
}
protected override bool IsInputKey(Keys keyData)
{
switch (keyData)
{
case Keys.Right:
case Keys.Left:
case Keys.Up:
case Keys.Down:
return true;
}
return base.IsInputKey(keyData);
}
protected override void OnKeyDown(KeyEventArgs e)
{
switch (e.KeyCode)
{
case Keys.Right:
case Keys.Up:
Value = Math.Min(Max, Value + Step);
break;
case Keys.Left:
case Keys.Down:
Value = Math.Max(Min, Value - Step);
break;
}
AccessibilityNotifyClients(AccessibleEvents.Focus, 0);
base.OnKeyDown(e);
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
@@ -131,6 +167,8 @@ namespace GHelper.UI
{
base.OnMouseDown(e);
Focus();
// Difference between tumb and mouse position.
_delta = new SizeF(e.Location.X - _thumbPos.X, e.Location.Y - _thumbPos.Y);
if (_delta.Width * _delta.Width + _delta.Height * _delta.Height <= _radius * _radius)