Melissa
3 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
55 additions and
6 deletions
-
src/Avalonia.Controls/Primitives/ScrollBar.cs
-
src/Avalonia.Controls/ScrollViewer.cs
|
|
|
@ -247,15 +247,41 @@ namespace Avalonia.Controls.Primitives |
|
|
|
|
|
|
|
protected override void OnKeyDown(KeyEventArgs e) |
|
|
|
{ |
|
|
|
if (e.Key == Key.PageUp) |
|
|
|
if (Orientation == Orientation.Vertical) |
|
|
|
{ |
|
|
|
LargeDecrement(); |
|
|
|
e.Handled = true; |
|
|
|
if (e.Key == Key.PageUp) |
|
|
|
{ |
|
|
|
LargeDecrement(); |
|
|
|
e.Handled = true; |
|
|
|
} |
|
|
|
else if (e.Key == Key.PageDown) |
|
|
|
{ |
|
|
|
LargeIncrement(); |
|
|
|
e.Handled = true; |
|
|
|
} |
|
|
|
else if (e.Key == Key.Up) |
|
|
|
{ |
|
|
|
SmallDecrement(); |
|
|
|
e.Handled = true; |
|
|
|
} |
|
|
|
else if (e.Key == Key.Down) |
|
|
|
{ |
|
|
|
SmallIncrement(); |
|
|
|
e.Handled = true; |
|
|
|
} |
|
|
|
} |
|
|
|
else if (e.Key == Key.PageDown) |
|
|
|
else if (Orientation == Orientation.Horizontal) |
|
|
|
{ |
|
|
|
LargeIncrement(); |
|
|
|
e.Handled = true; |
|
|
|
if (e.Key == Key.Left) |
|
|
|
{ |
|
|
|
SmallDecrement(); |
|
|
|
e.Handled = true; |
|
|
|
} |
|
|
|
else if (e.Key == Key.Right) |
|
|
|
{ |
|
|
|
SmallIncrement(); |
|
|
|
e.Handled = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -786,6 +786,29 @@ namespace Avalonia.Controls |
|
|
|
PageDown(); |
|
|
|
e.Handled = true; |
|
|
|
} |
|
|
|
else if (e.Source == this) |
|
|
|
{ |
|
|
|
if (e.Key == Key.Left) |
|
|
|
{ |
|
|
|
LineLeft(); |
|
|
|
e.Handled = true; |
|
|
|
} |
|
|
|
else if (e.Key == Key.Right) |
|
|
|
{ |
|
|
|
LineRight(); |
|
|
|
e.Handled = true; |
|
|
|
} |
|
|
|
else if (e.Key == Key.Up) |
|
|
|
{ |
|
|
|
LineUp(); |
|
|
|
e.Handled = true; |
|
|
|
} |
|
|
|
else if (e.Key == Key.Down) |
|
|
|
{ |
|
|
|
LineDown(); |
|
|
|
e.Handled = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|