diff --git a/setup.cfg b/setup.cfg index 3113996..a552eb4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,12 +23,13 @@ install_requires = pandas scipy pupil-labs-dynamic-rim - pupil-labs-automate_custom_events rich openai - av + av requests opencv-python + aiohttp + sv-ttk python_requires = >=3.9 include_package_data = true package_dir = diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/.gitignore b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/.gitignore deleted file mode 100644 index b6e4761..0000000 --- a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/.gitignore +++ /dev/null @@ -1,129 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -pip-wheel-metadata/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -.python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/Dark screenshot.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/Dark screenshot.png deleted file mode 100644 index 6f64e35..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/Dark screenshot.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/LICENSE b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/LICENSE deleted file mode 100644 index 0212030..0000000 --- a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 rdbende - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/Light screenshot.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/Light screenshot.png deleted file mode 100644 index c38698b..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/Light screenshot.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/README.md b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/README.md deleted file mode 100644 index a34d911..0000000 --- a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/README.md +++ /dev/null @@ -1,86 +0,0 @@ -# Azure theme for ttk - -![Screenshot of the Azure theme](screenshot.png) - -## How to use? -Just like for my [Sun Valley](https://github.com/rdbende/Sun-Valley-ttk-theme) theme in version 2.0 I wanted to make usage of the theme very simple, so the theme setting is handled by a separate tcl script. -This way whether you want to use a dark or light theme, you need to import just a single file. The other thing that makes this a good solution is that normally switching between light and dark theme is not entirely perfect, and the colors are not correct. - -```python -# Just simply import the azure.tcl file -widget.tk.call("source", "azure.tcl") - -# Then set the theme you want with the set_theme procedure -widget.tk.call("set_theme", "light") -# or -widget.tk.call("set_theme", "dark") -``` - -### Changing themes -Normally changing between themes isn't that easy, because then the colors aren't correct. See this [Stackoverflow question](https://stackoverflow.com/questions/66576662/how-to-switch-between-dark-and-light-ttk-theme). However, with my current solution, you can change theme at any time, without any color issues. - -```python -import tkinter as tk -from tkinter import ttk - -root = tk.Tk() - -# Pack a big frame so, it behaves like the window background -big_frame = ttk.Frame(root) -big_frame.pack(fill="both", expand=True) - -# Set the initial theme -root.tk.call("source", "azure.tcl") -root.tk.call("set_theme", "light") - -def change_theme(): - # NOTE: The theme's real name is azure- - if root.tk.call("ttk::style", "theme", "use") == "azure-dark": - # Set light theme - root.tk.call("set_theme", "light") - else: - # Set dark theme - root.tk.call("set_theme", "dark") - -# Remember, you have to use ttk widgets -button = ttk.Button(big_frame, text="Change theme!", command=change_theme) -button.pack() - -root.mainloop() -``` - -## New style elements -Azure theme has a style for every ttk widget, but there are some **new** widget styles, such as an accent button, toggle switch, toggle button, tickscale, and card. You can apply these with the style parameter. - -If you need a highlighted button, use `Accent.TButton`: -```python -accent_button = ttk.Button(root, text='Accent button', style='Accent.TButton', command=callback) -``` - -To create a toggle button you need a checkbutton, to which you can apply the `Toggle.TButton` style: -```python -toggle_button = ttk.Checkbutton(root, text='Toggle button', style='Toggle.TButton', variable=var) -``` - -The use of switches instead of checkboxes is becoming more common these days, so this theme has a `Switch.TCheckbutton` style, that can be applied to checkbuttons: -```python -switch = ttk.Checkbutton(root, text='Switch', style='Switch.TCheckbutton', variable=var) -``` - -If you don't like the big circle on the scale, you prefer something more solid, then use the `Tick.TScale` style: -```python -tick_scale = ttk.Scale(root, style='Tick.TScale', variable=var) -``` - -If you only want a border around your widgets, not an entire LabelFrame then apply the `Card.TFrame` style to a Frame: -```python -card = ttk.Frame(root, style='Card.TFrame', padding=(5, 6, 7, 8)) -``` - -## Bugs -- Tk isn't really good at displaying `png` images, so if your program is laggy with the theme, please check out the [gif-based branch!](https://github.com/rdbende/Azure-ttk-theme/tree/gif-based/) -- If your app has a treeview widget, and you change the theme the window will expand horizontally. This is a quite strange bug that applies to all ttk themes. - -If you scrolled down here, please check out my other themes! -- [Sun Valley ttk theme](https://github.com/rdbende/Sun-Valley-ttk-theme) a theme that looks like Windows 11! -- [Forest ttk theme](https://github.com/rdbende/Forest-ttk-theme) a theme inspired by Excel's look. diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/azure.tcl b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/azure.tcl deleted file mode 100755 index 3e75502..0000000 --- a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/azure.tcl +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright © 2021 rdbende - -source [file join [file dirname [info script]] theme light.tcl] -source [file join [file dirname [info script]] theme dark.tcl] - -option add *tearOff 0 - -proc set_theme {mode} { - if {$mode == "dark"} { - ttk::style theme use "azure-dark" - - array set colors { - -fg "#ffffff" - -bg "#333333" - -disabledfg "#ffffff" - -disabledbg "#737373" - -selectfg "#ffffff" - -selectbg "#007fff" - } - - ttk::style configure . \ - -background $colors(-bg) \ - -foreground $colors(-fg) \ - -troughcolor $colors(-bg) \ - -focuscolor $colors(-selectbg) \ - -selectbackground $colors(-selectbg) \ - -selectforeground $colors(-selectfg) \ - -insertcolor $colors(-fg) \ - -insertwidth 1 \ - -fieldbackground $colors(-selectbg) \ - -font {"Segoe Ui" 10} \ - -borderwidth 1 \ - -relief flat - - tk_setPalette background [ttk::style lookup . -background] \ - foreground [ttk::style lookup . -foreground] \ - highlightColor [ttk::style lookup . -focuscolor] \ - selectBackground [ttk::style lookup . -selectbackground] \ - selectForeground [ttk::style lookup . -selectforeground] \ - activeBackground [ttk::style lookup . -selectbackground] \ - activeForeground [ttk::style lookup . -selectforeground] - - ttk::style map . -foreground [list disabled $colors(-disabledfg)] - - option add *font [ttk::style lookup . -font] - option add *Menu.selectcolor $colors(-fg) - - } elseif {$mode == "light"} { - ttk::style theme use "azure-light" - - array set colors { - -fg "#000000" - -bg "#ffffff" - -disabledfg "#737373" - -disabledbg "#ffffff" - -selectfg "#ffffff" - -selectbg "#007fff" - } - - ttk::style configure . \ - -background $colors(-bg) \ - -foreground $colors(-fg) \ - -troughcolor $colors(-bg) \ - -focuscolor $colors(-selectbg) \ - -selectbackground $colors(-selectbg) \ - -selectforeground $colors(-selectfg) \ - -insertcolor $colors(-fg) \ - -insertwidth 1 \ - -fieldbackground $colors(-selectbg) \ - -font {"Segoe Ui" 10} \ - -borderwidth 1 \ - -relief flat - - tk_setPalette background [ttk::style lookup . -background] \ - foreground [ttk::style lookup . -foreground] \ - highlightColor [ttk::style lookup . -focuscolor] \ - selectBackground [ttk::style lookup . -selectbackground] \ - selectForeground [ttk::style lookup . -selectforeground] \ - activeBackground [ttk::style lookup . -selectbackground] \ - activeForeground [ttk::style lookup . -selectforeground] - - ttk::style map . -foreground [list disabled $colors(-disabledfg)] - - option add *font [ttk::style lookup . -font] - option add *Menu.selectcolor $colors(-fg) - } -} diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/example.py b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/example.py deleted file mode 100644 index 86c04b7..0000000 --- a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/example.py +++ /dev/null @@ -1,306 +0,0 @@ -""" -Example script for testing the Azure ttk theme -Author: rdbende -License: MIT license -Source: https://github.com/rdbende/ttk-widget-factory -""" - - -import tkinter as tk -from tkinter import ttk - - -class App(ttk.Frame): - def __init__(self, parent): - ttk.Frame.__init__(self) - - # Make the app responsive - for index in [0, 1, 2]: - self.columnconfigure(index=index, weight=1) - self.rowconfigure(index=index, weight=1) - - # Create value lists - self.option_menu_list = ["", "OptionMenu", "Option 1", "Option 2"] - self.combo_list = ["Combobox", "Editable item 1", "Editable item 2"] - self.readonly_combo_list = ["Readonly combobox", "Item 1", "Item 2"] - - # Create control variables - self.var_0 = tk.BooleanVar() - self.var_1 = tk.BooleanVar(value=True) - self.var_2 = tk.BooleanVar() - self.var_3 = tk.IntVar(value=2) - self.var_4 = tk.StringVar(value=self.option_menu_list[1]) - self.var_5 = tk.DoubleVar(value=75.0) - - # Create widgets :) - self.setup_widgets() - - def setup_widgets(self): - # Create a Frame for the Checkbuttons - self.check_frame = ttk.LabelFrame(self, text="Checkbuttons", padding=(20, 10)) - self.check_frame.grid( - row=0, column=0, padx=(20, 10), pady=(20, 10), sticky="nsew" - ) - - # Checkbuttons - self.check_1 = ttk.Checkbutton( - self.check_frame, text="Unchecked", variable=self.var_0 - ) - self.check_1.grid(row=0, column=0, padx=5, pady=10, sticky="nsew") - - self.check_2 = ttk.Checkbutton( - self.check_frame, text="Checked", variable=self.var_1 - ) - self.check_2.grid(row=1, column=0, padx=5, pady=10, sticky="nsew") - - self.check_3 = ttk.Checkbutton( - self.check_frame, text="Third state", variable=self.var_2 - ) - self.check_3.state(["alternate"]) - self.check_3.grid(row=2, column=0, padx=5, pady=10, sticky="nsew") - - self.check_4 = ttk.Checkbutton( - self.check_frame, text="Disabled", state="disabled" - ) - self.check_4.state(["disabled !alternate"]) - self.check_4.grid(row=3, column=0, padx=5, pady=10, sticky="nsew") - - # Separator - self.separator = ttk.Separator(self) - self.separator.grid(row=1, column=0, padx=(20, 10), pady=10, sticky="ew") - - # Create a Frame for the Radiobuttons - self.radio_frame = ttk.LabelFrame(self, text="Radiobuttons", padding=(20, 10)) - self.radio_frame.grid(row=2, column=0, padx=(20, 10), pady=10, sticky="nsew") - - # Radiobuttons - self.radio_1 = ttk.Radiobutton( - self.radio_frame, text="Unselected", variable=self.var_3, value=1 - ) - self.radio_1.grid(row=0, column=0, padx=5, pady=10, sticky="nsew") - self.radio_2 = ttk.Radiobutton( - self.radio_frame, text="Selected", variable=self.var_3, value=2 - ) - self.radio_2.grid(row=1, column=0, padx=5, pady=10, sticky="nsew") - self.radio_4 = ttk.Radiobutton( - self.radio_frame, text="Disabled", state="disabled" - ) - self.radio_4.grid(row=3, column=0, padx=5, pady=10, sticky="nsew") - - # Create a Frame for input widgets - self.widgets_frame = ttk.Frame(self, padding=(0, 0, 0, 10)) - self.widgets_frame.grid( - row=0, column=1, padx=10, pady=(30, 10), sticky="nsew", rowspan=3 - ) - self.widgets_frame.columnconfigure(index=0, weight=1) - - # Entry - self.entry = ttk.Entry(self.widgets_frame) - self.entry.insert(0, "Entry") - self.entry.grid(row=0, column=0, padx=5, pady=(0, 10), sticky="ew") - - # Spinbox - self.spinbox = ttk.Spinbox(self.widgets_frame, from_=0, to=100, increment=0.1) - self.spinbox.insert(0, "Spinbox") - self.spinbox.grid(row=1, column=0, padx=5, pady=10, sticky="ew") - - # Combobox - self.combobox = ttk.Combobox(self.widgets_frame, values=self.combo_list) - self.combobox.current(0) - self.combobox.grid(row=2, column=0, padx=5, pady=10, sticky="ew") - - # Read-only combobox - self.readonly_combo = ttk.Combobox( - self.widgets_frame, state="readonly", values=self.readonly_combo_list - ) - self.readonly_combo.current(0) - self.readonly_combo.grid(row=3, column=0, padx=5, pady=10, sticky="ew") - - # Menu for the Menubutton - self.menu = tk.Menu(self) - self.menu.add_command(label="Menu item 1") - self.menu.add_command(label="Menu item 2") - self.menu.add_separator() - self.menu.add_command(label="Menu item 3") - self.menu.add_command(label="Menu item 4") - - # Menubutton - self.menubutton = ttk.Menubutton( - self.widgets_frame, text="Menubutton", menu=self.menu, direction="below" - ) - self.menubutton.grid(row=4, column=0, padx=5, pady=10, sticky="nsew") - - # OptionMenu - self.optionmenu = ttk.OptionMenu( - self.widgets_frame, self.var_4, *self.option_menu_list - ) - self.optionmenu.grid(row=5, column=0, padx=5, pady=10, sticky="nsew") - - # Button - self.button = ttk.Button(self.widgets_frame, text="Button") - self.button.grid(row=6, column=0, padx=5, pady=10, sticky="nsew") - - # Accentbutton - self.accentbutton = ttk.Button( - self.widgets_frame, text="Accent button", style="Accent.TButton" - ) - self.accentbutton.grid(row=7, column=0, padx=5, pady=10, sticky="nsew") - - # Togglebutton - self.togglebutton = ttk.Checkbutton( - self.widgets_frame, text="Toggle button", style="Toggle.TButton" - ) - self.togglebutton.grid(row=8, column=0, padx=5, pady=10, sticky="nsew") - - # Switch - self.switch = ttk.Checkbutton( - self.widgets_frame, text="Switch", style="Switch.TCheckbutton" - ) - self.switch.grid(row=9, column=0, padx=5, pady=10, sticky="nsew") - - # Panedwindow - self.paned = ttk.PanedWindow(self) - self.paned.grid(row=0, column=2, pady=(25, 5), sticky="nsew", rowspan=3) - - # Pane #1 - self.pane_1 = ttk.Frame(self.paned, padding=5) - self.paned.add(self.pane_1, weight=1) - - # Scrollbar - self.scrollbar = ttk.Scrollbar(self.pane_1) - self.scrollbar.pack(side="right", fill="y") - - # Treeview - self.treeview = ttk.Treeview( - self.pane_1, - selectmode="browse", - yscrollcommand=self.scrollbar.set, - columns=(1, 2), - height=10, - ) - self.treeview.pack(expand=True, fill="both") - self.scrollbar.config(command=self.treeview.yview) - - # Treeview columns - self.treeview.column("#0", anchor="w", width=120) - self.treeview.column(1, anchor="w", width=120) - self.treeview.column(2, anchor="w", width=120) - - # Treeview headings - self.treeview.heading("#0", text="Column 1", anchor="center") - self.treeview.heading(1, text="Column 2", anchor="center") - self.treeview.heading(2, text="Column 3", anchor="center") - - # Define treeview data - treeview_data = [ - ("", 1, "Parent", ("Item 1", "Value 1")), - (1, 2, "Child", ("Subitem 1.1", "Value 1.1")), - (1, 3, "Child", ("Subitem 1.2", "Value 1.2")), - (1, 4, "Child", ("Subitem 1.3", "Value 1.3")), - (1, 5, "Child", ("Subitem 1.4", "Value 1.4")), - ("", 6, "Parent", ("Item 2", "Value 2")), - (6, 7, "Child", ("Subitem 2.1", "Value 2.1")), - (6, 8, "Sub-parent", ("Subitem 2.2", "Value 2.2")), - (8, 9, "Child", ("Subitem 2.2.1", "Value 2.2.1")), - (8, 10, "Child", ("Subitem 2.2.2", "Value 2.2.2")), - (8, 11, "Child", ("Subitem 2.2.3", "Value 2.2.3")), - (6, 12, "Child", ("Subitem 2.3", "Value 2.3")), - (6, 13, "Child", ("Subitem 2.4", "Value 2.4")), - ("", 14, "Parent", ("Item 3", "Value 3")), - (14, 15, "Child", ("Subitem 3.1", "Value 3.1")), - (14, 16, "Child", ("Subitem 3.2", "Value 3.2")), - (14, 17, "Child", ("Subitem 3.3", "Value 3.3")), - (14, 18, "Child", ("Subitem 3.4", "Value 3.4")), - ("", 19, "Parent", ("Item 4", "Value 4")), - (19, 20, "Child", ("Subitem 4.1", "Value 4.1")), - (19, 21, "Sub-parent", ("Subitem 4.2", "Value 4.2")), - (21, 22, "Child", ("Subitem 4.2.1", "Value 4.2.1")), - (21, 23, "Child", ("Subitem 4.2.2", "Value 4.2.2")), - (21, 24, "Child", ("Subitem 4.2.3", "Value 4.2.3")), - (19, 25, "Child", ("Subitem 4.3", "Value 4.3")), - ] - - # Insert treeview data - for item in treeview_data: - self.treeview.insert( - parent=item[0], index="end", iid=item[1], text=item[2], values=item[3] - ) - if item[0] == "" or item[1] in {8, 21}: - self.treeview.item(item[1], open=True) # Open parents - - # Select and scroll - self.treeview.selection_set(10) - self.treeview.see(7) - - # Notebook, pane #2 - self.pane_2 = ttk.Frame(self.paned, padding=5) - self.paned.add(self.pane_2, weight=3) - - # Notebook, pane #2 - self.notebook = ttk.Notebook(self.pane_2) - self.notebook.pack(fill="both", expand=True) - - # Tab #1 - self.tab_1 = ttk.Frame(self.notebook) - for index in [0, 1]: - self.tab_1.columnconfigure(index=index, weight=1) - self.tab_1.rowconfigure(index=index, weight=1) - self.notebook.add(self.tab_1, text="Tab 1") - - # Scale - self.scale = ttk.Scale( - self.tab_1, - from_=100, - to=0, - variable=self.var_5, - command=lambda event: self.var_5.set(self.scale.get()), - ) - self.scale.grid(row=0, column=0, padx=(20, 10), pady=(20, 0), sticky="ew") - - # Progressbar - self.progress = ttk.Progressbar( - self.tab_1, value=0, variable=self.var_5, mode="determinate" - ) - self.progress.grid(row=0, column=1, padx=(10, 20), pady=(20, 0), sticky="ew") - - # Label - self.label = ttk.Label( - self.tab_1, - text="Azure theme for ttk", - justify="center", - font=("-size", 15, "-weight", "bold"), - ) - self.label.grid(row=1, column=0, pady=10, columnspan=2) - - # Tab #2 - self.tab_2 = ttk.Frame(self.notebook) - self.notebook.add(self.tab_2, text="Tab 2") - - # Tab #3 - self.tab_3 = ttk.Frame(self.notebook) - self.notebook.add(self.tab_3, text="Tab 3") - - # Sizegrip - self.sizegrip = ttk.Sizegrip(self) - self.sizegrip.grid(row=100, column=100, padx=(0, 5), pady=(0, 5)) - - -if __name__ == "__main__": - root = tk.Tk() - root.title("") - - # Simply set the theme - root.tk.call("source", "azure.tcl") - root.tk.call("set_theme", "dark") - - app = App(root) - app.pack(fill="both", expand=True) - - # Set a minsize for the window, and place it in the middle - root.update() - root.minsize(root.winfo_width(), root.winfo_height()) - x_cordinate = int((root.winfo_screenwidth() / 2) - (root.winfo_width() / 2)) - y_cordinate = int((root.winfo_screenheight() / 2) - (root.winfo_height() / 2)) - root.geometry("+{}+{}".format(x_cordinate, y_cordinate-20)) - - root.mainloop() diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/screenshot.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/screenshot.png deleted file mode 100644 index fd85558..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/screenshot.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark.tcl b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark.tcl deleted file mode 100644 index 333e53d..0000000 --- a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark.tcl +++ /dev/null @@ -1,539 +0,0 @@ -# Copyright (c) 2021 rdbende - -# The Azure theme is a beautiful modern ttk theme inspired by Microsoft's fluent design. - -package require Tk 8.6 - -namespace eval ttk::theme::azure-dark { - variable version 2.0 - package provide ttk::theme::azure-dark $version - - ttk::style theme create azure-dark -parent clam -settings { - proc load_images {imgdir} { - variable I - foreach file [glob -directory $imgdir *.png] { - set img [file tail [file rootname $file]] - set I($img) [image create photo -file $file -format png] - } - } - - load_images [file join [file dirname [info script]] dark] - - array set colors { - -fg "#ffffff" - -bg "#333333" - -disabledfg "#aaaaaa" - -disabledbg "#737373" - -selectfg "#ffffff" - -selectbg "#007fff" - } - - ttk::style layout TButton { - Button.button -children { - Button.padding -children { - Button.label -side left -expand true - } - } - } - - ttk::style layout Toolbutton { - Toolbutton.button -children { - Toolbutton.padding -children { - Toolbutton.label -side left -expand true - } - } - } - - ttk::style layout TMenubutton { - Menubutton.button -children { - Menubutton.padding -children { - Menubutton.indicator -side right - Menubutton.label -side right -expand true - } - } - } - - ttk::style layout TOptionMenu { - OptionMenu.button -children { - OptionMenu.padding -children { - OptionMenu.indicator -side right - OptionMenu.label -side right -expand true - } - } - } - - ttk::style layout Accent.TButton { - AccentButton.button -children { - AccentButton.padding -children { - AccentButton.label -side left -expand true - } - } - } - - ttk::style layout TCheckbutton { - Checkbutton.button -children { - Checkbutton.padding -children { - Checkbutton.indicator -side left - Checkbutton.label -side right -expand true - } - } - } - - ttk::style layout Switch.TCheckbutton { - Switch.button -children { - Switch.padding -children { - Switch.indicator -side left - Switch.label -side right -expand true - } - } - } - - ttk::style layout Toggle.TButton { - ToggleButton.button -children { - ToggleButton.padding -children { - ToggleButton.label -side left -expand true - } - } - } - - ttk::style layout TRadiobutton { - Radiobutton.button -children { - Radiobutton.padding -children { - Radiobutton.indicator -side left - Radiobutton.label -side right -expand true - } - } - } - - ttk::style layout Vertical.TScrollbar { - Vertical.Scrollbar.trough -sticky ns -children { - Vertical.Scrollbar.thumb -expand true - } - } - - ttk::style layout Horizontal.TScrollbar { - Horizontal.Scrollbar.trough -sticky ew -children { - Horizontal.Scrollbar.thumb -expand true - } - } - - ttk::style layout TCombobox { - Combobox.field -sticky nswe -children { - Combobox.padding -expand true -sticky nswe -children { - Combobox.textarea -sticky nswe - } - } - Combobox.button -side right -sticky ns -children { - Combobox.arrow -sticky nsew - } - } - - ttk::style layout TSpinbox { - Spinbox.field -sticky nsew -children { - Spinbox.padding -expand true -sticky nswe -children { - Spinbox.textarea -sticky nswe - } - - } - Spinbox.button -side right -sticky ns -children { - null -side right -children { - Spinbox.uparrow -side top - Spinbox.downarrow -side bottom - } - } - } - - ttk::style layout Horizontal.TSeparator { - Horizontal.separator -sticky nswe - } - - ttk::style layout Vertical.TSeparator { - Vertical.separator -sticky nswe - } - - ttk::style layout Horizontal.Tick.TScale { - Horizontal.TickScale.trough -sticky ew -children { - Horizontal.TickScale.slider -sticky w - } - } - - ttk::style layout Vertical.Tick.TScale { - Vertical.TickScale.trough -sticky ns -children { - Vertical.TickScale.slider -sticky n - } - } - - ttk::style layout Card.TFrame { - Card.field { - Card.padding -expand 1 - } - } - - ttk::style layout TLabelframe { - Labelframe.border { - Labelframe.padding -expand 1 -children { - Labelframe.label -side right - } - } - } - - ttk::style layout TNotebook.Tab { - Notebook.tab -children { - Notebook.padding -side top -children { - Notebook.label -side top -sticky {} - } - } - } - - ttk::style layout Treeview.Item { - Treeitem.padding -sticky nswe -children { - Treeitem.indicator -side left -sticky {} - Treeitem.image -side left -sticky {} - Treeitem.text -side left -sticky {} - } - } - - - # Elements - - # Button - ttk::style configure TButton -padding {8 4 8 4} -width -10 -anchor center - - ttk::style element create Button.button image \ - [list $I(rect-basic) \ - {selected disabled} $I(rect-basic) \ - disabled $I(rect-basic) \ - pressed $I(rect-basic) \ - selected $I(rect-basic) \ - active $I(button-hover) \ - focus $I(button-hover) \ - ] -border 4 -sticky ewns - - # Toolbutton - ttk::style configure Toolbutton -padding {8 4 8 4} -width -10 -anchor center - - ttk::style element create Toolbutton.button image \ - [list $I(empty) \ - {selected disabled} $I(empty) \ - disabled $I(empty) \ - pressed $I(rect-basic) \ - selected $I(rect-basic) \ - active $I(rect-basic) \ - ] -border 4 -sticky ewns - - # Menubutton - ttk::style configure TMenubutton -padding {8 4 4 4} - - ttk::style element create Menubutton.button \ - image [list $I(rect-basic) \ - disabled $I(rect-basic) \ - pressed $I(rect-basic) \ - active $I(button-hover) \ - ] -border 4 -sticky ewns - - ttk::style element create Menubutton.indicator \ - image [list $I(down) \ - active $I(down) \ - pressed $I(down) \ - disabled $I(down) \ - ] -width 15 -sticky e - - # OptionMenu - ttk::style configure TOptionMenu -padding {8 4 4 4} - - ttk::style element create OptionMenu.button \ - image [list $I(rect-basic) \ - disabled $I(rect-basic) \ - pressed $I(rect-basic) \ - active $I(button-hover) \ - ] -border 4 -sticky ewns - - ttk::style element create OptionMenu.indicator \ - image [list $I(down) \ - active $I(down) \ - pressed $I(down) \ - disabled $I(down) \ - ] -width 15 -sticky e - - # AccentButton - ttk::style configure Accent.TButton -padding {8 4 8 4} -width -10 -anchor center - - ttk::style element create AccentButton.button image \ - [list $I(rect-accent) \ - {selected disabled} $I(rect-accent-hover) \ - disabled $I(rect-accent-hover) \ - pressed $I(rect-accent) \ - selected $I(rect-accent) \ - active $I(rect-accent-hover) \ - focus $I(rect-accent-hover) \ - ] -border 4 -sticky ewns - - # Checkbutton - ttk::style configure TCheckbutton -padding 4 - - ttk::style element create Checkbutton.indicator image \ - [list $I(box-basic) \ - {alternate disabled} $I(check-tri-basic) \ - {selected disabled} $I(check-basic) \ - disabled $I(box-basic) \ - {pressed alternate} $I(check-tri-hover) \ - {active alternate} $I(check-tri-hover) \ - alternate $I(check-tri-accent) \ - {pressed selected} $I(check-hover) \ - {active selected} $I(check-hover) \ - selected $I(check-accent) \ - {pressed !selected} $I(rect-hover) \ - active $I(box-hover) \ - ] -width 26 -sticky w - - # Switch - ttk::style element create Switch.indicator image \ - [list $I(off-basic) \ - {selected disabled} $I(on-basic) \ - disabled $I(off-basic) \ - {pressed selected} $I(on-accent) \ - {active selected} $I(on-accent) \ - selected $I(on-accent) \ - {pressed !selected} $I(off-basic) \ - active $I(off-basic) \ - ] -width 46 -sticky w - - # ToggleButton - ttk::style configure Toggle.TButton -padding {8 4 8 4} -width -10 -anchor center - - ttk::style element create ToggleButton.button image \ - [list $I(rect-basic) \ - {selected disabled} $I(rect-accent-hover) \ - disabled $I(rect-basic) \ - {pressed selected} $I(rect-basic) \ - {active selected} $I(rect-accent) \ - selected $I(rect-accent) \ - {pressed !selected} $I(rect-accent) \ - active $I(rect-basic) \ - ] -border 4 -sticky ewns - - # Radiobutton - ttk::style configure TRadiobutton -padding 4 - - ttk::style element create Radiobutton.indicator image \ - [list $I(outline-basic) \ - {alternate disabled} $I(radio-tri-basic) \ - {selected disabled} $I(radio-basic) \ - disabled $I(outline-basic) \ - {pressed alternate} $I(radio-tri-hover) \ - {active alternate} $I(radio-tri-hover) \ - alternate $I(radio-tri-accent) \ - {pressed selected} $I(radio-hover) \ - {active selected} $I(radio-hover) \ - selected $I(radio-accent) \ - {pressed !selected} $I(circle-hover) \ - active $I(outline-hover) \ - ] -width 26 -sticky w - - # Scrollbar - ttk::style element create Horizontal.Scrollbar.trough image $I(hor-basic) \ - -sticky ew - - ttk::style element create Horizontal.Scrollbar.thumb \ - image [list $I(hor-accent) \ - disabled $I(hor-basic) \ - pressed $I(hor-hover) \ - active $I(hor-hover) \ - ] -sticky ew - - ttk::style element create Vertical.Scrollbar.trough image $I(vert-basic) \ - -sticky ns - - ttk::style element create Vertical.Scrollbar.thumb \ - image [list $I(vert-accent) \ - disabled $I(vert-basic) \ - pressed $I(vert-hover) \ - active $I(vert-hover) \ - ] -sticky ns - - # Scale - ttk::style element create Horizontal.Scale.trough image $I(scale-hor) \ - -border 5 -padding 0 - - ttk::style element create Horizontal.Scale.slider \ - image [list $I(circle-accent) \ - disabled $I(circle-basic) \ - pressed $I(circle-hover) \ - active $I(circle-hover) \ - ] -sticky {} - - ttk::style element create Vertical.Scale.trough image $I(scale-vert) \ - -border 5 -padding 0 - - ttk::style element create Vertical.Scale.slider \ - image [list $I(circle-accent) \ - disabled $I(circle-basic) \ - pressed $I(circle-hover) \ - active $I(circle-hover) \ - ] -sticky {} - - # Tickscale - ttk::style element create Horizontal.TickScale.trough image $I(scale-hor) \ - -border 5 -padding 0 - - ttk::style element create Horizontal.TickScale.slider \ - image [list $I(tick-hor-accent) \ - disabled $I(tick-hor-basic) \ - pressed $I(tick-hor-hover) \ - active $I(tick-hor-hover) \ - ] -sticky {} - - ttk::style element create Vertical.TickScale.trough image $I(scale-vert) \ - -border 5 -padding 0 - - ttk::style element create Vertical.TickScale.slider \ - image [list $I(tick-vert-accent) \ - disabled $I(tick-vert-basic) \ - pressed $I(tick-vert-hover) \ - active $I(tick-vert-hover) \ - ] -sticky {} - - # Progressbar - ttk::style element create Horizontal.Progressbar.trough image $I(hor-basic) \ - -sticky ew - - ttk::style element create Horizontal.Progressbar.pbar image $I(hor-accent) \ - -sticky ew - - ttk::style element create Vertical.Progressbar.trough image $I(vert-basic) \ - -sticky ns - - ttk::style element create Vertical.Progressbar.pbar image $I(vert-accent) \ - -sticky ns - - # Entry - ttk::style element create Entry.field \ - image [list $I(box-basic) \ - {focus hover} $I(box-accent) \ - invalid $I(box-invalid) \ - disabled $I(box-basic) \ - focus $I(box-accent) \ - hover $I(box-hover) \ - ] -border 5 -padding {8} -sticky news - - # Combobox - ttk::style map TCombobox -selectbackground [list \ - {!focus} $colors(-selectbg) \ - {readonly hover} $colors(-selectbg) \ - {readonly focus} $colors(-selectbg) \ - ] - - ttk::style map TCombobox -selectforeground [list \ - {!focus} $colors(-selectfg) \ - {readonly hover} $colors(-selectfg) \ - {readonly focus} $colors(-selectfg) \ - ] - - ttk::style element create Combobox.field \ - image [list $I(box-basic) \ - {readonly disabled} $I(rect-basic) \ - {readonly pressed} $I(rect-basic) \ - {readonly focus hover} $I(button-hover) \ - {readonly focus} $I(button-hover) \ - {readonly hover} $I(button-hover) \ - {focus hover} $I(box-accent) \ - readonly $I(rect-basic) \ - invalid $I(box-invalid) \ - disabled $I(box-basic) \ - focus $I(box-accent) \ - hover $I(box-hover) \ - ] -border 5 -padding {8} - - ttk::style element create Combobox.button \ - image [list $I(combo-button-basic) \ - {!readonly focus} $I(combo-button-focus) \ - {readonly focus} $I(combo-button-hover) \ - {readonly hover} $I(combo-button-hover) - ] -border 5 -padding {2 6 6 6} - - ttk::style element create Combobox.arrow image $I(down) \ - -width 15 -sticky e - - # Spinbox - ttk::style element create Spinbox.field \ - image [list $I(box-basic) \ - invalid $I(box-invalid) \ - disabled $I(box-basic) \ - focus $I(box-accent) \ - hover $I(box-hover) \ - ] -border 5 -padding {8} -sticky news - - ttk::style element create Spinbox.uparrow \ - image [list $I(up) \ - disabled $I(up) \ - pressed $I(up-accent) \ - active $I(up-accent) \ - ] -border 4 -width 15 -sticky e - - ttk::style element create Spinbox.downarrow \ - image [list $I(down) \ - disabled $I(down) \ - pressed $I(down-accent) \ - active $I(down-accent) \ - ] -border 4 -width 15 -sticky e - - ttk::style element create Spinbox.button \ - image [list $I(combo-button-basic) \ - {!readonly focus} $I(combo-button-focus) \ - {readonly focus} $I(combo-button-hover) \ - {readonly hover} $I(combo-button-hover) - ] -border 5 -padding {2 6 6 6} - - # Sizegrip - ttk::style element create Sizegrip.sizegrip image $I(size) \ - -sticky ewns - - # Separator - ttk::style element create Horizontal.separator image $I(separator) - - ttk::style element create Vertical.separator image $I(separator) - - # Card - ttk::style element create Card.field image $I(card) \ - -border 10 -padding 4 -sticky news - - # Labelframe - ttk::style element create Labelframe.border image $I(card) \ - -border 5 -padding 4 -sticky news - - # Notebook - ttk::style element create Notebook.client \ - image $I(notebook) -border 5 - - ttk::style element create Notebook.tab \ - image [list $I(tab-disabled) \ - selected $I(tab-basic) \ - active $I(tab-hover) \ - ] -border 5 -padding {14 4} - - # Treeview - ttk::style element create Treeview.field image $I(card) \ - -border 5 - - ttk::style element create Treeheading.cell \ - image [list $I(tree-basic) \ - pressed $I(tree-pressed) - ] -border 5 -padding 4 -sticky ewns - - ttk::style element create Treeitem.indicator \ - image [list $I(right) \ - user2 $I(empty) \ - user1 $I(down) \ - ] -width 26 -sticky {} - - ttk::style configure Treeview -background $colors(-bg) - ttk::style configure Treeview.Item -padding {2 0 0 0} - ttk::style map Treeview \ - -background [list selected $colors(-selectbg)] \ - -foreground [list selected $colors(-selectfg)] - - # Panedwindow - # Insane hack to remove clam's ugly sash - ttk::style configure Sash -gripcount 0 - } -} diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/box-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/box-accent.png deleted file mode 100644 index d0e186b..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/box-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/box-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/box-basic.png deleted file mode 100644 index 0b28fed..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/box-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/box-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/box-hover.png deleted file mode 100644 index 3ca7c19..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/box-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/box-invalid.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/box-invalid.png deleted file mode 100644 index f180e94..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/box-invalid.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/button-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/button-hover.png deleted file mode 100644 index 300eb09..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/button-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/card.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/card.png deleted file mode 100644 index 3978e9f..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/card.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/check-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/check-accent.png deleted file mode 100644 index 9854ec3..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/check-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/check-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/check-basic.png deleted file mode 100644 index 529718e..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/check-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/check-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/check-hover.png deleted file mode 100644 index c96c80c..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/check-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/check-tri-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/check-tri-accent.png deleted file mode 100644 index c0539f9..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/check-tri-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/check-tri-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/check-tri-basic.png deleted file mode 100644 index d0188f5..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/check-tri-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/check-tri-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/check-tri-hover.png deleted file mode 100644 index ae3e19f..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/check-tri-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/circle-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/circle-accent.png deleted file mode 100644 index e9a5ee5..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/circle-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/circle-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/circle-basic.png deleted file mode 100644 index 85f2bac..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/circle-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/circle-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/circle-hover.png deleted file mode 100644 index b439cd6..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/circle-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/combo-button-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/combo-button-basic.png deleted file mode 100644 index 4aef1b2..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/combo-button-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/combo-button-focus.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/combo-button-focus.png deleted file mode 100644 index 5b1e0ff..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/combo-button-focus.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/combo-button-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/combo-button-hover.png deleted file mode 100644 index 493cf52..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/combo-button-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/down-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/down-accent.png deleted file mode 100644 index 5bb987d..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/down-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/down.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/down.png deleted file mode 100644 index d83f92d..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/down.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/empty.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/empty.png deleted file mode 100644 index 202e3de..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/empty.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/hor-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/hor-accent.png deleted file mode 100644 index e59a1c6..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/hor-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/hor-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/hor-basic.png deleted file mode 100644 index bbc2e50..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/hor-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/hor-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/hor-hover.png deleted file mode 100644 index 56216f4..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/hor-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/notebook.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/notebook.png deleted file mode 100644 index 5b937c1..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/notebook.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/off-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/off-basic.png deleted file mode 100644 index 2ca539a..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/off-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/on-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/on-accent.png deleted file mode 100644 index 4a33465..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/on-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/on-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/on-basic.png deleted file mode 100644 index 9dce6a5..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/on-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/outline-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/outline-basic.png deleted file mode 100644 index 2f76a1b..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/outline-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/outline-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/outline-hover.png deleted file mode 100644 index 7ce5290..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/outline-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/radio-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/radio-accent.png deleted file mode 100644 index c34e4a8..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/radio-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/radio-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/radio-basic.png deleted file mode 100644 index f9b55a6..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/radio-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/radio-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/radio-hover.png deleted file mode 100644 index 4f3eab8..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/radio-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/radio-tri-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/radio-tri-accent.png deleted file mode 100644 index 8084141..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/radio-tri-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/radio-tri-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/radio-tri-basic.png deleted file mode 100644 index def9e27..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/radio-tri-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/radio-tri-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/radio-tri-hover.png deleted file mode 100644 index 86f1b59..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/radio-tri-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/rect-accent-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/rect-accent-hover.png deleted file mode 100644 index bb49129..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/rect-accent-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/rect-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/rect-accent.png deleted file mode 100644 index 5e7c72c..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/rect-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/rect-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/rect-basic.png deleted file mode 100644 index 8ab4d10..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/rect-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/rect-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/rect-hover.png deleted file mode 100644 index b9e4c35..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/rect-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/right.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/right.png deleted file mode 100644 index bc840c2..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/right.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/scale-hor.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/scale-hor.png deleted file mode 100644 index 570530e..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/scale-hor.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/scale-vert.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/scale-vert.png deleted file mode 100644 index c6fcf6f..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/scale-vert.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/separator.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/separator.png deleted file mode 100644 index 411c970..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/separator.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/size.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/size.png deleted file mode 100644 index 51c682e..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/size.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tab-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tab-basic.png deleted file mode 100644 index 6db676b..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tab-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tab-disabled.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tab-disabled.png deleted file mode 100644 index 736c438..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tab-disabled.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tab-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tab-hover.png deleted file mode 100644 index 213e82b..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tab-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tick-hor-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tick-hor-accent.png deleted file mode 100644 index b7c28dd..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tick-hor-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tick-hor-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tick-hor-basic.png deleted file mode 100644 index ee4b441..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tick-hor-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tick-hor-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tick-hor-hover.png deleted file mode 100644 index bc859f4..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tick-hor-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tick-vert-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tick-vert-accent.png deleted file mode 100644 index da4f481..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tick-vert-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tick-vert-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tick-vert-basic.png deleted file mode 100644 index 9e0a5ee..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tick-vert-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tick-vert-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tick-vert-hover.png deleted file mode 100644 index e9ff3a3..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tick-vert-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tree-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tree-basic.png deleted file mode 100644 index c71808d..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tree-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tree-pressed.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tree-pressed.png deleted file mode 100644 index 96d3a53..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/tree-pressed.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/up-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/up-accent.png deleted file mode 100644 index 54a20f8..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/up-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/up.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/up.png deleted file mode 100644 index 069d440..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/up.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/vert-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/vert-accent.png deleted file mode 100644 index 1c228fd..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/vert-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/vert-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/vert-basic.png deleted file mode 100644 index 4f6c46e..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/vert-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/vert-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/vert-hover.png deleted file mode 100644 index 142ccce..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/dark/vert-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light.tcl b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light.tcl deleted file mode 100644 index 29bdb03..0000000 --- a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light.tcl +++ /dev/null @@ -1,539 +0,0 @@ -# Copyright (c) 2021 rdbende - -# The Azure theme is a beautiful modern ttk theme inspired by Microsoft's fluent design. - -package require Tk 8.6 - -namespace eval ttk::theme::azure-light { - variable version 2.0 - package provide ttk::theme::azure-light $version - - ttk::style theme create azure-light -parent clam -settings { - proc load_images {imgdir} { - variable I - foreach file [glob -directory $imgdir *.png] { - set img [file tail [file rootname $file]] - set I($img) [image create photo -file $file -format png] - } - } - - load_images [file join [file dirname [info script]] light] - - array set colors { - -fg "#000000" - -bg "#ffffff" - -disabledfg "#737373" - -disabledbg "#ffffff" - -selectfg "#ffffff" - -selectbg "#007fff" - } - - ttk::style layout TButton { - Button.button -children { - Button.padding -children { - Button.label -side left -expand true - } - } - } - - ttk::style layout Toolbutton { - Toolbutton.button -children { - Toolbutton.padding -children { - Toolbutton.label -side left -expand true - } - } - } - - ttk::style layout TMenubutton { - Menubutton.button -children { - Menubutton.padding -children { - Menubutton.indicator -side right - Menubutton.label -side right -expand true - } - } - } - - ttk::style layout TOptionMenu { - OptionMenu.button -children { - OptionMenu.padding -children { - OptionMenu.indicator -side right - OptionMenu.label -side right -expand true - } - } - } - - ttk::style layout Accent.TButton { - AccentButton.button -children { - AccentButton.padding -children { - AccentButton.label -side left -expand true - } - } - } - - ttk::style layout TCheckbutton { - Checkbutton.button -children { - Checkbutton.padding -children { - Checkbutton.indicator -side left - Checkbutton.label -side right -expand true - } - } - } - - ttk::style layout Switch.TCheckbutton { - Switch.button -children { - Switch.padding -children { - Switch.indicator -side left - Switch.label -side right -expand true - } - } - } - - ttk::style layout Toggle.TButton { - ToggleButton.button -children { - ToggleButton.padding -children { - ToggleButton.label -side left -expand true - } - } - } - - ttk::style layout TRadiobutton { - Radiobutton.button -children { - Radiobutton.padding -children { - Radiobutton.indicator -side left - Radiobutton.label -side right -expand true - } - } - } - - ttk::style layout Vertical.TScrollbar { - Vertical.Scrollbar.trough -sticky ns -children { - Vertical.Scrollbar.thumb -expand true - } - } - - ttk::style layout Horizontal.TScrollbar { - Horizontal.Scrollbar.trough -sticky ew -children { - Horizontal.Scrollbar.thumb -expand true - } - } - - ttk::style layout TCombobox { - Combobox.field -sticky nswe -children { - Combobox.padding -expand true -sticky nswe -children { - Combobox.textarea -sticky nswe - } - } - Combobox.button -side right -sticky ns -children { - Combobox.arrow -sticky nsew - } - } - - ttk::style layout TSpinbox { - Spinbox.field -sticky nsew -children { - Spinbox.padding -expand true -sticky nswe -children { - Spinbox.textarea -sticky nswe - } - - } - Spinbox.button -side right -sticky ns -children { - null -side right -children { - Spinbox.uparrow -side top - Spinbox.downarrow -side bottom - } - } - } - - ttk::style layout Horizontal.TSeparator { - Horizontal.separator -sticky nswe - } - - ttk::style layout Vertical.TSeparator { - Vertical.separator -sticky nswe - } - - ttk::style layout Horizontal.Tick.TScale { - Horizontal.TickScale.trough -sticky ew -children { - Horizontal.TickScale.slider -sticky w - } - } - - ttk::style layout Vertical.Tick.TScale { - Vertical.TickScale.trough -sticky ns -children { - Vertical.TickScale.slider -sticky n - } - } - - ttk::style layout Card.TFrame { - Card.field { - Card.padding -expand 1 - } - } - - ttk::style layout TLabelframe { - Labelframe.border { - Labelframe.padding -expand 1 -children { - Labelframe.label -side right - } - } - } - - ttk::style layout TNotebook.Tab { - Notebook.tab -children { - Notebook.padding -side top -children { - Notebook.label -side top -sticky {} - } - } - } - - ttk::style layout Treeview.Item { - Treeitem.padding -sticky nswe -children { - Treeitem.indicator -side left -sticky {} - Treeitem.image -side left -sticky {} - Treeitem.text -side left -sticky {} - } - } - - - # Elements - - # Button - ttk::style configure TButton -padding {8 4 8 4} -width -10 -anchor center - - ttk::style element create Button.button image \ - [list $I(rect-basic) \ - {selected disabled} $I(rect-basic) \ - disabled $I(rect-basic) \ - selected $I(rect-basic) \ - pressed $I(rect-basic) \ - active $I(button-hover) \ - focus $I(button-hover) \ - ] -border 4 -sticky ewns - - # Toolbutton - ttk::style configure Toolbutton -padding {8 4 8 4} -width -10 -anchor center - - ttk::style element create Toolbutton.button image \ - [list $I(empty) \ - {selected disabled} $I(empty) \ - disabled $I(empty) \ - selected $I(rect-basic) \ - pressed $I(rect-basic) \ - active $I(rect-basic) \ - ] -border 4 -sticky ewns - - # Menubutton - ttk::style configure TMenubutton -padding {8 4 4 4} - - ttk::style element create Menubutton.button \ - image [list $I(rect-basic) \ - disabled $I(rect-basic) \ - pressed $I(rect-basic) \ - active $I(button-hover) \ - ] -border 4 -sticky ewns - - ttk::style element create Menubutton.indicator \ - image [list $I(down) \ - active $I(down) \ - pressed $I(down) \ - disabled $I(down) \ - ] -width 15 -sticky e - - # OptionMenu - ttk::style configure TOptionMenu -padding {8 4 4 4} - - ttk::style element create OptionMenu.button \ - image [list $I(rect-basic) \ - disabled $I(rect-basic) \ - pressed $I(rect-basic) \ - active $I(button-hover) \ - ] -border 4 -sticky ewns - - ttk::style element create OptionMenu.indicator \ - image [list $I(down) \ - active $I(down) \ - pressed $I(down) \ - disabled $I(down) \ - ] -width 15 -sticky e - - # AccentButton - ttk::style configure Accent.TButton -padding {8 4 8 4} -width -10 -anchor center - - ttk::style element create AccentButton.button image \ - [list $I(rect-accent) \ - {selected disabled} $I(rect-accent-hover) \ - disabled $I(rect-accent-hover) \ - selected $I(rect-accent) \ - pressed $I(rect-accent) \ - active $I(rect-accent-hover) \ - focus $I(rect-accent-hover) \ - ] -border 4 -sticky ewns - - # Checkbutton - ttk::style configure TCheckbutton -padding 4 - - ttk::style element create Checkbutton.indicator image \ - [list $I(box-basic) \ - {alternate disabled} $I(check-tri-basic) \ - {selected disabled} $I(check-basic) \ - disabled $I(box-basic) \ - {pressed alternate} $I(check-tri-hover) \ - {active alternate} $I(check-tri-hover) \ - alternate $I(check-tri-accent) \ - {pressed selected} $I(check-hover) \ - {active selected} $I(check-hover) \ - selected $I(check-accent) \ - {pressed !selected} $I(rect-hover) \ - active $I(box-hover) \ - ] -width 26 -sticky w - - # Switch - ttk::style element create Switch.indicator image \ - [list $I(off-basic) \ - {selected disabled} $I(on-basic) \ - disabled $I(off-basic) \ - {pressed selected} $I(on-hover) \ - {active selected} $I(on-hover) \ - selected $I(on-accent) \ - {pressed !selected} $I(off-hover) \ - active $I(off-hover) \ - ] -width 46 -sticky w - - # ToggleButton - ttk::style configure Toggle.TButton -padding {8 4 8 4} -width -10 -anchor center - - ttk::style element create ToggleButton.button image \ - [list $I(rect-basic) \ - {selected disabled} $I(rect-accent-hover) \ - disabled $I(rect-basic) \ - {pressed selected} $I(rect-basic) \ - {active selected} $I(rect-accent) \ - selected $I(rect-accent) \ - {pressed !selected} $I(rect-accent) \ - active $I(rect-basic) \ - ] -border 4 -sticky ewns - - # Radiobutton - ttk::style configure TRadiobutton -padding 4 - - ttk::style element create Radiobutton.indicator image \ - [list $I(outline-basic) \ - {alternate disabled} $I(radio-tri-basic) \ - {selected disabled} $I(radio-basic) \ - disabled $I(outline-basic) \ - {pressed alternate} $I(radio-tri-hover) \ - {active alternate} $I(radio-tri-hover) \ - alternate $I(radio-tri-accent) \ - {pressed selected} $I(radio-hover) \ - {active selected} $I(radio-hover) \ - selected $I(radio-accent) \ - {pressed !selected} $I(circle-hover) \ - active $I(outline-hover) \ - ] -width 26 -sticky w - - # Scrollbar - ttk::style element create Horizontal.Scrollbar.trough image $I(hor-basic) \ - -sticky ew - - ttk::style element create Horizontal.Scrollbar.thumb \ - image [list $I(hor-accent) \ - disabled $I(hor-basic) \ - pressed $I(hor-hover) \ - active $I(hor-hover) \ - ] -sticky ew - - ttk::style element create Vertical.Scrollbar.trough image $I(vert-basic) \ - -sticky ns - - ttk::style element create Vertical.Scrollbar.thumb \ - image [list $I(vert-accent) \ - disabled $I(vert-basic) \ - pressed $I(vert-hover) \ - active $I(vert-hover) \ - ] -sticky ns - - # Scale - ttk::style element create Horizontal.Scale.trough image $I(scale-hor) \ - -border 5 -padding 0 - - ttk::style element create Horizontal.Scale.slider \ - image [list $I(circle-accent) \ - disabled $I(circle-basic) \ - pressed $I(circle-hover) \ - active $I(circle-hover) \ - ] -sticky {} - - ttk::style element create Vertical.Scale.trough image $I(scale-vert) \ - -border 5 -padding 0 - - ttk::style element create Vertical.Scale.slider \ - image [list $I(circle-accent) \ - disabled $I(circle-basic) \ - pressed $I(circle-hover) \ - active $I(circle-hover) \ - ] -sticky {} - - # Tickscale - ttk::style element create Horizontal.TickScale.trough image $I(scale-hor) \ - -border 5 -padding 0 - - ttk::style element create Horizontal.TickScale.slider \ - image [list $I(tick-hor-accent) \ - disabled $I(tick-hor-basic) \ - pressed $I(tick-hor-hover) \ - active $I(tick-hor-hover) \ - ] -sticky {} - - ttk::style element create Vertical.TickScale.trough image $I(scale-vert) \ - -border 5 -padding 0 - - ttk::style element create Vertical.TickScale.slider \ - image [list $I(tick-vert-accent) \ - disabled $I(tick-vert-basic) \ - pressed $I(tick-vert-hover) \ - active $I(tick-vert-hover) \ - ] -sticky {} - - # Progressbar - ttk::style element create Horizontal.Progressbar.trough image $I(hor-basic) \ - -sticky ew - - ttk::style element create Horizontal.Progressbar.pbar image $I(hor-accent) \ - -sticky ew - - ttk::style element create Vertical.Progressbar.trough image $I(vert-basic) \ - -sticky ns - - ttk::style element create Vertical.Progressbar.pbar image $I(vert-accent) \ - -sticky ns - - # Entry - ttk::style element create Entry.field \ - image [list $I(box-basic) \ - {focus hover} $I(box-accent) \ - invalid $I(box-invalid) \ - disabled $I(box-basic) \ - focus $I(box-accent) \ - hover $I(box-hover) \ - ] -border 5 -padding {8} -sticky news - - # Combobox - ttk::style map TCombobox -selectbackground [list \ - {!focus} $colors(-selectbg) \ - {readonly hover} $colors(-selectbg) \ - {readonly focus} $colors(-selectbg) \ - ] - - ttk::style map TCombobox -selectforeground [list \ - {!focus} $colors(-selectfg) \ - {readonly hover} $colors(-selectfg) \ - {readonly focus} $colors(-selectfg) \ - ] - - ttk::style element create Combobox.field \ - image [list $I(box-basic) \ - {readonly disabled} $I(rect-basic) \ - {readonly pressed} $I(rect-basic) \ - {readonly focus hover} $I(button-hover) \ - {readonly focus} $I(button-hover) \ - {readonly hover} $I(button-hover) \ - {focus hover} $I(box-accent) \ - readonly $I(rect-basic) \ - invalid $I(box-invalid) \ - disabled $I(box-basic) \ - focus $I(box-accent) \ - hover $I(box-hover) \ - ] -border 5 -padding {8} - - ttk::style element create Combobox.button \ - image [list $I(combo-button-basic) \ - {!readonly focus} $I(combo-button-focus) \ - {readonly focus} $I(combo-button-hover) \ - {readonly hover} $I(combo-button-hover) - ] -border 5 -padding {2 6 6 6} - - ttk::style element create Combobox.arrow image $I(down) \ - -width 15 -sticky e - - # Spinbox - ttk::style element create Spinbox.field \ - image [list $I(box-basic) \ - invalid $I(box-invalid) \ - disabled $I(box-basic) \ - focus $I(box-accent) \ - hover $I(box-hover) \ - ] -border 5 -padding {8} -sticky news - - ttk::style element create Spinbox.uparrow \ - image [list $I(up) \ - disabled $I(up) \ - pressed $I(up-accent) \ - active $I(up-accent) \ - ] -border 4 -width 15 -sticky e - - ttk::style element create Spinbox.downarrow \ - image [list $I(down) \ - disabled $I(down) \ - pressed $I(down-accent) \ - active $I(down-accent) \ - ] -border 4 -width 15 -sticky e - - ttk::style element create Spinbox.button \ - image [list $I(combo-button-basic) \ - {!readonly focus} $I(combo-button-focus) \ - {readonly focus} $I(combo-button-hover) \ - {readonly hover} $I(combo-button-hover) - ] -border 5 -padding {2 6 6 6} - - # Sizegrip - ttk::style element create Sizegrip.sizegrip image $I(size) \ - -sticky ewns - - # Separator - ttk::style element create Horizontal.separator image $I(separator) - - ttk::style element create Vertical.separator image $I(separator) - - # Card - ttk::style element create Card.field image $I(card) \ - -border 10 -padding 4 -sticky news - - # Labelframe - ttk::style element create Labelframe.border image $I(card) \ - -border 5 -padding 4 -sticky news - - # Notebook - ttk::style element create Notebook.client \ - image $I(notebook) -border 5 - - ttk::style element create Notebook.tab \ - image [list $I(tab-disabled) \ - selected $I(tab-basic) \ - active $I(tab-hover) \ - ] -border 5 -padding {14 4} - - # Treeview - ttk::style element create Treeview.field image $I(card) \ - -border 5 - - ttk::style element create Treeheading.cell \ - image [list $I(tree-basic) \ - pressed $I(tree-pressed) - ] -border 5 -padding 4 -sticky ewns - - ttk::style element create Treeitem.indicator \ - image [list $I(right) \ - user2 $I(empty) \ - user1 $I(down) \ - ] -width 26 -sticky {} - - ttk::style configure Treeview -background $colors(-bg) - ttk::style configure Treeview.Item -padding {2 0 0 0} - ttk::style map Treeview \ - -background [list selected #ccc] \ - -foreground [list selected $colors(-fg)] - - # Panedwindow - # Insane hack to remove clam's ugly sash - ttk::style configure Sash -gripcount 0 - } -} diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/box-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/box-accent.png deleted file mode 100644 index 89f1faf..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/box-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/box-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/box-basic.png deleted file mode 100644 index 090a00b..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/box-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/box-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/box-hover.png deleted file mode 100644 index e691da4..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/box-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/box-invalid.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/box-invalid.png deleted file mode 100644 index 1f16f5c..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/box-invalid.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/button-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/button-hover.png deleted file mode 100644 index 13366eb..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/button-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/card.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/card.png deleted file mode 100644 index 09152f5..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/card.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/check-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/check-accent.png deleted file mode 100644 index 4aea79b..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/check-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/check-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/check-basic.png deleted file mode 100644 index 0c00612..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/check-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/check-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/check-hover.png deleted file mode 100644 index 3811696..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/check-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/check-tri-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/check-tri-accent.png deleted file mode 100644 index d6baad5..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/check-tri-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/check-tri-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/check-tri-basic.png deleted file mode 100644 index e92bea5..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/check-tri-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/check-tri-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/check-tri-hover.png deleted file mode 100644 index d611d76..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/check-tri-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/circle-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/circle-accent.png deleted file mode 100644 index ea76e7a..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/circle-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/circle-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/circle-basic.png deleted file mode 100644 index b16202e..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/circle-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/circle-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/circle-hover.png deleted file mode 100644 index 6ea1803..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/circle-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/combo-button-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/combo-button-basic.png deleted file mode 100644 index b7daa04..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/combo-button-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/combo-button-focus.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/combo-button-focus.png deleted file mode 100644 index 59c7db4..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/combo-button-focus.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/combo-button-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/combo-button-hover.png deleted file mode 100644 index 1d06c57..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/combo-button-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/down-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/down-accent.png deleted file mode 100644 index 5bb987d..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/down-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/down.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/down.png deleted file mode 100644 index 1fd7e4f..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/down.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/empty.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/empty.png deleted file mode 100644 index 202e3de..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/empty.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/hor-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/hor-accent.png deleted file mode 100644 index 145b10e..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/hor-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/hor-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/hor-basic.png deleted file mode 100644 index eb18d1e..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/hor-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/hor-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/hor-hover.png deleted file mode 100644 index 4d6c0f1..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/hor-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/notebook.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/notebook.png deleted file mode 100644 index 430d9f2..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/notebook.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/off-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/off-basic.png deleted file mode 100644 index cf383f0..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/off-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/off-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/off-hover.png deleted file mode 100644 index 893b39c..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/off-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/on-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/on-accent.png deleted file mode 100644 index f5a86c9..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/on-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/on-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/on-basic.png deleted file mode 100644 index 23ec72f..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/on-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/on-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/on-hover.png deleted file mode 100644 index d55f7ae..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/on-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/outline-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/outline-basic.png deleted file mode 100644 index 2e79874..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/outline-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/outline-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/outline-hover.png deleted file mode 100644 index 502915d..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/outline-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/radio-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/radio-accent.png deleted file mode 100644 index 1f7329d..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/radio-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/radio-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/radio-basic.png deleted file mode 100644 index 793531e..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/radio-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/radio-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/radio-hover.png deleted file mode 100644 index d6faa74..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/radio-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/radio-tri-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/radio-tri-accent.png deleted file mode 100644 index 86dd4cb..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/radio-tri-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/radio-tri-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/radio-tri-basic.png deleted file mode 100644 index da85d03..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/radio-tri-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/radio-tri-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/radio-tri-hover.png deleted file mode 100644 index ded14a6..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/radio-tri-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/rect-accent-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/rect-accent-hover.png deleted file mode 100644 index 5daa96a..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/rect-accent-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/rect-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/rect-accent.png deleted file mode 100644 index 2d08674..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/rect-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/rect-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/rect-basic.png deleted file mode 100644 index 239ca31..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/rect-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/rect-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/rect-hover.png deleted file mode 100644 index 9252c4f..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/rect-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/right.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/right.png deleted file mode 100644 index 8122cc9..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/right.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/scale-hor.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/scale-hor.png deleted file mode 100644 index d11f508..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/scale-hor.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/scale-vert.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/scale-vert.png deleted file mode 100644 index f78595d..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/scale-vert.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/separator.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/separator.png deleted file mode 100644 index 7bffc9a..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/separator.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/size.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/size.png deleted file mode 100644 index bde3ade..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/size.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tab-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tab-basic.png deleted file mode 100644 index 365fdff..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tab-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tab-disabled.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tab-disabled.png deleted file mode 100644 index eeee518..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tab-disabled.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tab-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tab-hover.png deleted file mode 100644 index 5003806..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tab-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tick-hor-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tick-hor-accent.png deleted file mode 100644 index 6940b1c..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tick-hor-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tick-hor-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tick-hor-basic.png deleted file mode 100644 index ba727d7..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tick-hor-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tick-hor-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tick-hor-hover.png deleted file mode 100644 index cb66b59..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tick-hor-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tick-vert-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tick-vert-accent.png deleted file mode 100644 index dfdb89c..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tick-vert-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tick-vert-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tick-vert-basic.png deleted file mode 100644 index a58440d..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tick-vert-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tick-vert-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tick-vert-hover.png deleted file mode 100644 index 18cbec5..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tick-vert-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tree-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tree-basic.png deleted file mode 100644 index 755062b..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tree-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tree-pressed.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tree-pressed.png deleted file mode 100644 index ee28416..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/tree-pressed.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/up-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/up-accent.png deleted file mode 100644 index 54a20f8..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/up-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/up.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/up.png deleted file mode 100644 index 16568f2..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/up.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/vert-accent.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/vert-accent.png deleted file mode 100644 index 7f87bdc..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/vert-accent.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/vert-basic.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/vert-basic.png deleted file mode 100644 index d5f61ec..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/vert-basic.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/vert-hover.png b/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/vert-hover.png deleted file mode 100644 index bfdc9d0..0000000 Binary files a/src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/theme/light/vert-hover.png and /dev/null differ diff --git a/src/pupil_labs/automate_custom_events/__main__.py b/src/pupil_labs/automate_custom_events/__main__.py index d40c45a..4ea1a67 100644 --- a/src/pupil_labs/automate_custom_events/__main__.py +++ b/src/pupil_labs/automate_custom_events/__main__.py @@ -1,159 +1,140 @@ +from pathlib import Path import tkinter as tk from tkinter import ttk -from tkinter import messagebox +from tkinter.font import Font +import sv_ttk import asyncio -from pathlib import Path +from pupil_labs.automate_custom_events.tk_utils import TTKFormLayoutHelper, FolderSelector from pupil_labs.automate_custom_events.control_modules import run_modules + +# Function to toggle visibility of the general parameters frame +def toggle_general_parameters(): + if general_frame.winfo_viewable(): + general_frame.grid_remove() # Hide the general parameters frame + general_title.grid_remove() # Hide the general parameters title + else: + general_title.grid(row=layout_helper.row_idx) # Show the title + general_frame.grid(row=layout_helper.row_idx + 1, column=0, columnspan=2, sticky='ew') # Show the general parameters frame + + async def run_task(): try: - # Simulate long-running task - await asyncio.sleep(5) rec_id = rec_id_entry.get() workspace_id = workspace_id_entry.get() cloud_token = cloud_token_entry.get() - gm_description = description_entry.get() - gm_event_code = object_event_entry.get() - arm_activity1 = activity1_entry.get() - arm_event_code1 = code1_entry.get() + prompt_description = prompt_entry.get("1.0", "end-1c") + event_code = prompt_event_entry.get("1.0", "end-1c") batch_size = batch_entry.get() start_time_seconds = start_entry.get() end_time_seconds = end_entry.get() - OPENAI_API_KEY = openai_key_entry.get() - DOWNLOAD_PATH = Path(download_path_entry.get()) - recpath = Path(DOWNLOAD_PATH / rec_id) + openai_api_key = openai_key_entry.get() + download_path = Path(download_path_entry.get()) + recpath = Path(download_path / rec_id) - await run_modules(OPENAI_API_KEY, workspace_id, rec_id, cloud_token, DOWNLOAD_PATH, recpath, - gm_description, gm_event_code, arm_activity1, arm_event_code1, batch_size, + await run_modules(openai_api_key, workspace_id, rec_id, cloud_token, download_path, recpath, + prompt_description, event_code, batch_size, start_time_seconds, end_time_seconds) finally: progress_bar.stop() run_button.config(state="normal") + def clear_module_fields(): - # Hide all module-specific fields and buttons - for widget in [description_label, description_entry, - activity1_label, activity1_entry, code1_label, code1_entry, - object_event_label, object_event_entry, start_entry, start_label, end_entry, end_label, - run_button, clear_button]: - widget.grid_remove() + """Helper function to clear all general parameters and prompt fields.""" + widgets = [ + rec_id_entry, + workspace_id_entry, + cloud_token_entry, + openai_key_entry, + prompt_entry, + prompt_event_entry, + batch_entry, + start_entry, + end_entry + ] + + for widget in widgets: + if isinstance(widget, tk.Text): + widget.delete("1.0", tk.END) + else: + widget.delete(0, tk.END) + async def on_run_click(): - progress_bar.start(10) # Start progress bar + progress_bar.start() # Start progress bar run_button.config(state="disabled") # Disable run button to prevent multiple clicks await run_task() + progress_bar.stop() + # Create the main window root = tk.Tk() root.title("Module Controller") -root.geometry("800x700") +root.geometry("600x1000") -# Set a built-in ttk theme +root.columnconfigure(0, weight=0) +root.columnconfigure(1, weight=1) + +# Set a built-in ttk theme +sv_ttk.set_theme("dark") style = ttk.Style(root) -root.tk.call('source', './src/pupil_labs/automate_custom_events/Azure-ttk-theme-main/azure.tcl') # Put here the path of your theme file - -# Set the theme with the theme_use method -root.tk.call("set_theme", "dark") - -font_style = ('Helvetica', 15) -title_font_style = ('Helvetica', 18, 'bold') - -# General parameters title -general_params_label = ttk.Label(root, text="General Parameters", font=title_font_style) -general_params_label.grid(row=0, column=0, columnspan=2, padx=10, pady=10) - -# General parameters -ttk.Label(root, text="Recording ID:", font=font_style).grid(row=1, column=0, padx=10, pady=5) -rec_id_entry = ttk.Entry(root, font=font_style) -rec_id_entry.grid(row=1, column=1, padx=10, pady=5) -rec_id_entry.insert(0, '') - -ttk.Label(root, text="Workspace ID:", font=font_style).grid(row=2, column=0, padx=10, pady=5) -workspace_id_entry = ttk.Entry(root, font=font_style) -workspace_id_entry.grid(row=2, column=1, padx=10, pady=5) -workspace_id_entry.insert(0, "") - -ttk.Label(root, text="Cloud API Token:", font=font_style).grid(row=3, column=0, padx=10, pady=5) -cloud_token_entry = ttk.Entry(root, font=font_style, show='*') -cloud_token_entry.grid(row=3, column=1, padx=10, pady=5) -cloud_token_entry.insert(0, "") - -ttk.Label(root, text="OpenAI API Key:", font=font_style).grid(row=4, column=0, padx=10, pady=5) -openai_key_entry = ttk.Entry(root, font=font_style, show='*') -openai_key_entry.grid(row=4, column=1, padx=10, pady=5) -openai_key_entry.insert(0, "") - -ttk.Label(root, text="Download Path:", font=font_style).grid(row=5, column=0, padx=10, pady=5) -download_path_entry = ttk.Entry(root, font=font_style) -download_path_entry.grid(row=5, column=1, padx=10, pady=5) -download_path_entry.insert(0, "/Users/nadiapl/Downloads/recs.zip") - -# Gaze Module prompts title -gaze_module_label = ttk.Label(root, text="Gaze Module Prompts", font=title_font_style) -gaze_module_label.grid(row=6, column=0, columnspan=2, padx=10, pady=10) - -# Gaze Module fields -description_label = ttk.Label(root, text="Gaze behaviour description:", font=font_style) -description_entry = ttk.Entry(root, font=font_style, width=50) -description_label.grid(row=7, column=0, padx=10, pady=5) -description_entry.grid(row=7, column=1, padx=20, pady=20, ipadx=10, ipady=10) -description_entry.insert(0, "") - -object_event_label = ttk.Label(root, text="Event:", font=font_style) -object_event_entry = ttk.Entry(root, font=font_style) -object_event_label.grid(row=8, column=0, padx=10, pady=5) -object_event_entry.grid(row=8, column=1, padx=10, pady=5) -object_event_entry.insert(0, "") - -# Activity Recognition prompts title -activity_recognition_label = ttk.Label(root, text="Activity Recognition Prompts", font=title_font_style) -activity_recognition_label.grid(row=9, column=0, columnspan=2, padx=10, pady=10) - -# Activity Recognition fields -activity1_label = ttk.Label(root, text="Activity:", font=font_style) -activity1_entry = ttk.Entry(root, font=font_style, width=50) # Adjust width to make it visually bigger -activity1_label.grid(row=10, column=0, padx=10, pady=5) -activity1_entry.grid(row=10, column=1, padx=20, pady=20, ipadx=10, ipady=10) # Add internal padding for larger appearance -activity1_entry.insert(0, "") - - -code1_label = ttk.Label(root, text="Event:", font=font_style) -code1_entry = ttk.Entry(root, font=font_style) -code1_label.grid(row=11, column=0, padx=10, pady=5) -code1_entry.grid(row=11, column=1, padx=10, pady=5) -code1_entry.insert(0, "") - -batch_label = ttk.Label(root, text="Frame batch:", font=font_style) -batch_entry = ttk.Entry(root, font=font_style) -batch_label.grid(row=12, column=0, padx=10, pady=5) -batch_entry.grid(row=12, column=1, padx=10, pady=5) -batch_entry.insert(0, 30) - -start_label = ttk.Label(root, text="Start (s):", font=font_style) -start_entry = ttk.Entry(root, font=font_style) -start_label.grid(row=13, column=0, padx=10, pady=5) -start_entry.grid(row=13, column=1, padx=10, pady=5) -start_entry.insert(0, 0) - -end_label = ttk.Label(root, text="End (s):", font=font_style) -end_entry = ttk.Entry(root, font=font_style) -end_label.grid(row=14, column=0, padx=10, pady=5) -end_entry.grid(row=14, column=1, padx=10, pady=5) -end_entry.insert(0, 15) - -# Themed buttons -style.configure('TButton', font=font_style, padding=10) -style.configure('Accent.TButton', foreground='blue') - -run_button = ttk.Button(root, text="Run Modules", command=lambda: asyncio.run(on_run_click()), style='Accent.TButton') -clear_button = ttk.Button(root, text="Clear Fields", command=clear_module_fields, style='TButton') -run_button.grid(row=15, column=0, columnspan=2, pady=5) -clear_button.grid(row=16, column=0, columnspan=2, pady=5) + +heading_font = Font(font=style.lookup("TLabel", "font"), weight="bold") +heading_font.configure(size=heading_font.cget("size")) +style.configure("TLabel", padding=(20, 5)) +style.configure("Heading.TLabel", font=heading_font, padding=(10, 20)) +style.configure("Accent.TButton", foreground="blue") +layout_helper = TTKFormLayoutHelper(root) + +# Title for General Parameters (initially hidden) +general_title = tk.Label(root, text="General Parameters", font=heading_font) + +# General parameters (in a frame) +general_frame = ttk.Frame(root) + +# Create labeled entries for the general parameters using the helper functions +rec_id_entry = layout_helper.create_labeled_entry(general_frame, 'Recording ID', row=0, default_value='006875b0-0b90-46f7-858d-c949495804fa') +workspace_id_entry = layout_helper.create_labeled_entry(general_frame, 'Workspace ID', row=1, default_value='d6bde22c-0c74-4d7d-8ab6-65b665c3cb4e') +cloud_token_entry = layout_helper.create_labeled_entry(general_frame, 'Cloud API Token', row=2, show='*', default_value='CgwCxAZy4weDcaxmzpsDjWKPKsqTYbUY4DmdgwrP8GTa') +openai_key_entry = layout_helper.create_labeled_entry(general_frame, 'OpenAI API Key', row=3, show='*', default_value='sk-r6tWCqoKli236HVXvHvgUO9ZPCzTJWmE31zu8d4zhQT3BlbkFJ88iso4ktkTr-CvkJzofYGblisQPYZFFR-w3zqHX-4A') +download_path_entry = layout_helper.create_labeled_folder_selector(general_frame, 'Download Path', row=4, default_path=Path.cwd()) +batch_entry = layout_helper.create_labeled_entry(general_frame, 'Frame batch', row=5, default_value='20') +start_entry = layout_helper.create_labeled_entry(general_frame, 'Start (s)', row=6, default_value='60') +end_entry = layout_helper.create_labeled_entry(general_frame, 'End (s)', row=7, default_value='125') + +# Toggle Button for General Parameters +toggle_button = ttk.Button(root, text="Select recording", command=toggle_general_parameters) +layout_helper.add_row('', toggle_button, {'pady': 10}) + +# Initially hide the general parameters section +general_frame.grid(row=layout_helper.row_idx, column=0, columnspan=2, sticky='ew') +general_frame.grid_remove() # Hide at start +general_title.grid_remove() # Hide title at start + +# Prompts (always visible) in a separate frame +prompts_frame = ttk.Frame(root) +layout_helper.add_heading('Analyze this egocentric video, the red circle in the overlay indicates where the wearer is looking. \nNote the times when...') +prompt_entry = tk.Text(root, height=5, width=50, bg='gray', fg='white') +layout_helper.add_row(' ', prompt_entry, {'pady': 10}) +layout_helper.add_heading('... and report them with the following event names.') +prompt_event_entry = tk.Text(root, height=5, width=50, bg='gray', fg='white') +layout_helper.add_row(' ', prompt_event_entry, {'pady': 10}) + +# Place the prompts frame initially below the general parameters +prompts_frame.grid(row=layout_helper.row_idx + 1, column=0, columnspan=2, sticky='ew') + +# Buttons +layout_helper.add_spacer_row() +clear_button = ttk.Button(root, text="Reset form", command=clear_module_fields, style='TButton') +layout_helper.add_row('', clear_button, {'pady': 10}) + +run_button = ttk.Button(root, text="Compute", command=lambda: asyncio.run(on_run_click()), style='Accent.TButton') +layout_helper.add_row('', run_button, {'pady': 10}) # Progress bar -progress_bar = ttk.Progressbar(root, mode='indeterminate') -progress_bar.grid(row=17, column=0, columnspan=2, pady=10, sticky='ew') +progress_bar = layout_helper.add_row('', ttk.Progressbar(root, mode='indeterminate')) # Start the GUI event loop -root.mainloop() +root.mainloop() \ No newline at end of file diff --git a/src/pupil_labs/automate_custom_events/cloud_interaction.py b/src/pupil_labs/automate_custom_events/cloud_interaction.py index 12219f5..6157315 100644 --- a/src/pupil_labs/automate_custom_events/cloud_interaction.py +++ b/src/pupil_labs/automate_custom_events/cloud_interaction.py @@ -8,21 +8,23 @@ API_URL = "https://api.cloud.pupil-labs.com/v2" + def download_url(path: str, save_path: str, API_KEY, chunk_size=128) -> None: url = f"{API_URL}/{path}" r = requests.get(url, stream=True, headers={"api-key": API_KEY}) - r.raise_for_status() + r.raise_for_status() save_path = Path(save_path) with open(save_path, 'wb') as fd: for chunk in r.iter_content(chunk_size=chunk_size): fd.write(chunk) - + return r.status_code + def download_recording(recording_id: str, workspace_id: str, download_path: str, API_KEY) -> None: download_path = Path(download_path) # Ensure download_path is a Path object download_path.mkdir(parents=True, exist_ok=True) # Create directory if it doesn't exist - + save_path = download_path / f"{recording_id}.zip" status = download_url(f"workspaces/{workspace_id}/recordings:raw-data-export?ids={recording_id}", save_path, API_KEY, chunk_size=128) shutil.unpack_archive(save_path, download_path / recording_id) @@ -31,8 +33,10 @@ def download_recording(recording_id: str, workspace_id: str, download_path: str, file_source = Path(file_source) file_destination = file_source.parents[1] / file_source.name shutil.move(file_source, file_destination) + return status + def send_event_to_cloud(workspace_id, recording_id, keyword, timestamp_sec, API_KEY): url = f"{API_URL}/workspaces/{workspace_id}/recordings/{recording_id}/events" headers = { @@ -47,6 +51,7 @@ def send_event_to_cloud(workspace_id, recording_id, keyword, timestamp_sec, API_ else: logging.error(f"Failed to send event: {response.status_code}, {response.text}") + def download_raw_recording(recording_id: str, workspace_id: str, download_path: str, API_KEY) -> None: os.makedirs(download_path, exist_ok=True) download_url(f"/workspaces/{workspace_id}/recordings/{recording_id}.zip", download_path / f"{recording_id}.zip", API_KEY, chunk_size=128) @@ -55,4 +60,4 @@ def download_raw_recording(recording_id: str, workspace_id: str, download_path: for file_source in glob.glob(str(download_path / f"{recording_id}/*/*")): file_source = Path(file_source) file_destination = file_source.parents[1] / file_source.name - shutil.move(file_source,file_destination) \ No newline at end of file + shutil.move(file_source, file_destination) \ No newline at end of file diff --git a/src/pupil_labs/automate_custom_events/control_modules.py b/src/pupil_labs/automate_custom_events/control_modules.py index 713fd31..1ddc674 100644 --- a/src/pupil_labs/automate_custom_events/control_modules.py +++ b/src/pupil_labs/automate_custom_events/control_modules.py @@ -9,25 +9,23 @@ from pupil_labs.automate_custom_events.process_frames import ProcessFrames from pupil_labs.dynamic_content_on_rim.video.read import read_video_ts -async def run_modules(OPENAI_API_KEY, worksp_id, rec_id, cloud_api_key, download_path, - recpath, gm_description, gm_event_code, - arm_activity1, arm_event_code1, batch_size, start_time_seconds, end_time_seconds + +async def run_modules(OPENAI_API_KEY, worksp_id, rec_id, cloud_api_key, download_path, + recpath, description, event_code, batch_size, start_time_seconds, end_time_seconds ): - + ############################################################################# # 1. Download, read data, and create gaze overlay video to be sent to OpenAI ############################################################################# - logging.info( - "[white bold on #0d122a]◎ Let's start! ⚡️[/]", - extra={"markup": True}, - ) + logging.info("[white bold on #0d122a]◎ Let's start! ⚡️[/]", extra={"markup": True}) + download_recording(rec_id, worksp_id, download_path, cloud_api_key) recpath = Path(download_path / rec_id) files = glob.glob(str(Path(recpath, "*.mp4"))) gaze_overlay_path = os.path.join(recpath, "gaze_overlay.mp4") if os.path.exists(gaze_overlay_path): logging.info(f"{gaze_overlay_path} exists.") - + else: logging.warning(f"{gaze_overlay_path} does not exist.") raw_video_path = files[0] @@ -35,10 +33,10 @@ async def run_modules(OPENAI_API_KEY, worksp_id, rec_id, cloud_api_key, download # Format to read timestamps oftype = {"timestamp [ns]": np.uint64} - # read video + # read video _, frames, pts, ts = read_video_ts(raw_video_path) - # Read gaze data + # Read gaze data logging.info("Reading gaze data...") gaze_df = pd.read_csv(Path(recpath, 'gaze.csv'), dtype=oftype) @@ -48,17 +46,16 @@ async def run_modules(OPENAI_API_KEY, worksp_id, rec_id, cloud_api_key, download world_timestamps_df = pd.read_csv( Path(recpath, "world_timestamps.csv"), dtype=oftype ) - + # Prepare df for gaze overlay ts_world = world_timestamps_df["timestamp [ns]"] - video_for_gaze_module = pd.DataFrame( - { "frames": np.arange(frames), - "pts": [int(pt) for pt in pts], - "timestamp [ns]": ts_world, - } - ) - + video_for_gaze_module = pd.DataFrame({ + "frames": np.arange(frames), + "pts": [int(pt) for pt in pts], + "timestamp [ns]": ts_world, + }) + logging.info("Merging video and gaze dfs..") selected_col = ["timestamp [ns]", "gaze x [px]", "gaze y [px]"] gaze_df = gaze_df[selected_col] @@ -72,7 +69,7 @@ async def run_modules(OPENAI_API_KEY, worksp_id, rec_id, cloud_api_key, download direction="nearest", suffixes=["video", "gaze"] ) - + # If it doesn't exist create_gaze_overlay_video(merged_sc_gaze, raw_video_path, ts_world, gaze_overlay_path) merged_sc_gaze.to_csv(os.path.join(recpath, 'merged_sc_gaze_GM.csv'), index=False) @@ -83,22 +80,19 @@ async def run_modules(OPENAI_API_KEY, worksp_id, rec_id, cloud_api_key, download video_df_for_modules, baseframes_modules = get_baseframes(gaze_overlay_path) output_get_baseframes = pd.DataFrame(video_df_for_modules) output_get_baseframes.to_csv(os.path.join(recpath, 'output_get_baseframes.csv'), index=False) - + ############################################################################# # 3. Process Frames with GPT-v ############################################################################# - async_process_frames = ProcessFrames(baseframes_modules, video_df_for_modules, OPENAI_API_KEY, cloud_api_key, rec_id, worksp_id, gm_description, - gm_event_code, arm_activity1, arm_event_code1, int(batch_size), + async_process_frames = ProcessFrames(baseframes_modules, video_df_for_modules, OPENAI_API_KEY, cloud_api_key, rec_id, worksp_id, description, + event_code, int(batch_size), start_time_seconds, end_time_seconds - ) - async_process_frames_output_events = await async_process_frames.prompting(recpath, int(batch_size)) + ) + + async_process_frames_output_events = await async_process_frames.prompting(recpath, int(batch_size)) print(async_process_frames_output_events) final_output_path = pd.DataFrame(async_process_frames_output_events) final_output_path.to_csv(os.path.join(recpath, 'custom_events.csv'), index=False) - logging.info( - "[white bold on #0d122a]◎ Modules completed and events sent! ⚡️[/]", - extra={"markup": True}, - ) - + logging.info("[white bold on #0d122a]◎ Modules completed and events sent! ⚡️[/]", extra={"markup": True}) + return final_output_path - \ No newline at end of file diff --git a/src/pupil_labs/automate_custom_events/process_frames.py b/src/pupil_labs/automate_custom_events/process_frames.py index 8ef42d5..029d375 100644 --- a/src/pupil_labs/automate_custom_events/process_frames.py +++ b/src/pupil_labs/automate_custom_events/process_frames.py @@ -7,11 +7,12 @@ from pupil_labs.automate_custom_events.cloud_interaction import send_event_to_cloud import asyncio + class ProcessFrames: - def __init__(self, base64Frames, vid_modules, OPENAI_API_KEY, cloudtoken, recID, workID, - gm_description, gm_code, arm_activity1, arm_event_code1, batch_size, - start_time_seconds=25, end_time_seconds=35): - + def __init__(self, base64Frames, vid_modules, OPENAI_API_KEY, cloudtoken, recID, workID, + prompt_description, prompt_codes, batch_size, + start_time_seconds, end_time_seconds):#gm_code, arm_activity1, arm_event_code1, + # General params self.base64Frames = base64Frames self.workspaceid = workID @@ -22,57 +23,72 @@ def __init__(self, base64Frames, vid_modules, OPENAI_API_KEY, cloudtoken, recID, self.mydf = vid_modules self.session_cost = 0 self.batch_size = batch_size - self.gm_description = gm_description - self.arm_activity = arm_activity1 - # Flags for tracking activities - self.gm_flag = False # Flag for gaze module - self.arm_flag = False # Flag for arm activity + + # self.arm_activity = arm_activity1 + # # Flags for tracking activities + # self.gm_flag = False # Flag for gaze module + # self.arm_flag = False # Flag for arm activity # Time range parameters self.start_time_seconds = int(start_time_seconds) self.end_time_seconds = int(end_time_seconds) - # Prompts (GM = gaze module, ARM = Activity Recognition Module) - self.gm_start_code = "starts_" + gm_code - self.gm_end_code = "stops_" + gm_code - self.arm_start_code = "starts_" + arm_event_code1 - self.arm_end_code = "stops_" + arm_event_code1 - - self.all_codes = [ - self.gm_start_code, - self.gm_end_code, - self.arm_start_code, - self.arm_end_code - ] + self.activities = re.split(r'\s*;\s*', prompt_description) + self.codes = re.split(r'\s*;\s*', prompt_codes) + + # Initialize activity states + self.activity_states = {code: False for code in self.codes} self.base_prompt = f""" - Act as an experienced video annotator specialized in eye-tracking data. You will analyze video frames where a red circle indicates - the user's gaze point. + You are an experienced video annotator specialized in eye-tracking data analysis. - For every frame, perform the following two tasks: + **Task:** - 1. **Gaze Activity Recognition**: Identify if the frame shows the user engaged in the following activity: "{gm_description}". If so, send the corresponding code: {self.gm_start_code} or {self.gm_end_code}. Remember, the red circle indicates the user's gaze point. + - Analyze each frame of the provided video sequence, which includes a gaze overlay (a red circle indicating where the user is looking). + - Identify when any of the specified activities **start** or **end** in the video based on the visual content and the gaze location. - 2. **Scene Activity Recognition**: Identify if the frame shows the user performing this specific activity: "{arm_activity1}". If so, send the corresponding code: {self.arm_start_code} or {self.arm_end_code}. + **Activities and Corresponding Codes:** - **Important**: - - **Scan each frame for all possible events**. If multiple activities are observed in the same frame, return the code corresponding to the activity that is best described in the frame. - - If no events are observed in a frame, respond with code == None. + The activities are: + {self.activities} - Ensure your responses are precise and include all relevant codes ({self.gm_start_code}, {self.gm_end_code}, {self.arm_start_code}, {self.arm_end_code}) that correspond to the identified activities within the frame. Adhering to these instructions is crucial for accurate annotation. - """ + The corresponding codes are: + {self.codes} + + **Instructions:** + + - For each frame: + - Examine the visual elements and the position of the gaze overlay. + - Determine if any of the specified activities are **starting** or **ending**. + - If an activity is **starting**, record the following information: + - **Frame Number:** [frame number] + - **Timestamp:** [timestamp from the provided dataframe] + - **Code:** start_[corresponding activity code] + - If an activity is **ending**, record: + - **Frame Number:** [frame number] + - **Timestamp:** [timestamp from the provided dataframe] + - **Code:** end_[corresponding activity code] + - Only consider the activities listed above. + - Ensure the output is accurate and formatted correctly. + + **Output Format:** - self.format = f""" - The format should be always the same except for the variables that change (, , ). - Do not add any extra dots, letters, or characters. - - - If you find a frame that matches the start of the activity "The user starts {gm_description}" the response should be: Frame : Timestamp - , Code - {self.gm_start_code} - - If you find a frame that matches the end of the activity "The user stops {gm_description}" the response should be: Frame : Timestamp - , Code - {self.gm_end_code} - - If you find a frame that matches the start of the activity {arm_activity1}: Frame : Timestamp - , Code - {self.arm_start_code} - - If you find a frame that matches the end of the activity {arm_activity1}: Frame : Timestamp - , Code - {self.arm_end_code} - - If a frame doesn't match any of those activities: Frame : Timestamp - , Code - None + ``` + Frame [frame number]: Timestamp - [timestamp], Code - [start/end]_[code] + ``` + + **Examples:** + + - If in frame 25 the user **starts** driving under a bridge and the timestamp is 65, the output should be: + ``` + Frame 25: Timestamp - 65, Code - start_driving_under_bridge + ``` + - If in frame 50 the user **stops** turning left, the output should be: + ``` + Frame 50: Timestamp - [timestamp], Code - end_turning_left + ``` """ - + self.last_event = None def is_within_time_range(self, timestamp): @@ -83,7 +99,6 @@ def is_within_time_range(self, timestamp): return False return True - async def query_frame(self, index, session): # Check if the frame's timestamp is within the specified time range timestamp = self.mydf.iloc[index]['timestamp [s]'] @@ -93,21 +108,18 @@ async def query_frame(self, index, session): base64_frames_content = [{"image": self.base64Frames[index], "resize": 768}] video_gaze_df_content = [self.mydf.iloc[index].to_dict()] - print(f"GM Flag is: {self.gm_flag}") - print(f"ARM Flag is: {self.arm_flag}") - PROMPT_MESSAGES = [ { "role": "system", - "content": (self.base_prompt + self.format), + "content": (self.base_prompt), }, { "role": "user", "content": f"The frames are extracted from this video and the timestamps and frame numbers are stored in this dataframe: {json.dumps(video_gaze_df_content)}", }, { - "role": "user", + "role": "user", "content": base64_frames_content } ] @@ -131,7 +143,8 @@ async def query_frame(self, index, session): response_message = result['choices'][0]['message']['content'] print("Response from OpenAI API:", response_message) - pattern = r'Frame\s(\d+):\sTimestamp\s-\s([\d.]+),\sCode\s-\s(\w+)' + # Updated regex pattern to match the new output format + pattern = r'Frame\s(\d+):\sTimestamp\s-\s([\d.]+),\sCode\s-\s(\w+_\w+)' matches = re.findall(pattern, response_message) if matches: @@ -139,59 +152,49 @@ async def query_frame(self, index, session): frame_number = int(match[0]) timestamp = float(match[1]) code = match[2] - # LOGGING for Debugging - print(f"GM Flag: {self.gm_flag}, ARM Flag: {self.arm_flag}, Detected Code: {code}") - - # --- Gaze Module --- - gm_event_sent = False - if not self.gm_flag: # If gm_flag is False, check for start event - if code == self.gm_start_code: - self.gm_flag = True - send_event_to_cloud(self.workspaceid, self.recid, code, timestamp, self.cloud_token) - self.last_event = code - print("Send GM_start_event when activity hasn't started (Flag false)") - gm_event_sent = True - elif code == self.gm_end_code and self.gm_flag: # If gm_flag is True, check for end event - self.gm_flag = False - send_event_to_cloud(self.workspaceid, self.recid, code, timestamp, self.cloud_token) - self.last_event = code - print("Send GM_end_event when activity has already started (Flag true)") - gm_event_sent = True - - # If GM event is sent, return the response and don't process further - if gm_event_sent: - return { - "frame_id": frame_number, - "timestamp [s]": timestamp, - "code": code, - } - - # --- Activity Recognition Module --- - arm_event_sent = False # Track whether we send ARM events - if not self.arm_flag: # If arm_flag is False, check for start event - if code == self.arm_start_code: - self.arm_flag = True - send_event_to_cloud(self.workspaceid, self.recid, code, timestamp, self.cloud_token) - self.last_event = code - print("Send ARM_start_event when activity hasn't started (Flag false)") - arm_event_sent = True - elif code == self.arm_end_code and self.arm_flag: # If arm_flag is True, check for end event - self.arm_flag = False - send_event_to_cloud(self.workspaceid, self.recid, code, timestamp, self.cloud_token) - self.last_event = code - print("Send ARM_end_event when activity has already started (Flag true)") - arm_event_sent = True - - # If ARM event is sent, return the response - if arm_event_sent: - return { - "frame_id": frame_number, - "timestamp [s]": timestamp, - "code": code, - } - - # No event sent, return None - return None + + # Parse the code to get the prefix and activity code + code_match = re.match(r'(start|end)_(.+)', code) + if code_match: + prefix = code_match.group(1) # 'start' or 'end' + activity_code = code_match.group(2) + + # Check if the activity code is valid + if activity_code not in self.codes: + print(f"Invalid activity code: {activity_code}") + continue + + # Get the current state of the activity + activity_active = self.activity_states[activity_code] + + if prefix == 'start': + if not activity_active: + # Activity is starting + self.activity_states[activity_code] = True + send_event_to_cloud(self.workspaceid, self.recid, code, timestamp, self.cloud_token) + print(f"Sent start event for {activity_code}") + else: + # Start event already sent, ignore + print(f"Start event for {activity_code} already sent, ignoring.") + elif prefix == 'end': + if activity_active: + # Activity is ending + self.activity_states[activity_code] = False + send_event_to_cloud(self.workspaceid, self.recid, code, timestamp, self.cloud_token) + print(f"Sent end event for {activity_code}") + else: + # End event without a start, ignore + print(f"End event for {activity_code} received without a start, ignoring.") + else: + print(f"Unknown prefix in code: {code}") + else: + print(f"Invalid code format: {code}") + + return { + "frame_id": frame_number, + "timestamp [s]": timestamp, + "code": code, + } else: print("No match found in the response") return None @@ -205,28 +208,28 @@ async def query_frame(self, index, session): return None print("Max retries reached. Exiting.") return None - + async def binary_search(self, session, start, end, identified_activities): - if start >= end: - return [] - - mid = (start + end) // 2 - print(f"Binary search range: {start}-{end}, mid: {mid}") - - results = [] - # Process the mid frame and ensure both prompts are evaluated - mid_frame_result = await self.query_frame(mid, session) - if mid_frame_result: - activity = mid_frame_result["code"] - if activity not in identified_activities: - identified_activities.add(activity) - results.append(mid_frame_result) - left_results = await self.binary_search(session, start, mid, identified_activities) - results.extend(left_results) - else: - right_results = await self.binary_search(session, mid + 1, end, identified_activities) - results.extend(right_results) - return results + if start >= end: + return [] + + mid = (start + end) // 2 + print(f"Binary search range: {start}-{end}, mid: {mid}") + + results = [] + # Process the mid frame and ensure both prompts are evaluated + mid_frame_result = await self.query_frame(mid, session) + if mid_frame_result: + activity = mid_frame_result["code"] + if activity not in identified_activities: + identified_activities.add(activity) + results.append(mid_frame_result) + left_results = await self.binary_search(session, start, mid, identified_activities) + results.extend(left_results) + else: + right_results = await self.binary_search(session, mid + 1, end, identified_activities) + results.extend(right_results) + return results async def process_batches(self, session, batch_size): identified_activities = set() diff --git a/src/pupil_labs/automate_custom_events/read_data.py b/src/pupil_labs/automate_custom_events/read_data.py index e9300a5..b82a0e0 100644 --- a/src/pupil_labs/automate_custom_events/read_data.py +++ b/src/pupil_labs/automate_custom_events/read_data.py @@ -11,76 +11,77 @@ def isMonotonicInc(arr): return np.all(np.diff(arr) >= 0) + def get_baseframes(video_path, audio=False, auto_thread_type=True): - """ - A function to read a video, extract frames, and store them as base64 encoded strings. - :param video_path: the path to the video - """ - base64Frames =[] - # Read the video - with av.open(video_path) as video_container, Progress() as progress: - if audio: - stream = video_container.streams.audio[0] - else: - stream = video_container.streams.video[0] - if auto_thread_type: - stream.thread_type = "AUTO" - fps = stream.average_rate # alt base_rate or guessed_rate - nframes = stream.frames - logging.info("Extracting pts...") - pts, dts, ts = (list() for i in range(3)) - decode_task = progress.add_task("👓 Decoding...", total=nframes) - for packet in video_container.demux(stream): - for frame in packet.decode(): - if frame is not None and frame.pts is not None: - pts.append(frame.pts) - dts.append(frame.dts) if frame.dts is not None else logging.info( - f"Decoding timestamp is missing at frame {len(pts)}" - ) - ts.append( - ( - frame.pts * frame.time_base - - stream.start_time * frame.time_base - ) - * 1e9 + """ + A function to read a video, extract frames, and store them as base64 encoded strings. + :param video_path: the path to the video + """ + base64Frames = [] + # Read the video + with av.open(video_path) as video_container, Progress() as progress: + if audio: + stream = video_container.streams.audio[0] + else: + stream = video_container.streams.video[0] + + if auto_thread_type: + stream.thread_type = "AUTO" + + nframes = stream.frames + logging.info("Extracting pts...") + pts, dts, ts = (list() for i in range(3)) + decode_task = progress.add_task("👓 Decoding...", total=nframes) + for packet in video_container.demux(stream): + for frame in packet.decode(): + if frame is not None and frame.pts is not None: + pts.append(frame.pts) + dts.append(frame.dts) if frame.dts is not None else logging.info( + f"Decoding timestamp is missing at frame {len(pts)}" + ) + ts.append( + ( + frame.pts * frame.time_base + - stream.start_time * frame.time_base ) + * 1e9 + ) + + # Convert the frame to an image and encode it in base64 + img = frame.to_ndarray(format='bgr24') + _, buffer = cv2.imencode(".jpg", img) + base64Frames.append(base64.b64encode(buffer).decode("utf-8")) + + progress.advance(decode_task) + progress.refresh() + pts, dts, ts = ( + np.array(pts, dtype=np.uint64), + np.array(dts, dtype=np.uint64), + np.array(ts, dtype=np.uint64), + ) + if not isMonotonicInc(pts): + logging.warning("Pts are not monotonic increasing!.") + if np.array_equal(pts, dts): + logging.info("Pts and dts are equal, using pts") + + idc = pts.argsort() + pts = pts[idc] + ts = ts[idc] + + if nframes != len(pts): + nframes = len(pts) + else: + logging.info(f"Video has {nframes} frames") + + timestamps_s = ts / 1e9 + video_df = pd.DataFrame({ + "frames": np.arange(nframes), + "pts": [int(pt) for pt in pts], + "timestamp [ns]": ts, + "timestamp [s]": timestamps_s + }) + return video_df, base64Frames #, fps, nframes, pts, ts - # Convert the frame to an image and encode it in base64 - img = frame.to_ndarray(format='bgr24') - _, buffer = cv2.imencode(".jpg", img) - base64Frames.append(base64.b64encode(buffer).decode("utf-8")) - - progress.advance(decode_task) - progress.refresh() - pts, dts, ts = ( - np.array(pts, dtype=np.uint64), - np.array(dts, dtype=np.uint64), - np.array(ts, dtype=np.uint64), - ) - if not isMonotonicInc(pts): - logging.warning("Pts are not monotonic increasing!.") - if np.array_equal(pts, dts): - logging.info("Pts and dts are equal, using pts") - - idc = pts.argsort() - pts = pts[idc] - ts = ts[idc] - - if nframes != len(pts): - nframes = len(pts) - else: - logging.info(f"Video has {nframes} frames") - - timestamps_s = ts / 1e9 - video_df = pd.DataFrame( - { - "frames": np.arange(nframes), - "pts": [int(pt) for pt in pts], - "timestamp [ns]": ts, - "timestamp [s]": timestamps_s - } - ) - return video_df, base64Frames #, fps, nframes, pts, ts def get_frame(av_container, pts, last_pts, frame, audio=False): """ @@ -113,16 +114,17 @@ def get_frame(av_container, pts, last_pts, frame, audio=False): else: logging.debug("This frame was already decoded") return frame, last_pts - + + def create_gaze_overlay_video(merged_video, video_path, world_timestamps_df, output_file): start = world_timestamps_df[0] merged_video = merged_video[merged_video["timestamp [ns]"] >= start] - + # Read first frame with av.open(video_path) as vid_container: logging.info("Reading first frames") vid_frame = next(vid_container.decode(video=0)) - + num_processed_frames = 0 # Get the output path @@ -133,12 +135,12 @@ def create_gaze_overlay_video(merged_video, video_path, world_timestamps_df, out logging.info("Ready to process video") # Prepare the output video out_video = out_container.add_stream("libx264", rate=30, options={"crf": "18"}) - out_video.width = video.streams.video[0].width + out_video.width = video.streams.video[0].width out_video.height = video.streams.video[0].height out_video.pix_fmt = "yuv420p" out_video.codec_context.time_base = Fraction(1, 30) - - lpts= -1 + + lpts = -1 # For every frame in the video with Progress() as progress_bar: @@ -154,7 +156,7 @@ def create_gaze_overlay_video(merged_video, video_path, world_timestamps_df, out if vid_frame is None: break img_original = vid_frame.to_ndarray(format="rgb24") - + # Prepare the frame frame = cv2.cvtColor(img_original, cv2.COLOR_RGB2BGR) frame = np.asarray(frame, dtype=np.float32) @@ -182,10 +184,9 @@ def create_gaze_overlay_video(merged_video, video_path, world_timestamps_df, out out_container.mux(packet) out_container.close() - + logging.info( "[white bold on #0d122a]◎ Gaze overlay video has been created! ⚡️[/]", extra={"markup": True}, ) cv2.destroyAllWindows() - \ No newline at end of file diff --git a/src/pupil_labs/automate_custom_events/tk_utils.py b/src/pupil_labs/automate_custom_events/tk_utils.py new file mode 100644 index 0000000..59c46d8 --- /dev/null +++ b/src/pupil_labs/automate_custom_events/tk_utils.py @@ -0,0 +1,85 @@ +import tkinter as tk +from tkinter import ttk, filedialog + + +class TTKFormLayoutHelper: + def __init__(self, root): + self.row_idx = 0 + self.root = root + + def add_heading(self, text): + label = ttk.Label(self.root, text=text, wraplength=500, style="Heading.TLabel") + label.grid(row=self.row_idx, column=0, columnspan=2, sticky="w") + + self.row_idx += 1 + + def add_row(self, text, widget=None, widget_grid_args=None): + # Get the background and foreground colors from the ttk Entry widget style + if widget is None: + widget = ttk.Entry(self.root) + + if widget_grid_args is None: + widget_grid_args = {} + + label = ttk.Label(self.root, text=text) + label.grid(row=self.row_idx, column=0, sticky="w") + widget.grid(row=self.row_idx, column=1, sticky="ew", padx=10, **widget_grid_args) + + self.row_idx += 1 + return widget + + def add_spacer_row(self): + label = ttk.Label(self.root) + label.grid(row=self.row_idx, column=0, sticky="w") + + self.row_idx += 1 + + # Function to create a labeled entry + def create_labeled_entry(self,parent, label_text, row, show=None, default_value=None): + """Helper function to create a label and entry widget in a given parent.""" + label = ttk.Label(parent, text=label_text) + label.grid(row=row, column=0, sticky='w', padx=5, pady=5) + + entry = ttk.Entry(parent, show=show) if show else ttk.Entry(parent) + entry.grid(row=row, column=1, sticky='ew', padx=5, pady=5) + + if default_value: + entry.insert(0, default_value) + + return entry + + + # Function to create a labeled folder selector + def create_labeled_folder_selector(self,parent, label_text, row, default_path): + """Helper function to create a label and folder selector widget in a given parent.""" + label = ttk.Label(parent, text=label_text) + label.grid(row=row, column=0, sticky='w', padx=5, pady=5) + + folder_selector = FolderSelector(parent, default_path) + folder_selector.grid(row=row, column=1, sticky='ew', padx=5, pady=5) + + return folder_selector + + + +class FolderSelector(ttk.Frame): + def __init__(self, parent, start_path=None, *args, **kwargs): + super().__init__(parent, *args, **kwargs) + + self.entry = ttk.Entry(self) + self.entry.pack(side="left", fill="x", expand=True) + + self.button = ttk.Button(self, text="...", command=self.select_folder) + self.button.pack(side="right", padx=10) + + if start_path is not None: + self.entry.insert(0, start_path) + + def select_folder(self): + folder_path = filedialog.askdirectory(title="Select a Folder") + if folder_path: + self.entry.delete(0, tk.END) + self.entry.insert(0, folder_path) + + def get(self): + return self.entry.get()