06/05/2021

This commit is contained in:
VFX - Visual Effects
2021-05-06 13:37:23 -03:00
parent 7f973fcbe7
commit 1d11513463
7 changed files with 239 additions and 48 deletions
+23
View File
@@ -0,0 +1,23 @@
# ///////////////////////////////////////////////////////////////
#
# 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
#
# ///////////////////////////////////////////////////////////////
# MAIN WINDOW
# ///////////////////////////////////////////////////////////////
from . ui_main import UI_MainWindow
# SETUP MAIN WINDOW
# ///////////////////////////////////////////////////////////////
from . setup_main_window import SetupMainWindow
@@ -0,0 +1,70 @@
# ///////////////////////////////////////////////////////////////
#
# 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 sys
# IMPORT QT CORE
# ///////////////////////////////////////////////////////////////
from qt_core import *
# IMPORT SETTINGS
# ///////////////////////////////////////////////////////////////
from gui.core.json_settings import Settings
# IMPORT THEME COLORS
# ///////////////////////////////////////////////////////////////
from gui.core.json_themes import Themes
# IMPORT PY ONE DARK WIDGETS
# ///////////////////////////////////////////////////////////////
from gui.widgets import *
# PY WINDOW
# ///////////////////////////////////////////////////////////////
class SetupMainWindow:
def setup(self):
# REMOVE TITLE BAR
# ///////////////////////////////////////////////////////////////
if self.settings["custom_title_bar"]:
self.setWindowFlag(Qt.FramelessWindowHint)
self.setAttribute(Qt.WA_TranslucentBackground)
# ADD GRIPS
# ///////////////////////////////////////////////////////////////
if self.settings["custom_title_bar"]:
self.left_grip = PyGrips(self, "left", self.hide_grips)
self.right_grip = PyGrips(self, "right", self.hide_grips)
self.top_grip = PyGrips(self, "top", self.hide_grips)
self.bottom_grip = PyGrips(self, "bottom", self.hide_grips)
self.top_left_grip = PyGrips(self, "top_left", self.hide_grips)
self.top_right_grip = PyGrips(self, "top_right", self.hide_grips)
self.bottom_left_grip = PyGrips(self, "bottom_left", self.hide_grips)
self.bottom_right_grip = PyGrips(self, "bottom_right", self.hide_grips)
# RESIZE GRIPS AND CHANGE POSITION
# Resize or change position when window is resized
# ///////////////////////////////////////////////////////////////
def resize_grips(self):
if self.settings["custom_title_bar"]:
self.left_grip.setGeometry(5, 10, 10, self.height())
self.right_grip.setGeometry(self.width() - 15, 10, 10, self.height())
self.top_grip.setGeometry(5, 5, self.width() - 10, 10)
self.bottom_grip.setGeometry(5, self.height() - 15, self.width() - 10, 10)
self.top_right_grip.setGeometry(self.width() - 20, 5, 15, 15)
self.bottom_left_grip.setGeometry(5, self.height() - 20, 15, 15)
self.bottom_right_grip.setGeometry(self.width() - 20, self.height() - 20, 15, 15)
+14 -2
View File
@@ -34,6 +34,10 @@ from gui.core.json_themes import Themes
# ///////////////////////////////////////////////////////////////
from gui.widgets import *
# IMPORT SETUP MAIN WINDOW
# ///////////////////////////////////////////////////////////////
from . setup_main_window import *
# PY WINDOW
# ///////////////////////////////////////////////////////////////
class UI_MainWindow(object):
@@ -64,12 +68,20 @@ class UI_MainWindow(object):
text_color = self.themes["app_color"]["text_foreground"]
)
# If disable custom title bar
if not self.settings["custom_title_bar"]:
self.window.set_stylesheet(border_radius = 0, border_size = 0)
# 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"]))
# ADD CENTRAL WIDGET
# ADD CENTRAL WIDGET AND SET CONTENT MARGINS
# ///////////////////////////////////////////////////////////////
parent.setCentralWidget(self.window)
parent.setContentsMargins(10,10,10,10)
if self.settings["custom_title_bar"]:
parent.setContentsMargins(10,10,10,10)
else:
parent.setContentsMargins(0,0,0,0)