diff --git a/gui/core/json_settings.py b/gui/core/json_settings.py index 8fa6826..ec784be 100644 --- a/gui/core/json_settings.py +++ b/gui/core/json_settings.py @@ -36,6 +36,7 @@ class Settings(object): super(Settings, self).__init__() # DICTIONARY WITH SETTINGS + # Just to have objects references self.items = { "app_name" : "", "custom_title_bar" : True, @@ -45,7 +46,8 @@ class Settings(object): "minimum" : 0, "maximum" : 0 }, - "theme_name" : "" + "theme_name" : "", + "teste" : "" } # DESERIALIZE diff --git a/gui/uis/windows/main_window/ui_main.py b/gui/uis/windows/main_window/ui_main.py index 7b663cd..23157b8 100644 --- a/gui/uis/windows/main_window/ui_main.py +++ b/gui/uis/windows/main_window/ui_main.py @@ -80,6 +80,16 @@ class UI_MainWindow(object): self.left_menu_frame.setMinimumSize(self.settings["menu_size"]["minimum"], 0) self.left_menu_frame.setStyleSheet("background: red; border-radius: 8px;") + # LEFT MENU LAYOUT + self.left_menu_layout = QHBoxLayout(self.left_menu_frame) + self.left_menu_layout.setContentsMargins(0,0,0,0) + + # ADD LEFT MENU + # Add custom left menu here + # /////////////////////////////////////////////////////////////// + self.left_menu = PyLeftMenu(self.left_menu_frame) + self.left_menu_layout.addWidget(self.left_menu) + # ADD RIGHT WIDGETS # Add here the right widgets # /////////////////////////////////////////////////////////////// @@ -89,7 +99,7 @@ class UI_MainWindow(object): # 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) + self.right_app_layout.setSpacing(6) # ADD TITLE BAR FRAME self.title_bar_frame = QFrame() diff --git a/gui/widgets/__init__.py b/gui/widgets/__init__.py index 4df82f7..5a5b27c 100644 --- a/gui/widgets/__init__.py +++ b/gui/widgets/__init__.py @@ -24,4 +24,8 @@ from . py_window import PyWindow # RESIZE GRIP # /////////////////////////////////////////////////////////////// -from . py_grips import PyGrips \ No newline at end of file +from . py_grips import PyGrips + +# LEFT MENU +# /////////////////////////////////////////////////////////////// +from . py_left_menu import PyLeftMenu \ No newline at end of file diff --git a/gui/widgets/py_left_menu/__init__.py b/gui/widgets/py_left_menu/__init__.py new file mode 100644 index 0000000..5c0ed6e --- /dev/null +++ b/gui/widgets/py_left_menu/__init__.py @@ -0,0 +1,20 @@ +# /////////////////////////////////////////////////////////////// +# +# BY: WANDERSON M.PIMENTA +# PROJECT MADE WITH: Qt Designer and PySide6 +# V: 1.0.0 +# +# This project can be used freely for all uses, as long as they maintain the +# respective credits only in the Python scripts, any information in the visual +# interface (GUI) can be modified without any implication. +# +# There are limitations on Qt licenses if you want to use your products +# commercially, I recommend reading them on the official website: +# https://doc.qt.io/qtforpython/licenses.html +# +# /////////////////////////////////////////////////////////////// + +# PY LEFT MENU +# Left menu bar +# /////////////////////////////////////////////////////////////// +from . py_left_menu import PyLeftMenu \ No newline at end of file diff --git a/gui/widgets/py_left_menu/py_left_menu.py b/gui/widgets/py_left_menu/py_left_menu.py new file mode 100644 index 0000000..0baeeab --- /dev/null +++ b/gui/widgets/py_left_menu/py_left_menu.py @@ -0,0 +1,78 @@ +# /////////////////////////////////////////////////////////////// +# +# BY: WANDERSON M.PIMENTA +# PROJECT MADE WITH: Qt Designer and PySide6 +# V: 1.0.0 +# +# This project can be used freely for all uses, as long as they maintain the +# respective credits only in the Python scripts, any information in the visual +# interface (GUI) can be modified without any implication. +# +# There are limitations on Qt licenses if you want to use your products +# commercially, I recommend reading them on the official website: +# https://doc.qt.io/qtforpython/licenses.html +# +# /////////////////////////////////////////////////////////////// + +# IMPORT PACKAGES AND MODULES +# /////////////////////////////////////////////////////////////// +import os + +# IMPORT QT CORE +# /////////////////////////////////////////////////////////////// +from qt_core import * + +# IMPORT SETTINGS +# /////////////////////////////////////////////////////////////// +from gui.core.json_settings import Settings + +# PY LEFT MENU +# /////////////////////////////////////////////////////////////// +class PyLeftMenu(QWidget): + def __init__( + self, + parent = None, + bg_color = "#1b1e23", + bg_color_app = "#2c313c", + icon_color = "#c3ccdf", + icon_color_hover = "#dce1ec", + icon_color_pressed = "#edf0f5", + icon_color_active = "#f5f6f9", + context_color = "#568af2" + ): + super(PyLeftMenu, self).__init__() + + # SET PARENT + self.parent = parent + + # SETUP WIDGETS + self.setup_ui() + + self.button = QPushButton("teste") + self.button_2 = QPushButton("teste") + self.layout.addWidget(self.button) + self.layout.addWidget(self.button_2) + + parent.setMinimumWidth(240) + + # SET APP LAYOUT + def setup_ui(self): + # ADD MENU LAYOUT + self.left_menu_layout = QVBoxLayout(self) + self.left_menu_layout.setContentsMargins(0,0,0,0) + + # ADD BG + self.bg = QFrame(self) + self.bg.setStyleSheet("background: #CCC") + + # ADD LAYOUT + self.layout = QVBoxLayout(self.bg) + self.layout.setContentsMargins(0,0,0,0) + + # ADD BG TO LAYOUT + self.left_menu_layout.addWidget(self.bg) + + + + + diff --git a/gui/widgets/py_window/py_window.py b/gui/widgets/py_window/py_window.py index 72c4dda..3948058 100644 --- a/gui/widgets/py_window/py_window.py +++ b/gui/widgets/py_window/py_window.py @@ -16,7 +16,6 @@ # IMPORT PACKAGES AND MODULES # /////////////////////////////////////////////////////////////// -import sys # IMPORT QT CORE # ///////////////////////////////////////////////////////////////