mainform: playback: Move volume track position to mouse position on click

Allows for smoother volume control
This commit is contained in:
Farex-GH
2022-09-11 00:57:22 -07:00
parent 34ef4c594c
commit 641074edf2
2 changed files with 8 additions and 0 deletions
+1
View File
@@ -712,6 +712,7 @@
this.trackBarVolume.TickFrequency = 50;
this.trackBarVolume.Value = 50;
this.trackBarVolume.ValueChanged += new System.EventHandler(this.trackBarVolume_ValueChanged);
this.trackBarVolume.MouseDown += new System.Windows.Forms.MouseEventHandler(this.trackBarVolume_MouseDown);
//
// labelVolume
//
+7
View File
@@ -1983,5 +1983,12 @@ namespace BAKKA_Editor
(songTrackBar.Maximum - songTrackBar.Minimum);
songTrackBar.Value = (int)val;
}
private void trackBarVolume_MouseDown(object sender, MouseEventArgs e)
{
float val = ((float)e.Location.Y / (float)trackBarVolume.Height) *
(trackBarVolume.Maximum - trackBarVolume.Minimum);
trackBarVolume.Value = (int)val;
}
}
}