-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathmain.py
More file actions
38 lines (29 loc) · 1.01 KB
/
main.py
File metadata and controls
38 lines (29 loc) · 1.01 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
import sys
import os
from PySide6.QtWidgets import QApplication
from PySide6.QtGui import QIcon
from state import AppState
from ui.editor import TilfEditor
from utils.resource_path import get_resource_path
def main() -> None:
app = QApplication(sys.argv)
app.setApplicationName("Tilf - Pixel Art Editor")
app.setQuitOnLastWindowClosed(True)
app_icon_path = get_resource_path("icon.icns")
if os.path.exists(app_icon_path):
app.setWindowIcon(QIcon(app_icon_path))
else:
print(f"Tilf icon not found at: {app_icon_path}")
stylesheet_path = get_resource_path("style.qss")
try:
with open(stylesheet_path, "r") as f:
app.setStyleSheet(f.read())
print(f"Stylesheet loaded from: {stylesheet_path}")
except FileNotFoundError:
print(f"Stylesheet not found at: {stylesheet_path}. Running with default style.")
app_state = AppState()
window = TilfEditor(app_state)
window.show()
sys.exit(app.exec())
if __name__ == "__main__":
main()