-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
68 lines (56 loc) · 2.18 KB
/
Copy pathrun.py
File metadata and controls
68 lines (56 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# -*- coding: utf-8 -*-
"""
Main entry point for launching the Orlando Toolkit application.
"""
import sys
import os
import tkinter as tk
import logging
from orlando_toolkit.logging_config import setup_logging
from orlando_toolkit.app import OrlandoToolkit
def main():
"""
Configure logging, main window, and launch application.
"""
setup_logging()
root = tk.Tk()
root.title("Orlando Toolkit")
# Desired window size (slightly larger to accommodate inline metadata + summary)
window_width, window_height = 400, 620
# Calculate position to center the window
screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
pos_x = (screen_width // 2) - (window_width // 2)
pos_y = (screen_height // 2) - (window_height // 2)
root.geometry(f"{window_width}x{window_height}+{pos_x}+{pos_y}")
# Application icon configuration
try:
base_path = os.path.dirname(os.path.abspath(__file__))
icon_path = os.path.join(base_path, 'assets', 'app_icon.png')
if os.path.exists(icon_path):
app_icon = tk.PhotoImage(file=icon_path)
root.iconphoto(True, app_icon)
except Exception as e:
print(f"Warning: Could not load icon: {e}")
# Use modern theme if available
try:
from sv_ttk import set_theme
set_theme("light") # Changed to light theme for professional look
# Override Accent button style immediately after theme is set
from tkinter import ttk
style = ttk.Style()
style.configure("Accent.TButton",
background="#0098e4",
foreground="white",
borderwidth=0,
focuscolor="none")
style.map("Accent.TButton",
background=[("active", "#0078b3"), ("pressed", "#005c85"), ("disabled", "#cccccc")],
foreground=[("active", "white"), ("pressed", "white"), ("disabled", "gray")])
except ImportError:
print("Warning: 'sv-ttk' theme is not installed.")
app = OrlandoToolkit(root)
root.mainloop()
if __name__ == '__main__':
main()
logging.info("===== Application terminated =====")