diff options
| author | Ahmad Tantowi <ahmadtantowi@outlook.com> | 2023-10-20 21:02:12 +0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-20 16:02:12 +0200 |
| commit | b4bb22ba06f89168c948e6001c51972575ca968b (patch) | |
| tree | 44e71b5fe08adcac5a04f89095be3f7ca341b965 /src/Ryujinx.Ava/UI/Views/Settings | |
| parent | 6fdf7748455b2b71f99885239f8dc31390de2687 (diff) | |
Avalonia: Make slider scrollable with mouse wheel (#5760)
* 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>
Diffstat (limited to 'src/Ryujinx.Ava/UI/Views/Settings')
| -rw-r--r-- | src/Ryujinx.Ava/UI/Views/Settings/SettingsAudioView.axaml | 9 | ||||
| -rw-r--r-- | src/Ryujinx.Ava/UI/Views/Settings/SettingsGraphicsView.axaml | 3 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/Ryujinx.Ava/UI/Views/Settings/SettingsAudioView.axaml b/src/Ryujinx.Ava/UI/Views/Settings/SettingsAudioView.axaml index 5dc0fef5..657e07ee 100644 --- a/src/Ryujinx.Ava/UI/Views/Settings/SettingsAudioView.axaml +++ b/src/Ryujinx.Ava/UI/Views/Settings/SettingsAudioView.axaml @@ -4,6 +4,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls" xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale" xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels" @@ -63,13 +64,13 @@ Maximum="100" /> </StackPanel> <StackPanel Margin="10,0,0,0" Orientation="Horizontal"> - <Slider Value="{Binding Volume}" + <controls:SliderScroll Value="{Binding Volume}" Margin="250,0,0,0" ToolTip.Tip="{locale:Locale AudioVolumeTooltip}" Minimum="0" Maximum="100" - SmallChange="5" - TickFrequency="5" + SmallChange="1" + TickFrequency="1" IsSnapToTickEnabled="True" LargeChange="10" Width="350" /> @@ -77,4 +78,4 @@ </StackPanel> </Border> </ScrollViewer> -</UserControl>
\ No newline at end of file +</UserControl> diff --git a/src/Ryujinx.Ava/UI/Views/Settings/SettingsGraphicsView.axaml b/src/Ryujinx.Ava/UI/Views/Settings/SettingsGraphicsView.axaml index f6ba0a4c..22449478 100644 --- a/src/Ryujinx.Ava/UI/Views/Settings/SettingsGraphicsView.axaml +++ b/src/Ryujinx.Ava/UI/Views/Settings/SettingsGraphicsView.axaml @@ -4,6 +4,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls" xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale" xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels" @@ -173,7 +174,7 @@ <TextBlock Text="FSR" /> </ComboBoxItem> </ComboBox> - <Slider Value="{Binding ScalingFilterLevel}" + <controls:SliderScroll Value="{Binding ScalingFilterLevel}" ToolTip.Tip="{locale:Locale GraphicsScalingFilterLevelTooltip}" MinWidth="150" Margin="10,-3,0,0" |
