diff --git a/gui/core/json_settings.py b/gui/core/json_settings.py index bdd795f..8fa6826 100644 --- a/gui/core/json_settings.py +++ b/gui/core/json_settings.py @@ -41,6 +41,10 @@ class Settings(object): "custom_title_bar" : True, "startup_size" : [], "minimum_size" : [], + "menu_size" : { + "minimum" : 0, + "maximum" : 0 + }, "theme_name" : "" } diff --git a/gui/uis/windows/main_window/setup_main_window.py b/gui/uis/windows/main_window/setup_main_window.py index ea99d5e..1fe592b 100644 --- a/gui/uis/windows/main_window/setup_main_window.py +++ b/gui/uis/windows/main_window/setup_main_window.py @@ -37,7 +37,13 @@ from gui.widgets import * # PY WINDOW # /////////////////////////////////////////////////////////////// class SetupMainWindow: + # SETUP MAIN WINDOW WITH CUSTOM PARAMETERS + # /////////////////////////////////////////////////////////////// def setup(self): + # APP TITLE + # /////////////////////////////////////////////////////////////// + self.setWindowTitle(self.settings["app_name"]) + # REMOVE TITLE BAR # /////////////////////////////////////////////////////////////// if self.settings["custom_title_bar"]: diff --git a/gui/uis/windows/main_window/ui_main.py b/gui/uis/windows/main_window/ui_main.py index b7351f4..7b663cd 100644 --- a/gui/uis/windows/main_window/ui_main.py +++ b/gui/uis/windows/main_window/ui_main.py @@ -71,12 +71,52 @@ class UI_MainWindow(object): # If disable custom title bar if not self.settings["custom_title_bar"]: self.window.set_stylesheet(border_radius = 0, border_size = 0) + + # ADD FRAME LEFT MENU + # Add here the custom left menu bar + # /////////////////////////////////////////////////////////////// + self.left_menu_frame = QFrame() + self.left_menu_frame.setMaximumSize(50, 17280) + self.left_menu_frame.setMinimumSize(self.settings["menu_size"]["minimum"], 0) + self.left_menu_frame.setStyleSheet("background: red; border-radius: 8px;") + + # ADD RIGHT WIDGETS + # Add here the right widgets + # /////////////////////////////////////////////////////////////// + self.right_app_frame = QFrame() + self.right_app_frame.setStyleSheet("border-radius: 8px;") + + # ADD RIGHT APP LAYOUT + self.right_app_layout = QVBoxLayout(self.right_app_frame) + self.right_app_layout.setContentsMargins(0,0,0,0) + self.right_app_layout.setSpacing(6) + + # ADD TITLE BAR FRAME + self.title_bar_frame = QFrame() + self.title_bar_frame.setMaximumHeight(40) + self.title_bar_frame.setMaximumHeight(40) + self.title_bar_frame.setStyleSheet("background: #f00") + + # ADD CONTENT AREA + self.content_area_frame = QFrame() + self.content_area_frame.setStyleSheet("background: #f00") + + # CREDITS / BOTTOM APP FRAME + self.credits_frame = QFrame() + self.credits_frame.setMaximumHeight(26) + self.credits_frame.setMaximumHeight(26) + self.credits_frame.setStyleSheet("background: #f00") + + # ADD WIDGETS TO RIGHT LAYOUT + self.right_app_layout.addWidget(self.title_bar_frame) + self.right_app_layout.addWidget(self.content_area_frame) + self.right_app_layout.addWidget(self.credits_frame) # ADD WIDGETS TO "PyWindow" # Add here your custom widgets or default widgets # /////////////////////////////////////////////////////////////// - self.window.layout.addWidget(QLabel(self.settings["app_name"])) - self.window.layout.addWidget(QLabel(self.settings["app_name"])) + self.window.layout.addWidget(self.left_menu_frame) + self.window.layout.addWidget(self.right_app_frame) # ADD CENTRAL WIDGET AND SET CONTENT MARGINS # /////////////////////////////////////////////////////////////// diff --git a/gui/widgets/py_window/py_window.py b/gui/widgets/py_window/py_window.py index bb2961c..72c4dda 100644 --- a/gui/widgets/py_window/py_window.py +++ b/gui/widgets/py_window/py_window.py @@ -41,7 +41,7 @@ class PyWindow(QFrame): self, parent, layout = Qt.Vertical, - margin = 10, + margin = 5, bg_color = "#2c313c", text_color = "#fff", text_font = "9pt 'Segoe UI'", @@ -82,7 +82,7 @@ class PyWindow(QFrame): # /////////////////////////////////////////////////////////////// if layout == Qt.Vertical: # VERTICAL LAYOUT - self.layout = QVBoxLayout(self) + self.layout = QHBoxLayout(self) else: # HORIZONTAL LAYOUT self.layout = QHBoxLayout(self) @@ -93,7 +93,7 @@ class PyWindow(QFrame): if self.settings["custom_title_bar"]: if enable_shadow: self.shadow = QGraphicsDropShadowEffect() - self.shadow.setBlurRadius(25) + self.shadow.setBlurRadius(20) self.shadow.setXOffset(0) self.shadow.setYOffset(0) self.shadow.setColor(QColor(0, 0, 0, 120)) diff --git a/settings.json b/settings.json index cd258c2..1d24c18 100644 --- a/settings.json +++ b/settings.json @@ -1,6 +1,6 @@ { "app_name": "PyOneDark - Modern GUI", - "custom_title_bar": false, + "custom_title_bar": true, "startup_size": [ 1200, 720 @@ -9,5 +9,9 @@ 960, 540 ], + "menu_size" : { + "minimum" : 50, + "maximum" : 240 + }, "theme_name": "default" } \ No newline at end of file