From dde0a8f274b0c678fe08ac48c689a01c37974d5c Mon Sep 17 00:00:00 2001 From: MRGRD56 Date: Sat, 5 Dec 2020 20:36:51 +0500 Subject: [PATCH] Release. --- FastVolumeFw/App.config | 3 +++ FastVolumeFw/Properties/Settings.Designer.cs | 12 ++++++++++++ FastVolumeFw/Properties/Settings.settings | 3 +++ FastVolumeFw/ViewModel/SettingsWindowVm.cs | 20 ++++++++++++++++++++ FastVolumeFw/Windows/MainWindow.xaml.cs | 10 ++++++---- FastVolumeFw/Windows/SettingsWindow.xaml | 13 ++++++++++--- 6 files changed, 54 insertions(+), 7 deletions(-) diff --git a/FastVolumeFw/App.config b/FastVolumeFw/App.config index 630c064..babd24d 100644 --- a/FastVolumeFw/App.config +++ b/FastVolumeFw/App.config @@ -25,6 +25,9 @@ 30 + + 2 + \ No newline at end of file diff --git a/FastVolumeFw/Properties/Settings.Designer.cs b/FastVolumeFw/Properties/Settings.Designer.cs index e093398..09c7007 100644 --- a/FastVolumeFw/Properties/Settings.Designer.cs +++ b/FastVolumeFw/Properties/Settings.Designer.cs @@ -82,5 +82,17 @@ public uint WindowRightMargin { this["WindowRightMargin"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("2")] + public uint MouseWheelVolumeChangeStep { + get { + return ((uint)(this["MouseWheelVolumeChangeStep"])); + } + set { + this["MouseWheelVolumeChangeStep"] = value; + } + } } } diff --git a/FastVolumeFw/Properties/Settings.settings b/FastVolumeFw/Properties/Settings.settings index 93741ba..0260fb4 100644 --- a/FastVolumeFw/Properties/Settings.settings +++ b/FastVolumeFw/Properties/Settings.settings @@ -17,5 +17,8 @@ 30 + + 2 + \ No newline at end of file diff --git a/FastVolumeFw/ViewModel/SettingsWindowVm.cs b/FastVolumeFw/ViewModel/SettingsWindowVm.cs index 57da892..461c4d6 100644 --- a/FastVolumeFw/ViewModel/SettingsWindowVm.cs +++ b/FastVolumeFw/ViewModel/SettingsWindowVm.cs @@ -17,6 +17,7 @@ public class SettingsWindowVm : INotifyPropertyChanged private bool _unmuteWhileChangingVolume; private bool _volumeControlWithMouseWheel; private uint _windowRightMargin; + private uint _mouseWheelVolumeChangeStep; public bool IsAppDisabledInFullScreenMode { @@ -96,6 +97,23 @@ public uint WindowRightMargin } } + public uint MouseWheelVolumeChangeStep + { + get => _mouseWheelVolumeChangeStep; + set + { + if (value < 1 || value > 10) return; + + _mouseWheelVolumeChangeStep = value; + if (Default.MouseWheelVolumeChangeStep != value) + { + Default.MouseWheelVolumeChangeStep = value; + Default.Save(); + } + OnPropertyChanged(); + } + } + public SettingsWindowVm() { IsAppDisabledInFullScreenMode = Default.IsAppDisabledInFullScreenMode; @@ -103,6 +121,7 @@ public SettingsWindowVm() UnmuteWhileChangingVolume = Default.UnmuteWhileChangingVolume; VolumeControlWithMouseWheel = Default.VolumeControlWithMouseWheel; WindowRightMargin = Default.WindowRightMargin; + MouseWheelVolumeChangeStep = Default.MouseWheelVolumeChangeStep; } public void RestoreDefaults() @@ -112,6 +131,7 @@ public void RestoreDefaults() UnmuteWhileChangingVolume = true; VolumeControlWithMouseWheel = true; WindowRightMargin = 30; + MouseWheelVolumeChangeStep = 2; } public event PropertyChangedEventHandler PropertyChanged; diff --git a/FastVolumeFw/Windows/MainWindow.xaml.cs b/FastVolumeFw/Windows/MainWindow.xaml.cs index 227aeb0..de633a1 100644 --- a/FastVolumeFw/Windows/MainWindow.xaml.cs +++ b/FastVolumeFw/Windows/MainWindow.xaml.cs @@ -160,17 +160,19 @@ private void MainBorder_MouseWheel(object sender, MouseWheelEventArgs e) if (!Properties.Settings.Default.VolumeControlWithMouseWheel) return; + var step = Properties.Settings.Default.MouseWheelVolumeChangeStep; + if (e.Delta > 0) { - if (ViewModel.Volume <= 98) - ViewModel.Volume += 2; + if (ViewModel.Volume <= 100 - step) + ViewModel.Volume += (int) step; else ViewModel.Volume = 100; } else if (e.Delta < 0) { - if (ViewModel.Volume >= 2) - ViewModel.Volume -= 2; + if (ViewModel.Volume >= step) + ViewModel.Volume -= (int) step; else ViewModel.Volume = 0; } diff --git a/FastVolumeFw/Windows/SettingsWindow.xaml b/FastVolumeFw/Windows/SettingsWindow.xaml index f46fbbb..72a020f 100644 --- a/FastVolumeFw/Windows/SettingsWindow.xaml +++ b/FastVolumeFw/Windows/SettingsWindow.xaml @@ -66,13 +66,20 @@