diff --git a/.gitignore b/.gitignore index df81045..d7dbdc4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,5 @@ .qt_for_python +__pycache__ + +output +build \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index fe03cf9..b0eabeb 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,11 +5,12 @@ "version": "0.2.0", "configurations": [ { - "name": "Python: Run App", + "name": "Python: Debug App", "type": "python", "request": "launch", - "program": "./src/main.py", + "program": "./main.py", "console": "integratedTerminal", + "cwd": "${workspaceFolder}/src", "pythonArgs": [ "-B", ] diff --git a/src/gui/assets/icons/bell.svg b/src/assets/icons/bell.svg similarity index 100% rename from src/gui/assets/icons/bell.svg rename to src/assets/icons/bell.svg diff --git a/src/gui/assets/icons/home.svg b/src/assets/icons/home.svg similarity index 100% rename from src/gui/assets/icons/home.svg rename to src/assets/icons/home.svg diff --git a/src/gui/assets/icons/menu.svg b/src/assets/icons/menu.svg similarity index 100% rename from src/gui/assets/icons/menu.svg rename to src/assets/icons/menu.svg diff --git a/src/assets/icons/red_house_logo.ico b/src/assets/icons/red_house_logo.ico new file mode 100644 index 0000000..3fd1874 Binary files /dev/null and b/src/assets/icons/red_house_logo.ico differ diff --git a/src/gui/assets/icons/settings.svg b/src/assets/icons/settings.svg similarity index 100% rename from src/gui/assets/icons/settings.svg rename to src/assets/icons/settings.svg diff --git a/src/assets/images/red_house_logo.jpg b/src/assets/images/red_house_logo.jpg new file mode 100644 index 0000000..64488d9 Binary files /dev/null and b/src/assets/images/red_house_logo.jpg differ diff --git a/src/gui/assets/images/size_grip.png b/src/assets/images/size_grip.png similarity index 100% rename from src/gui/assets/images/size_grip.png rename to src/assets/images/size_grip.png diff --git a/src/gui/pages/ui_main_window.py b/src/gui/pages/ui_main_window.py index b019f1a..8ee3eeb 100644 --- a/src/gui/pages/ui_main_window.py +++ b/src/gui/pages/ui_main_window.py @@ -5,6 +5,7 @@ from gui.pages.widgets.push_button import PushButton from gui.pages.widgets.sys_buttons import SysButtons from gui.pages.widgets.title_bar_button import TitleBarButton +from resource_path import resource_path class UI_MainWindow(object): def setup_ui(self, parent): @@ -15,7 +16,6 @@ def setup_ui(self, parent): parent.setMinimumSize(960, 540) self.central_frame = QFrame() - # self.central_frame.setStyleSheet("background-color: rgb(33, 45, 80)") self.main_layout = QHBoxLayout(self.central_frame) self.main_layout.setContentsMargins(0, 0, 0, 0) @@ -114,7 +114,7 @@ def setup_ui(self, parent): self.top_bar_layout = QHBoxLayout(self.top_bar) self.top_bar_layout.setContentsMargins(10, 0, 4, 0) - self.top_label_left = QLabel("SkyMP Launcer") + self.top_label_left = QLabel("SkyMP Launcher") self.top_spacer = QSpacerItem( 100, @@ -153,12 +153,12 @@ def setup_ui(self, parent): self.bottom_label_right.setStyleSheet("font: 700 9pt 'Segoe UI'") self.bottom_right_size_grip = QSizeGrip(self.bottom_bar) - self.bottom_right_size_grip.setStyleSheet(u""" - QSizeGrip { - image: url(src/gui/assets/images/size_grip.png); + self.bottom_right_size_grip.setStyleSheet(f""" + QSizeGrip {{ + image: url("assets/images/size_grip.png"); width: 16px; height: 16px; - } + }} """) self.bottom_bar_layout.addWidget(self.bottom_label_left) @@ -181,4 +181,6 @@ def setup_ui(self, parent): self.main_layout.addWidget(self.left_menu) self.main_layout.addWidget(self.content) + + parent.setCentralWidget(self.central_frame) \ No newline at end of file diff --git a/src/gui/pages/widgets/push_button.py b/src/gui/pages/widgets/push_button.py index d7d1c4a..d96a5eb 100644 --- a/src/gui/pages/widgets/push_button.py +++ b/src/gui/pages/widgets/push_button.py @@ -2,6 +2,8 @@ from qt_core import * +from resource_path import resource_path + class PushButton(QPushButton): def __init__( self, @@ -108,9 +110,12 @@ def paintEvent(self, event): def drawIcon(self, selfPainter, image_name, rect, color): app_path = os.path.abspath(os.getcwd()) - folder = "src/gui/assets/icons" + folder = "assets/icons" path = os.path.join(app_path, folder) icon_path = os.path.normpath(os.path.join(path, image_name)) + # icon_path = resource_path(os.path.join(folder, image_name)) + # print(icon_path) + # print(resource_path(os.path.join(folder, image_name))) icon = QPixmap(icon_path) painter = QPainter(icon) diff --git a/src/icon.ico b/src/icon.ico new file mode 100644 index 0000000..3fd1874 Binary files /dev/null and b/src/icon.ico differ diff --git a/src/main.py b/src/main.py index 1ecc317..08d1c04 100644 --- a/src/main.py +++ b/src/main.py @@ -86,7 +86,6 @@ def resetSelection(self): btn.setActive(False) - if __name__ == '__main__': app = QApplication(sys.argv) window = MainWindow()