-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
92 lines (78 loc) · 2.65 KB
/
Copy pathmain.py
File metadata and controls
92 lines (78 loc) · 2.65 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import sys
from PySide6.QtCore import Qt
from PySide6.QtGui import QIcon
from PySide6.QtWidgets import QLabel, QVBoxLayout, QApplication
from qfluentwidgets import (
StyleSheetBase,
Theme,
qconfig,
FluentWindow,
setTheme,
FluentIcon,
SubtitleLabel,
NavigationItemPosition,
)
from enum import Enum
from tab.HomeTab import HomeTab
from tab.ListTab import ListTab
from tab.SettingsTab import SettingsTab
from tab.LogsTab import LogsTab
from tab.WallpaperEngineTab import WallpaperEngineTab
class StyleSheet(StyleSheetBase, Enum):
WINDOW = "window"
def path(self, theme=Theme.AUTO):
theme = qconfig.theme if theme == Theme.AUTO else theme
return f"qss/{theme.value.lower()}/{self.value}.qss"
class Window(FluentWindow):
def __init__(self, parent=None):
super().__init__(parent)
self.setObjectName("Window")
self.setWindowTitle("PyShopDL")
self.setWindowIcon(QIcon("Assets/icon.ico"))
self.home_tab = HomeTab(self)
self.list_tab = ListTab(self)
self.logs_tab = LogsTab(self)
self.wallpaper_tab = WallpaperEngineTab(self)
self.settings_tab = SettingsTab(self)
# Share logs_tab with list_tab so downloads can log output
self.list_tab.set_logs_tab(self.logs_tab)
self.addSubInterface(
self.home_tab,
icon=FluentIcon.HOME.icon(Theme.AUTO),
text="Home",
position=NavigationItemPosition.TOP,
)
self.addSubInterface(
self.list_tab,
icon=FluentIcon.LIBRARY.icon(Theme.AUTO),
text="Downloader",
position=NavigationItemPosition.TOP,
)
self.addSubInterface(
self.logs_tab,
icon=FluentIcon.COMMAND_PROMPT.icon(Theme.AUTO),
text="Logs",
position=NavigationItemPosition.TOP,
)
self.addSubInterface(
self.wallpaper_tab,
icon=FluentIcon.PALETTE.icon(Theme.AUTO),
text="Wallpaper Engine",
position=NavigationItemPosition.TOP,
)
self.addSubInterface(
self.settings_tab,
icon=FluentIcon.SETTING.icon(Theme.AUTO),
text="Settings",
position=NavigationItemPosition.BOTTOM,
)
StyleSheet.WINDOW.apply(self)
qconfig.themeChangedFinished.connect(lambda: StyleSheet.WINDOW.apply(self))
if __name__ == "__main__":
app = QApplication(sys.argv)
setTheme(Theme.AUTO)
window = Window()
window.resize(900, 600)
window.show()
sys.exit(app.exec())
# SteamDepotDownloader> .\DepotDownloaderMod.exe -app 294100 -pubfile 2222935097