-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
45 lines (32 loc) · 969 Bytes
/
main.py
File metadata and controls
45 lines (32 loc) · 969 Bytes
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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
CodeBox - Multi-Language Code Editor
Based on PythonBox v8
Author: Lukas
"""
import sys
from pathlib import Path
# Add parent directory to path for imports
sys.path.insert(0, str(Path(__file__).parent))
from PySide6.QtWidgets import QApplication
from PySide6.QtGui import QIcon
from features.theme_manager import DEFAULT_THEME, apply_theme
def load_app_icon() -> QIcon:
icon_path = Path(__file__).with_name("CodeBox.ico")
return QIcon(str(icon_path)) if icon_path.exists() else QIcon()
def main():
"""Entry point for CodeBox."""
app = QApplication(sys.argv)
icon = load_app_icon()
if not icon.isNull():
app.setWindowIcon(icon)
apply_theme(app, DEFAULT_THEME)
from ui.main_window import MainWindow
window = MainWindow()
if not icon.isNull():
window.setWindowIcon(icon)
window.show()
sys.exit(app.exec())
if __name__ == "__main__":
main()