diff --git a/configs/app.toml b/configs/app.toml index 24e75f1..3cd3c08 100644 --- a/configs/app.toml +++ b/configs/app.toml @@ -3,19 +3,23 @@ # config="example" # load with themes enabled? set the default mode [theme] -enabled=true -mode="light" +enabled = true +mode = "light" # load in extended mode? if so which orientation [extends] -extended=true -extends_horizontal=true +extended = true +extends_horizontal = true # default dimensions for channel label frames [channel] -width=80 -height=130 +width = 80 +height = 130 +xpadding = 2 # size of a single mouse wheel scroll step [mwscroll_step] -size=3 +size = 3 # default submix bus [submixes] -default=0 +default = 0 +# show the navigation frame? +[navigation] +show = true diff --git a/vmcompact/app.py b/vmcompact/app.py index 78dd0f8..85a2c87 100644 --- a/vmcompact/app.py +++ b/vmcompact/app.py @@ -1,3 +1,4 @@ +import logging import tkinter as tk from functools import cached_property from pathlib import Path @@ -11,6 +12,8 @@ from .errors import VMCompactError from .menu import Menus from .subject import Subject +logger = logging.getLogger(__name__) + class App(tk.Tk): """App mainframe""" @@ -34,9 +37,10 @@ class App(tk.Tk): def __init__(self, vmr): super().__init__() - + self.logger = logger.getChild(self.__class__.__name__) self._vmr = vmr self._vmr.event.add(["pdirty", "ldirty"]) + self.after(12000 if not self._vmr.gui.initial_state else 1, self.start_updates) self._vmr.init_thread() icon_path = Path(__file__).parent.resolve() / "img" / "cat.ico" if icon_path.is_file(): @@ -54,6 +58,10 @@ class App(tk.Tk): self.drag_id = "" self.bind("", self.dragging) + def start_updates(self): + self.logger.debug("updates started") + _base_values.run_update = True + def __str__(self): return f"{type(self).__name__}App" diff --git a/vmcompact/configurations.py b/vmcompact/configurations.py index 60c4de6..a3dcc09 100644 --- a/vmcompact/configurations.py +++ b/vmcompact/configurations.py @@ -48,6 +48,7 @@ _defaults = { "channel": { "width": 80, "height": 130, + "xpadding": 3, }, "mwscroll_step": { "size": 3, @@ -55,6 +56,7 @@ _defaults = { "submixes": { "default": 0, }, + "navigation": {"show": True}, } if "app" in configuration: diff --git a/vmcompact/data.py b/vmcompact/data.py index 9a466ca..38e82c0 100644 --- a/vmcompact/data.py +++ b/vmcompact/data.py @@ -32,10 +32,15 @@ class Configurations(metaclass=SingletonMeta): # bus assigned as current submix submixes: int = configuration["submixes"]["default"] - # width of a single labelframe - level_width: int = configuration["channel"]["width"] - # height of a single labelframe - level_height: int = configuration["channel"]["height"] + # width of a single channel labelframe + channel_width: int = configuration["channel"]["width"] + # height of a single channel labelframe + channel_height: int = configuration["channel"]["height"] + # xpadding for a single channel labelframe + channel_xpadding: int = configuration["channel"]["xpadding"] + + # do we grid the navigation frame? + navigation_show: bool = configuration["navigation"]["show"] @property def config(self): @@ -46,7 +51,7 @@ class Configurations(metaclass=SingletonMeta): @dataclass class BaseValues(metaclass=SingletonMeta): # pause updates after releasing scale - run_update: bool = True + run_update: bool = False # are we dragging main window with mouse 1 dragging: bool = False # a vban connection established