mainform: playback: Move volume track position to mouse position on click
Allows for smoother volume control
This commit is contained in:
Generated
+1
@@ -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
|
||||
//
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user