From 69eed318c98b1127ca153f97f76818232b419f46 Mon Sep 17 00:00:00 2001 From: onyx-and-iris <75868496+onyx-and-iris@users.noreply.github.com> Date: Fri, 6 May 2022 13:35:31 +0100 Subject: [PATCH] changes to menus. changes to menus, themes and submixes merged into layout minsize reduced from 400 to 275. path version bump changelog updated. --- CHANGELOG.md | 3 ++- setup.py | 2 +- vmcompact/app.py | 2 +- vmcompact/menu.py | 65 ++++++++++++++++++++++++++--------------------- 4 files changed, 40 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37e70e2..7e16bf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] - [ ] Allow setting a bus mode from config -- [x] Fixed bug with gainlayer sync fetching strip label. +- [x] Fixed bug with gainlayer sync failing to fetch strip label. +- [x] Changes to menus, extends, themes and submixes merged into layout. ## [1.1.0] - 2022-05-05 diff --git a/setup.py b/setup.py index 9c3d499..917e99a 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh: setuptools.setup( name="vmcompact", - version="1.1.1", + version="1.1.2", author="Onyx and Iris", author_email="code@onyxandiris.online", description="Compact Tkinter Voicemeeter Remote App", diff --git a/vmcompact/app.py b/vmcompact/app.py index a2fe698..61de489 100644 --- a/vmcompact/app.py +++ b/vmcompact/app.py @@ -99,7 +99,7 @@ class App(tk.Tk): self.iconbitmap(Path(__file__).parent.resolve() / "img" / "cat.ico") - self.minsize(400, False) + self.minsize(275, False) @property def target(self): diff --git a/vmcompact/menu.py b/vmcompact/menu.py index b09564f..5589c92 100644 --- a/vmcompact/menu.py +++ b/vmcompact/menu.py @@ -81,7 +81,6 @@ class Menus(tk.Menu): ] else: menu_profiles.entryconfig(0, state="disabled") - menu_profiles.add_separator() menu_profiles.add_command(label="Reset to defaults", command=self.load_defaults) # vban connect menu @@ -104,9 +103,14 @@ class Menus(tk.Menu): else: self.entryconfig(3, state="disabled") - # extends menu - self.menu_extends = tk.Menu(self, tearoff=0) - self.add_cascade(menu=self.menu_extends, label="Extends") + # layout menu + self.menu_layout = tk.Menu(self, tearoff=0) + self.add_cascade(menu=self.menu_layout, label="Layout") + # layout/extends + self.menu_extends = tk.Menu(self.menu_layout, tearoff=0) + self.menu_layout.add_cascade( + menu=self.menu_extends, label="Extends", underline=0 + ) self.menu_extends.add_command( label="horizontal", underline=0, @@ -120,12 +124,26 @@ class Menus(tk.Menu): self.menu_extends.entryconfig( 0 if _base_vals.extends_horizontal else 1, state="disabled" ) - - # submixes menu + # layout/themes + self.menu_themes = tk.Menu(self.menu_layout, tearoff=0) + self.menu_layout.add_cascade(menu=self.menu_themes, label="Themes") + self.menu_themes.add_command( + label="light", command=partial(self.load_theme, "light") + ) + self.menu_themes.add_command( + label="dark", command=partial(self.load_theme, "dark") + ) + self.menu_themes.entryconfig( + 0 if self.configuration_app["theme"]["mode"] == "light" else 1, + state="disabled", + ) + if not _base_vals.themes_enabled: + self.entryconfig(6, state="disabled") + # layout/submixes # here we build menu regardless of kind but disable if not Potato buses = tuple(f"A{i+1}" for i in range(5)) + tuple(f"B{i+1}" for i in range(3)) - self.menu_submixes = tk.Menu(self, tearoff=0) - self.add_cascade(menu=self.menu_submixes, label="Submixes") + self.menu_submixes = tk.Menu(self.menu_layout, tearoff=0) + self.menu_layout.add_cascade(menu=self.menu_submixes, label="Submixes") [ self.menu_submixes.add_checkbutton( label=f"Bus {buses[i]}", @@ -139,23 +157,7 @@ class Menus(tk.Menu): ] self._selected_bus[_base_vals.submixes].set(True) if self._parent.kind.name != "Potato": - self.entryconfig(5, state="disabled") - - # themes menu - self.menu_themes = tk.Menu(self, tearoff=0) - self.add_cascade(menu=self.menu_themes, label="Themes") - self.menu_themes.add_command( - label="light", command=partial(self.load_theme, "light") - ) - self.menu_themes.add_command( - label="dark", command=partial(self.load_theme, "dark") - ) - self.menu_themes.entryconfig( - 0 if self.configuration_app["theme"]["mode"] == "light" else 1, - state="disabled", - ) - if not _base_vals.themes_enabled: - self.entryconfig(6, state="disabled") + self.menu_layout.entryconfig(2, state="disabled") # Help menu self.menu_help = tk.Menu(self, tearoff=0) @@ -252,6 +254,11 @@ class Menus(tk.Menu): for menu in self.menu_vban.winfo_children() if isinstance(menu, tk.Menu) ] + [ + menu.config(bg=f"{'black' if theme == 'dark' else 'white'}") + for menu in self.menu_layout.winfo_children() + if isinstance(menu, tk.Menu) + ] def vban_connect(self, i): [ @@ -275,8 +282,8 @@ class Menus(tk.Menu): target_menu = getattr(self, f"menu_vban_{i+1}") target_menu.entryconfig(0, state="disabled") target_menu.entryconfig(1, state="normal") - self.entryconfig( - 5, state=f"{'normal' if kind.name == 'Potato' else 'disabled'}" + self.menu_layout.entryconfig( + 2, state=f"{'normal' if kind.name == 'Potato' else 'disabled'}" ) def vban_disconnect(self, i): @@ -293,8 +300,8 @@ class Menus(tk.Menu): target_menu = getattr(self, f"menu_vban_{i+1}") target_menu.entryconfig(0, state="normal") target_menu.entryconfig(1, state="disabled") - self.entryconfig( - 5, state=f"{'normal' if kind.name == 'Potato' else 'disabled'}" + self.menu_layout.entryconfig( + 2, state=f"{'normal' if kind.name == 'Potato' else 'disabled'}" ) self.after(15000, self.enable_vban_menus)