mousewheel scroll step now settable

size of mousewheel scroll step now settable

add _base_vals.mwscroll_step to data.

added [mwscroll_step] to  app.toml
This commit is contained in:
onyx-and-iris 2022-04-17 11:50:44 +01:00
parent 99275d1dd2
commit 000b18b6ec
6 changed files with 54 additions and 11 deletions

View File

@ -1,7 +1,6 @@
import tkinter as tk
from tkinter import ttk
from typing import NamedTuple
from functools import partial
from pathlib import Path
from .errors import VMCompactErrors
@ -47,6 +46,9 @@ class App(tk.Tk):
"width": 80,
"height": 130,
},
"mwscroll_step": {
"size": 3,
},
"submixes": {
"default": 0,
},
@ -60,6 +62,8 @@ class App(tk.Tk):
"extends_horizontal"
]
_base_vals.submixes = self.configuration["submixes"]["default"]
_base_vals.mwscroll_step = self.configuration["mwscroll_step"]["size"]
# create menus
self.menus = Menus(self, vmr)
self.styletable = ttk.Style()

View File

@ -73,10 +73,14 @@ class Channel(ttk.LabelFrame):
_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)
self.gain.set(
self.gain.get()
+ (
_base_vals.mwscroll_step
if event.delta > 0
else -_base_vals.mwscroll_step
)
)
if self.gain.get() > 12:
self.gain.set(12)
elif self.gain.get() < -60:

View File

@ -0,0 +1,18 @@
# load with themes enabled? set the default mode
[theme]
enabled=true
mode="light"
# load in extended mode? if so which orientation
[extends]
extended=true
extends_horizontal=true
# default dimensions for channel label frames
[channel]
width=80
height=130
# size of a single mouse wheen scroll step
[mwscroll_step]
size=3
# default submix bus
[submixes]
default=6

View File

@ -0,0 +1,12 @@
# example connections
[connection-1]
kind = 'banana'
ip = '<ip address 1>'
streamname = 'Command1'
port = 6990
[connection-2]
kind = 'potato'
ip = '<ip address 2>'
streamname = 'Command1'
port = 6990

View File

@ -29,6 +29,8 @@ class BaseValues:
strip_level_array_size: int = None
# size of bus level array for a kind
bus_level_array_size: int = None
# size of mousewheel scroll step
mwscroll_step: int = 3
_base_vals = BaseValues()

View File

@ -1,6 +1,5 @@
import tkinter as tk
from tkinter import ttk, messagebox as msg
from functools import partial
from tkinter import ttk
from math import log
from .data import _base_vals
@ -62,10 +61,14 @@ class GainLayer(ttk.LabelFrame):
_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)
self.gain.set(
self.gain.get()
+ (
_base_vals.mwscroll_step
if event.delta > 0
else -_base_vals.mwscroll_step
)
)
if self.gain.get() > 12:
self.gain.set(12)
elif self.gain.get() < -60: