[AI] window is not creating

This commit is contained in:
Mikan
2026-03-09 22:26:51 +03:00
parent 01cf0f87d0
commit daf1c2a37b
3 changed files with 144 additions and 12 deletions

View File

@@ -162,6 +162,7 @@ class WorkTracker:
# Check if tracking is enabled
if not self.is_tracking:
return False
# Check if session is locked
if self.session_locked:
return False
@@ -276,12 +277,14 @@ class WorkTracker:
def main():
# Create main Tkinter root
root = tk.Tk()
root.withdraw() # Hide the root window
root.title("Work Tracker") # Give it a title so it appears in taskbar
root.geometry("1x1+2000+2000") # Minimal size off-screen to avoid flicker
# Don't call withdraw() so the window manager recognizes it
# Initialize tracker
tracker = WorkTracker()
# Create overlay window
# Create overlay window - this will be the visible always-on-top window
overlay = OverlayWindow(root, tracker, tracker.config)
# Start main tracking loop in background

View File

@@ -14,10 +14,9 @@ class OverlayWindow:
# Configure window to be always on top
self.root.attributes("-topmost", True)
self.root.overrideredirect(True) # Remove window decorations
self.root.geometry("300x150+100+100")
# Make window transparent (optional)
self.root.wm_attributes("-transparentcolor", "white")
# Force the geometry to be set correctly
self.root.geometry("300x150+100+100")
# Create UI elements
self.create_widgets()
@@ -30,28 +29,28 @@ class OverlayWindow:
def create_widgets(self):
"""Create all UI widgets"""
# Main frame
main_frame = tk.Frame(self.root, bg='white', bd=2, relief='solid')
# Main frame with visible background
main_frame = tk.Frame(self.root, bg='#f0f0f0', bd=2, relief='solid')
main_frame.pack(fill='both', expand=True, padx=2, pady=2)
# Status line (tracking enabled/disabled)
self.status_label = tk.Label(main_frame, text="", bg='white', font=('Arial', 10))
self.status_label = tk.Label(main_frame, text="", bg='#f0f0f0', font=('Arial', 10))
self.status_label.pack(anchor='w', padx=5, pady=2)
# Task info
self.task_label = tk.Label(main_frame, text="", bg='white', font=('Arial', 10, 'bold'))
self.task_label = tk.Label(main_frame, text="", bg='#f0f0f0', font=('Arial', 10, 'bold'))
self.task_label.pack(anchor='w', padx=5, pady=2)
# Window info
self.window_label = tk.Label(main_frame, text="", bg='white', font=('Arial', 9))
self.window_label = tk.Label(main_frame, text="", bg='#f0f0f0', font=('Arial', 9))
self.window_label.pack(anchor='w', padx=5, pady=2)
# Total time info
self.total_label = tk.Label(main_frame, text="", bg='white', font=('Arial', 9))
self.total_label = tk.Label(main_frame, text="", bg='#f0f0f0', font=('Arial', 9))
self.total_label.pack(anchor='w', padx=5, pady=2)
# Buttons frame
buttons_frame = tk.Frame(main_frame, bg='white')
buttons_frame = tk.Frame(main_frame, bg='#f0f0f0')
buttons_frame.pack(fill='x', padx=5, pady=5)
# Tracking toggle button