Skip to content

Commit

Permalink
feat: ui window overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
style77 committed Jan 18, 2024
1 parent 080d6d9 commit 13266d7
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions app/ui/window.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import tkinter as tk


class Window:
def __init__(self, root: tk.Tk):
self.root = root

width = self.root.winfo_screenwidth()
height = self.root.winfo_screenheight()

self.root.overrideredirect(True)

self.root.geometry(f"{width}x{height}")

self.root.configure(bg="white")

self.root.lift()

self.root.wm_attributes("-topmost", True)
self.root.wm_attributes("-disabled", True)
self.root.wm_attributes("-transparentcolor", "white")

self.main_text = tk.Label(
text="",
font=("Helvetica", "16"),
fg="#eee",
bg="white",
)
self.sub_text = tk.Label(
text="Waiting for recognizer",
font=("Helvetica", "10"),
fg="#ddd",
bg="white",
)

self.sub_text.pack(side="bottom", fill="both", pady=(0, 24))
self.main_text.pack(side="bottom", fill="both")

def update_text(self, text: str, translated_text: str):
self.sub_text.configure(text=text)
self.main_text.configure(text=translated_text)

self.sub_text.update()
self.main_text.update()

0 comments on commit 13266d7

Please sign in to comment.