mirror of
https://github.com/Wanderson-Magalhaes/PyOneDark_Qt_Widgets_Modern_GUI.git
synced 2026-02-17 07:53:57 +00:00
08/05/2021
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -24,4 +24,8 @@ from . py_window import PyWindow
|
||||
|
||||
# RESIZE GRIP
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
from . py_grips import PyGrips
|
||||
from . py_grips import PyGrips
|
||||
|
||||
# LEFT MENU
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
from . py_left_menu import PyLeftMenu
|
||||
20
gui/widgets/py_left_menu/__init__.py
Normal file
20
gui/widgets/py_left_menu/__init__.py
Normal file
@@ -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
|
||||
78
gui/widgets/py_left_menu/py_left_menu.py
Normal file
78
gui/widgets/py_left_menu/py_left_menu.py
Normal file
@@ -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)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
# IMPORT PACKAGES AND MODULES
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
import sys
|
||||
|
||||
# IMPORT QT CORE
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user