remove scale enter/leave binds, use hasattr, fix bug in on_mousewheel

remove redundant scale_enter, scale_leave functions.

use hasattr over in dir()

fix bug in on_mousewheel

patch bump
This commit is contained in:
onyx-and-iris
2022-05-14 17:24:33 +01:00
parent a7f23ef544
commit 823c138a5f
5 changed files with 9 additions and 25 deletions

View File

@@ -39,11 +39,11 @@ class ChannelLabelFrame(ttk.LabelFrame):
return self.parent.target
def getter(self, param):
if param in dir(self.target):
if hasattr(self.target, param):
return getattr(self.target, param)
def setter(self, param, value):
if param in dir(self.target):
if hasattr(self.target, param):
setattr(self.target, param, value)
def scale_callback(self, *args):
@@ -64,12 +64,6 @@ class ChannelLabelFrame(ttk.LabelFrame):
self.setter("gain", 0)
self.gain.set(0)
def scale_enter(self, *args):
pass
def scale_leave(self, *args):
pass
def scale_press(self, *args):
_base_values.in_scale_button_1 = True
@@ -90,7 +84,6 @@ class ChannelLabelFrame(ttk.LabelFrame):
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 open_config(self):
if self.conf.get():