mirror of
https://github.com/onyx-and-iris/voicemeeter-compact.git
synced 2024-11-15 17:40:52 +00:00
added bind event mousewheel to gain sliders
added bind event mousewheel to gain sliders
This commit is contained in:
parent
8f3672029a
commit
cd4264be8b
@ -72,6 +72,18 @@ class Channel(ttk.LabelFrame):
|
||||
def scale_release(self, *args):
|
||||
_base_vals.in_scale_button_1 = False
|
||||
|
||||
def _on_mousewheel(self, event):
|
||||
if event.delta > 0:
|
||||
self.gain.set(self.gain.get() + 3)
|
||||
else:
|
||||
self.gain.set(self.gain.get() - 3)
|
||||
if self.gain.get() > 12:
|
||||
self.gain.set(12)
|
||||
elif self.gain.get() < -60:
|
||||
self.gain.set(-60)
|
||||
self.setter("gain", self.gain.get())
|
||||
self._parent._parent.nav_frame.info_text.set(round(self.gain.get(), 1))
|
||||
|
||||
def scale_callback(self, *args):
|
||||
"""callback function for scale widget"""
|
||||
self.setter("gain", self.gain.get())
|
||||
@ -110,6 +122,7 @@ class Channel(ttk.LabelFrame):
|
||||
self.scale.bind("<Enter>", self.scale_enter)
|
||||
self.scale.bind("<ButtonRelease-1>", self.scale_release)
|
||||
self.scale.bind("<Leave>", self.scale_leave)
|
||||
self.scale.bind("<MouseWheel>", self._on_mousewheel)
|
||||
|
||||
# Mute button
|
||||
self.button_mute = ttk.Checkbutton(
|
||||
|
@ -61,6 +61,18 @@ class GainLayer(ttk.LabelFrame):
|
||||
def scale_release(self, *args):
|
||||
_base_vals.in_scale_button_1 = False
|
||||
|
||||
def _on_mousewheel(self, event):
|
||||
if event.delta > 0:
|
||||
self.gain.set(self.gain.get() + 3)
|
||||
else:
|
||||
self.gain.set(self.gain.get() - 3)
|
||||
if self.gain.get() > 12:
|
||||
self.gain.set(12)
|
||||
elif self.gain.get() < -60:
|
||||
self.gain.set(-60)
|
||||
self.setter("gain", self.gain.get())
|
||||
self._parent._parent.nav_frame.info_text.set(round(self.gain.get(), 1))
|
||||
|
||||
def scale_callback(self, *args):
|
||||
"""callback function for scale widget"""
|
||||
self.setter("gain", self.gain.get())
|
||||
@ -112,6 +124,7 @@ class GainLayer(ttk.LabelFrame):
|
||||
self.scale.bind("<Enter>", self.scale_enter)
|
||||
self.scale.bind("<ButtonRelease-1>", self.scale_release)
|
||||
self.scale.bind("<Leave>", self.scale_leave)
|
||||
self.scale.bind("<MouseWheel>", self._on_mousewheel)
|
||||
|
||||
# On button
|
||||
self.button_on = ttk.Checkbutton(
|
||||
|
Loading…
Reference in New Issue
Block a user