mirror of
https://github.com/Wanderson-Magalhaes/PyOneDark_Qt_Widgets_Modern_GUI.git
synced 2026-02-17 07:53:57 +00:00
24/05/2021
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
"context_pressed" : "#3f6fd1",
|
||||
"text_title" : "#dce1ec",
|
||||
"text_foreground" : "#8a95aa",
|
||||
"text_description" : "#6c7b95",
|
||||
"text_description" : "#4f5b6e",
|
||||
"text_active" : "#dce1ec"
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
# IMPORT PACKAGES AND MODULES
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
from gui.widgets.py_credits_bar.py_credits import PyCredits
|
||||
import sys
|
||||
|
||||
# IMPORT QT CORE
|
||||
@@ -184,16 +185,35 @@ class UI_MainWindow(object):
|
||||
self.title_bar_layout.addWidget(self.title_bar)
|
||||
|
||||
# ADD CONTENT AREA
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
self.content_area_frame = QFrame()
|
||||
self.content_area_frame.setStyleSheet("background: transparent")
|
||||
|
||||
# CREDITS / BOTTOM APP FRAME
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
self.credits_frame = QFrame()
|
||||
self.credits_frame.setMaximumHeight(26)
|
||||
self.credits_frame.setMaximumHeight(26)
|
||||
self.credits_frame.setStyleSheet("background: transparent")
|
||||
|
||||
# CREATE LAYOUT
|
||||
self.credits_layout = QVBoxLayout(self.credits_frame)
|
||||
self.credits_layout.setContentsMargins(0,0,0,0)
|
||||
|
||||
# ADD CUSTOM WIDGET CREDITS
|
||||
self.credits = PyCredits(
|
||||
bg_two = self.themes["app_color"]["bg_two"],
|
||||
copyright = self.settings["copyright"],
|
||||
version = self.settings["version"],
|
||||
font_family = self.settings["font"]["family"],
|
||||
text_size = self.settings["font"]["text_size"],
|
||||
text_description_color = self.themes["app_color"]["text_description"]
|
||||
)
|
||||
|
||||
# ADD TO LAYOUT
|
||||
self.credits_layout.addWidget(self.credits)
|
||||
|
||||
# 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)
|
||||
|
||||
@@ -32,4 +32,8 @@ from . py_left_menu import PyLeftMenu
|
||||
|
||||
# PY TITLE BAR
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
from . py_title_bar import PyTitleBar
|
||||
from . py_title_bar import PyTitleBar
|
||||
|
||||
# PY CREDITS
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
from . py_credits_bar import PyCredits
|
||||
19
gui/widgets/py_credits_bar/__init__.py
Normal file
19
gui/widgets/py_credits_bar/__init__.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
#
|
||||
# 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 CREDITS
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
from . py_credits import PyCredits
|
||||
95
gui/widgets/py_credits_bar/py_credits.py
Normal file
95
gui/widgets/py_credits_bar/py_credits.py
Normal file
@@ -0,0 +1,95 @@
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
#
|
||||
# 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 QT CORE
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
from qt_core import *
|
||||
|
||||
# PY CREDITS BAR AND VERSION
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
class PyCredits(QWidget):
|
||||
def __init__(
|
||||
self,
|
||||
copyright,
|
||||
version,
|
||||
bg_two,
|
||||
font_family,
|
||||
text_size,
|
||||
text_description_color,
|
||||
radius = 8,
|
||||
padding = 10
|
||||
):
|
||||
super(PyCredits, self).__init__()
|
||||
|
||||
# PROPERTIES
|
||||
self._copyright = copyright
|
||||
self._version = version
|
||||
self._bg_two = bg_two
|
||||
self._font_family = font_family
|
||||
self._text_size = text_size
|
||||
self._text_description_color = text_description_color
|
||||
self._radius = radius
|
||||
self._padding = padding
|
||||
|
||||
# SETUP UI
|
||||
self.setup_ui()
|
||||
|
||||
def setup_ui(self):
|
||||
# ADD LAYOUT
|
||||
self.widget_layout = QHBoxLayout(self)
|
||||
self.widget_layout.setContentsMargins(0,0,0,0)
|
||||
|
||||
# BG STYLE
|
||||
style = f"""
|
||||
#bg_frame {{
|
||||
border-radius: {self._radius}px;
|
||||
background-color: {self._bg_two};
|
||||
}}
|
||||
.QLabel {{
|
||||
font: {self._text_size}pt "{self._font_family}";
|
||||
color: {self._text_description_color};
|
||||
padding-left: {self._padding}px;
|
||||
padding-right: {self._padding}px;
|
||||
}}
|
||||
"""
|
||||
|
||||
# BG FRAME
|
||||
self.bg_frame = QFrame()
|
||||
self.bg_frame.setObjectName("bg_frame")
|
||||
self.bg_frame.setStyleSheet(style)
|
||||
|
||||
# ADD TO LAYOUT
|
||||
self.widget_layout.addWidget(self.bg_frame)
|
||||
|
||||
# ADD BG LAYOUT
|
||||
self.bg_layout = QHBoxLayout(self.bg_frame)
|
||||
self.bg_layout.setContentsMargins(0,0,0,0)
|
||||
|
||||
# ADD COPYRIGHT TEXT
|
||||
self.copyright_label = QLabel(self._copyright)
|
||||
self.copyright_label.setAlignment(Qt.AlignVCenter)
|
||||
|
||||
# ADD VERSION TEXT
|
||||
self.version_label = QLabel(self._version)
|
||||
self.version_label.setAlignment(Qt.AlignVCenter)
|
||||
|
||||
# SEPARATOR
|
||||
self.separator = QSpacerItem(20, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
|
||||
|
||||
# ADD TO LAYOUT
|
||||
self.bg_layout.addWidget(self.copyright_label)
|
||||
self.bg_layout.addSpacerItem(self.separator)
|
||||
self.bg_layout.addWidget(self.version_label)
|
||||
@@ -176,23 +176,19 @@ class PyLeftMenu(QWidget):
|
||||
# EXPAND / RETRACT LEF MENU
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
def toggle_animation(self):
|
||||
# SELECT TOGGLE WHEN EXPANDED
|
||||
if self.toggle_button._is_toggle_active:
|
||||
self.toggle_button.set_active_toggle(False)
|
||||
self.toggle_button.set_icon(self._icon_path)
|
||||
else:
|
||||
self.toggle_button.set_active_toggle(True)
|
||||
self.toggle_button.set_icon(self._icon_path_close)
|
||||
|
||||
# CREATE ANIMATION
|
||||
self.animation = QPropertyAnimation(self._parent, b"minimumWidth")
|
||||
self.animation.stop()
|
||||
if self.width() == self._minimum_width:
|
||||
self.animation.setStartValue(self.width())
|
||||
self.animation.setEndValue(self._maximum_width)
|
||||
self.toggle_button.set_active_toggle(True)
|
||||
self.toggle_button.set_icon(self._icon_path_close)
|
||||
else:
|
||||
self.animation.setStartValue(self.width())
|
||||
self.animation.setEndValue(self._minimum_width)
|
||||
self.toggle_button.set_active_toggle(False)
|
||||
self.toggle_button.set_icon(self._icon_path)
|
||||
self.animation.setEasingCurve(QEasingCurve.InOutCubic)
|
||||
self.animation.setDuration(self._duration_time)
|
||||
self.animation.start()
|
||||
|
||||
3
main.py
3
main.py
@@ -84,8 +84,7 @@ class MainWindow(QMainWindow):
|
||||
if self.settings["custom_title_bar"]:
|
||||
self.ui.title_bar.set_title(self.settings["app_name"])
|
||||
else:
|
||||
self.ui.title_bar.set_title("Welcome to PyOneDark")
|
||||
|
||||
self.ui.title_bar.set_title("Welcome to PyOneDark")
|
||||
|
||||
# SHOW MAIN WINDOW
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"app_name": "PyOneDark - Modern GUI",
|
||||
"version" : "1.0.0",
|
||||
"version" : "v1.0.0",
|
||||
"copyright" : "By: Wanderson M. Pimenta",
|
||||
"year" : 2021,
|
||||
"custom_title_bar": true,
|
||||
"startup_size": [
|
||||
1200,
|
||||
|
||||
Reference in New Issue
Block a user