mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Accessibility improvements https://github.com/seerge/g-helper/issues/1830
This commit is contained in:
@@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user