mirror of
https://git.zaroz.cloud/nintendo-back-up/Ryujinx.git
synced 2025-06-07 11:45:26 +00:00

* Add scrollable custom control based on TickFrequency * Use custom slider to update value when pointer wheel scrolled * Remove extra xaml file * Address formatting issues * Only scroll one element at a time * Add OnPointerWheelChanged event to VolumeStatus button Co-authored-by: Ahmad Tantowi <ahmadtantowi@outlook.com> --------- Co-authored-by: TSR Berry <20988865+TSRBerry@users.noreply.github.com>
32 lines
694 B
C#
32 lines
694 B
C#
using Avalonia.Controls;
|
|
using Avalonia.Input;
|
|
using System;
|
|
|
|
namespace Ryujinx.Ava.UI.Controls
|
|
{
|
|
public class SliderScroll : Slider
|
|
{
|
|
protected override Type StyleKeyOverride => typeof(Slider);
|
|
|
|
protected override void OnPointerWheelChanged(PointerWheelEventArgs e)
|
|
{
|
|
var newValue = Value + e.Delta.Y * TickFrequency;
|
|
|
|
if (newValue < Minimum)
|
|
{
|
|
Value = Minimum;
|
|
}
|
|
else if (newValue > Maximum)
|
|
{
|
|
Value = Maximum;
|
|
}
|
|
else
|
|
{
|
|
Value = newValue;
|
|
}
|
|
|
|
e.Handled = true;
|
|
}
|
|
}
|
|
}
|