Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
[src] change path to assets, add icon
Browse files Browse the repository at this point in the history
  • Loading branch information
TakiMoysha committed Aug 14, 2021
1 parent deeaf10 commit 5ea4790
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 8 deletions.
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added src/assets/icons/red_house_logo.ico
Binary file not shown.
File renamed without changes
Binary file added src/assets/images/red_house_logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
14 changes: 8 additions & 6 deletions src/gui/pages/ui_main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand All @@ -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)
7 changes: 6 additions & 1 deletion src/gui/pages/widgets/push_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from qt_core import *

from resource_path import resource_path

class PushButton(QPushButton):
def __init__(
self,
Expand Down Expand Up @@ -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)
Expand Down
Binary file added src/icon.ico
Binary file not shown.
1 change: 0 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ def resetSelection(self):
btn.setActive(False)



if __name__ == '__main__':
app = QApplication(sys.argv)
window = MainWindow()
Expand Down

0 comments on commit 5ea4790

Please sign in to comment.