From 0a19e283708801014c01d1ef85a666371033a22e Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Thu, 29 Jun 2023 15:50:39 +0100 Subject: [PATCH] xpadding on channels may be configured through app.toml --- vmcompact/builders.py | 16 ++++++++-------- vmcompact/channels.py | 4 ++-- vmcompact/gainlayer.py | 5 +++-- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/vmcompact/builders.py b/vmcompact/builders.py index bea04bc..697d7e3 100644 --- a/vmcompact/builders.py +++ b/vmcompact/builders.py @@ -195,9 +195,9 @@ class NavigationFrameBuilder(AbstractBuilder): if isinstance(child, ttk.Checkbutton) ] if _configuration.themes_enabled: - self.navframe.rowconfigure(1, minsize=_configuration.level_height) + self.navframe.rowconfigure(1, minsize=_configuration.channel_height) else: - self.navframe.rowconfigure(1, minsize=_configuration.level_height + 10) + self.navframe.rowconfigure(1, minsize=_configuration.channel_height + 10) def teardown(self): pass @@ -243,7 +243,7 @@ class ChannelLabelFrameBuilder(AbstractBuilder): orient="vertical", variable=self.labelframe.gain, command=self.labelframe.scale_callback, - length=_configuration.level_height, + length=_configuration.channel_height, ) self.scale.grid(column=1, row=0) self.scale.bind("", self.labelframe.reset_gain) @@ -324,7 +324,7 @@ class ChannelConfigFrameBuilder(AbstractBuilder): ] self.configframe.grid(sticky=(tk.W)) [ - self.configframe.columnconfigure(i, minsize=_configuration.level_width) + self.configframe.columnconfigure(i, minsize=_configuration.channel_width) for i in range(self.configframe.phys_out + self.configframe.virt_out) ] @@ -392,7 +392,7 @@ class StripConfigFrameBuilder(ChannelConfigFrameBuilder): from_=0.0, to=10.0, orient="horizontal", - length=_configuration.level_width, + length=_configuration.channel_width, variable=self.configframe.slider_vars[ self.configframe.slider_params.index("comp.knob") ], @@ -416,7 +416,7 @@ class StripConfigFrameBuilder(ChannelConfigFrameBuilder): from_=0.0, to=10.0, orient="horizontal", - length=_configuration.level_width, + length=_configuration.channel_width, variable=self.configframe.slider_vars[ self.configframe.slider_params.index("gate.knob") ], @@ -440,7 +440,7 @@ class StripConfigFrameBuilder(ChannelConfigFrameBuilder): from_=-40, to=12, orient="horizontal", - length=_configuration.level_width, + length=_configuration.channel_width, variable=self.configframe.slider_vars[ self.configframe.slider_params.index("limit") ], @@ -464,7 +464,7 @@ class StripConfigFrameBuilder(ChannelConfigFrameBuilder): from_=0.0, to=10.0, orient="horizontal", - length=_configuration.level_width, + length=_configuration.channel_width, variable=self.configframe.slider_vars[ self.configframe.slider_params.index("audibility") ], diff --git a/vmcompact/channels.py b/vmcompact/channels.py index 17968cb..a9fab78 100644 --- a/vmcompact/channels.py +++ b/vmcompact/channels.py @@ -154,7 +154,7 @@ class ChannelLabelFrame(ttk.LabelFrame): self.configure(text=retval) def grid_configure(self): - self.grid(sticky=(tk.N, tk.S)) + self.grid(padx=_configuration.channel_xpadding, sticky=(tk.N, tk.S)) [ child.grid_configure(padx=1, pady=1, sticky=(tk.W, tk.E)) for child in self.winfo_children() @@ -258,7 +258,7 @@ class ChannelFrame(ttk.Frame): def grid_configure(self): [ - self.columnconfigure(i, minsize=_configuration.level_width) + self.columnconfigure(i, minsize=_configuration.channel_width) for i, _ in enumerate(self.labelframes) ] [self.rowconfigure(0, minsize=100) for i, _ in enumerate(self.labelframes)] diff --git a/vmcompact/gainlayer.py b/vmcompact/gainlayer.py index 99ff1ef..e1acfe3 100644 --- a/vmcompact/gainlayer.py +++ b/vmcompact/gainlayer.py @@ -166,6 +166,7 @@ class GainLayer(ttk.LabelFrame): ) def grid_configure(self): + self.grid(padx=_configuration.channel_xpadding, sticky=(tk.N, tk.S)) [ child.grid_configure(padx=1, pady=1, sticky=(tk.N, tk.S, tk.W, tk.E)) for child in self.winfo_children() @@ -253,11 +254,11 @@ class SubMixFrame(ttk.Frame): def grid_configure(self): [ - self.columnconfigure(i, minsize=_configuration.level_width) + self.columnconfigure(i, minsize=_configuration.channel_width) for i, _ in enumerate(self.labelframes) ] [ - self.rowconfigure(0, minsize=_configuration.level_height) + self.rowconfigure(0, minsize=_configuration.channel_height) for i, _ in enumerate(self.labelframes) ]