v1.0.1 Released

This commit is contained in:
Wanderson M. Pimenta
2021-07-31 09:14:45 -03:00
committed by GitHub
parent a3952dad06
commit c36a51579f
56 changed files with 6359 additions and 6359 deletions

View File

@@ -1,50 +1,50 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT PACKAGES AND MODULES # IMPORT PACKAGES AND MODULES
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
import os import os
# APP FUNCTIONS # APP FUNCTIONS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
class Functions: class Functions:
# SET SVG ICON # SET SVG ICON
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def set_svg_icon(icon_name): def set_svg_icon(icon_name):
app_path = os.path.abspath(os.getcwd()) app_path = os.path.abspath(os.getcwd())
folder = "gui/images/svg_icons/" folder = "gui/images/svg_icons/"
path = os.path.join(app_path, folder) path = os.path.join(app_path, folder)
icon = os.path.normpath(os.path.join(path, icon_name)) icon = os.path.normpath(os.path.join(path, icon_name))
return icon return icon
# SET SVG IMAGE # SET SVG IMAGE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def set_svg_image(icon_name): def set_svg_image(icon_name):
app_path = os.path.abspath(os.getcwd()) app_path = os.path.abspath(os.getcwd())
folder = "gui/images/svg_images/" folder = "gui/images/svg_images/"
path = os.path.join(app_path, folder) path = os.path.join(app_path, folder)
icon = os.path.normpath(os.path.join(path, icon_name)) icon = os.path.normpath(os.path.join(path, icon_name))
return icon return icon
# SET IMAGE # SET IMAGE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def set_image(image_name): def set_image(image_name):
app_path = os.path.abspath(os.getcwd()) app_path = os.path.abspath(os.getcwd())
folder = "gui/images/images/" folder = "gui/images/images/"
path = os.path.join(app_path, folder) path = os.path.join(app_path, folder)
image = os.path.normpath(os.path.join(path, image_name)) image = os.path.normpath(os.path.join(path, image_name))
return image return image

View File

@@ -1,58 +1,58 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT PACKAGES AND MODULES # IMPORT PACKAGES AND MODULES
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
import json import json
import os import os
# APP SETTINGS # APP SETTINGS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
class Settings(object): class Settings(object):
# APP PATH # APP PATH
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
json_file = "settings.json" json_file = "settings.json"
app_path = os.path.abspath(os.getcwd()) app_path = os.path.abspath(os.getcwd())
settings_path = os.path.normpath(os.path.join(app_path, json_file)) settings_path = os.path.normpath(os.path.join(app_path, json_file))
if not os.path.isfile(settings_path): if not os.path.isfile(settings_path):
print(f"WARNING: \"settings.json\" not found! check in the folder {settings_path}") print(f"WARNING: \"settings.json\" not found! check in the folder {settings_path}")
# INIT SETTINGS # INIT SETTINGS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def __init__(self): def __init__(self):
super(Settings, self).__init__() super(Settings, self).__init__()
# DICTIONARY WITH SETTINGS # DICTIONARY WITH SETTINGS
# Just to have objects references # Just to have objects references
self.items = {} self.items = {}
# DESERIALIZE # DESERIALIZE
self.deserialize() self.deserialize()
# SERIALIZE JSON # SERIALIZE JSON
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def serialize(self): def serialize(self):
# WRITE JSON FILE # WRITE JSON FILE
with open(self.settings_path, "w", encoding='utf-8') as write: with open(self.settings_path, "w", encoding='utf-8') as write:
json.dump(self.items, write, indent=4) json.dump(self.items, write, indent=4)
# DESERIALIZE JSON # DESERIALIZE JSON
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def deserialize(self): def deserialize(self):
# READ JSON FILE # READ JSON FILE
with open(self.settings_path, "r", encoding='utf-8') as reader: with open(self.settings_path, "r", encoding='utf-8') as reader:
settings = json.loads(reader.read()) settings = json.loads(reader.read())
self.items = settings self.items = settings

View File

@@ -1,66 +1,66 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT PACKAGES AND MODULES # IMPORT PACKAGES AND MODULES
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
import json import json
import os import os
# IMPORT SETTINGS # IMPORT SETTINGS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from gui.core.json_settings import Settings from gui.core.json_settings import Settings
# APP THEMES # APP THEMES
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
class Themes(object): class Themes(object):
# LOAD SETTINGS # LOAD SETTINGS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
setup_settings = Settings() setup_settings = Settings()
_settings = setup_settings.items _settings = setup_settings.items
# APP PATH # APP PATH
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
json_file = f"gui/themes/{_settings['theme_name']}.json" json_file = f"gui/themes/{_settings['theme_name']}.json"
app_path = os.path.abspath(os.getcwd()) app_path = os.path.abspath(os.getcwd())
settings_path = os.path.normpath(os.path.join(app_path, json_file)) settings_path = os.path.normpath(os.path.join(app_path, json_file))
if not os.path.isfile(settings_path): if not os.path.isfile(settings_path):
print(f"WARNING: \"gui/themes/{_settings['theme_name']}.json\" not found! check in the folder {settings_path}") print(f"WARNING: \"gui/themes/{_settings['theme_name']}.json\" not found! check in the folder {settings_path}")
# INIT SETTINGS # INIT SETTINGS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def __init__(self): def __init__(self):
super(Themes, self).__init__() super(Themes, self).__init__()
# DICTIONARY WITH SETTINGS # DICTIONARY WITH SETTINGS
self.items = {} self.items = {}
# DESERIALIZE # DESERIALIZE
self.deserialize() self.deserialize()
# SERIALIZE JSON # SERIALIZE JSON
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def serialize(self): def serialize(self):
# WRITE JSON FILE # WRITE JSON FILE
with open(self.settings_path, "w", encoding='utf-8') as write: with open(self.settings_path, "w", encoding='utf-8') as write:
json.dump(self.items, write, indent=4) json.dump(self.items, write, indent=4)
# DESERIALIZE JSON # DESERIALIZE JSON
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def deserialize(self): def deserialize(self):
# READ JSON FILE # READ JSON FILE
with open(self.settings_path, "r", encoding='utf-8') as reader: with open(self.settings_path, "r", encoding='utf-8') as reader:
settings = json.loads(reader.read()) settings = json.loads(reader.read())
self.items = settings self.items = settings

View File

@@ -1,28 +1,28 @@
{ {
"theme_name" : "Default", "theme_name" : "Default",
"app_color" : { "app_color" : {
"dark_one" : "#1b1e23", "dark_one" : "#1b1e23",
"dark_two" : "#1e2229", "dark_two" : "#1e2229",
"dark_three" : "#21252d", "dark_three" : "#21252d",
"dark_four" : "#272c36", "dark_four" : "#272c36",
"bg_one" : "#D3E0F7", "bg_one" : "#D3E0F7",
"bg_two" : "#E2E9F7", "bg_two" : "#E2E9F7",
"bg_three" : "#EFF1F7", "bg_three" : "#EFF1F7",
"icon_color" : "#6C7C96", "icon_color" : "#6C7C96",
"icon_hover" : "#8CB8FF", "icon_hover" : "#8CB8FF",
"icon_pressed" : "#6c99f4", "icon_pressed" : "#6c99f4",
"icon_active" : "#8CB8FF", "icon_active" : "#8CB8FF",
"context_color" : "#568af2", "context_color" : "#568af2",
"context_hover" : "#6c99f4", "context_hover" : "#6c99f4",
"context_pressed" : "#4B5469", "context_pressed" : "#4B5469",
"text_title" : "#606C85", "text_title" : "#606C85",
"text_foreground" : "#6B7894", "text_foreground" : "#6B7894",
"text_description" : "#7887A6", "text_description" : "#7887A6",
"text_active" : "#8797BA", "text_active" : "#8797BA",
"white" : "#f5f6f9", "white" : "#f5f6f9",
"pink" : "#ff007f", "pink" : "#ff007f",
"green" : "#00ff7f", "green" : "#00ff7f",
"red" : "#ff5555", "red" : "#ff5555",
"yellow" : "#f1fa8c" "yellow" : "#f1fa8c"
} }
} }

View File

@@ -1,28 +1,28 @@
{ {
"theme_name" : "Default", "theme_name" : "Default",
"app_color" : { "app_color" : {
"dark_one" : "#1b1e23", "dark_one" : "#1b1e23",
"dark_two" : "#1e2229", "dark_two" : "#1e2229",
"dark_three" : "#21252d", "dark_three" : "#21252d",
"dark_four" : "#272c36", "dark_four" : "#272c36",
"bg_one" : "#2c313c", "bg_one" : "#2c313c",
"bg_two" : "#343b48", "bg_two" : "#343b48",
"bg_three" : "#3c4454", "bg_three" : "#3c4454",
"icon_color" : "#c3ccdf", "icon_color" : "#c3ccdf",
"icon_hover" : "#dce1ec", "icon_hover" : "#dce1ec",
"icon_pressed" : "#6c99f4", "icon_pressed" : "#6c99f4",
"icon_active" : "#f5f6f9", "icon_active" : "#f5f6f9",
"context_color" : "#568af2", "context_color" : "#568af2",
"context_hover" : "#6c99f4", "context_hover" : "#6c99f4",
"context_pressed" : "#3f6fd1", "context_pressed" : "#3f6fd1",
"text_title" : "#dce1ec", "text_title" : "#dce1ec",
"text_foreground" : "#8a95aa", "text_foreground" : "#8a95aa",
"text_description" : "#4f5b6e", "text_description" : "#4f5b6e",
"text_active" : "#dce1ec", "text_active" : "#dce1ec",
"white" : "#f5f6f9", "white" : "#f5f6f9",
"pink" : "#ff007f", "pink" : "#ff007f",
"green" : "#00ff7f", "green" : "#00ff7f",
"red" : "#ff5555", "red" : "#ff5555",
"yellow" : "#f1fa8c" "yellow" : "#f1fa8c"
} }
} }

View File

@@ -1,28 +1,28 @@
{ {
"theme_name" : "dracula", "theme_name" : "dracula",
"app_color" : { "app_color" : {
"dark_one" : "#282a36", "dark_one" : "#282a36",
"dark_two" : "#2B2E3B", "dark_two" : "#2B2E3B",
"dark_three" : "#333645", "dark_three" : "#333645",
"dark_four" : "#3C4052", "dark_four" : "#3C4052",
"bg_one" : "#44475a", "bg_one" : "#44475a",
"bg_two" : "#4D5066", "bg_two" : "#4D5066",
"bg_three" : "#595D75", "bg_three" : "#595D75",
"icon_color" : "#c3ccdf", "icon_color" : "#c3ccdf",
"icon_hover" : "#dce1ec", "icon_hover" : "#dce1ec",
"icon_pressed" : "#ff79c6", "icon_pressed" : "#ff79c6",
"icon_active" : "#f5f6f9", "icon_active" : "#f5f6f9",
"context_color" : "#ff79c6", "context_color" : "#ff79c6",
"context_hover" : "#FF84D7", "context_hover" : "#FF84D7",
"context_pressed" : "#FF90DD", "context_pressed" : "#FF90DD",
"text_title" : "#dce1ec", "text_title" : "#dce1ec",
"text_foreground" : "#f8f8f2", "text_foreground" : "#f8f8f2",
"text_description" : "#979EC7", "text_description" : "#979EC7",
"text_active" : "#dce1ec", "text_active" : "#dce1ec",
"white" : "#f5f6f9", "white" : "#f5f6f9",
"pink" : "#ff79c6", "pink" : "#ff79c6",
"green" : "#00ff7f", "green" : "#00ff7f",
"red" : "#ff5555", "red" : "#ff5555",
"yellow" : "#f1fa8c" "yellow" : "#f1fa8c"
} }
} }

View File

@@ -1,271 +1,271 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>LeftColumn</class> <class>LeftColumn</class>
<widget class="QWidget" name="LeftColumn"> <widget class="QWidget" name="LeftColumn">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>240</width> <width>240</width>
<height>600</height> <height>600</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QVBoxLayout" name="main_pages_layout"> <layout class="QVBoxLayout" name="main_pages_layout">
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>5</number> <number>5</number>
</property> </property>
<item> <item>
<widget class="QStackedWidget" name="menus"> <widget class="QStackedWidget" name="menus">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="menu_1"> <widget class="QWidget" name="menu_1">
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing"> <property name="spacing">
<number>5</number> <number>5</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>5</number> <number>5</number>
</property> </property>
<item> <item>
<widget class="QWidget" name="btn_1_widget" native="true"> <widget class="QWidget" name="btn_1_widget" native="true">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>40</height> <height>40</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>16777215</width> <width>16777215</width>
<height>40</height> <height>40</height>
</size> </size>
</property> </property>
<layout class="QVBoxLayout" name="btn_1_layout"> <layout class="QVBoxLayout" name="btn_1_layout">
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
</layout> </layout>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QWidget" name="btn_2_widget" native="true"> <widget class="QWidget" name="btn_2_widget" native="true">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>40</height> <height>40</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>16777215</width> <width>16777215</width>
<height>40</height> <height>40</height>
</size> </size>
</property> </property>
<layout class="QVBoxLayout" name="btn_2_layout"> <layout class="QVBoxLayout" name="btn_2_layout">
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
</layout> </layout>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QWidget" name="btn_3_widget" native="true"> <widget class="QWidget" name="btn_3_widget" native="true">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>40</height> <height>40</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>16777215</width> <width>16777215</width>
<height>40</height> <height>40</height>
</size> </size>
</property> </property>
<layout class="QVBoxLayout" name="btn_3_layout"> <layout class="QVBoxLayout" name="btn_3_layout">
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
</layout> </layout>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_1"> <widget class="QLabel" name="label_1">
<property name="font"> <property name="font">
<font> <font>
<pointsize>16</pointsize> <pointsize>16</pointsize>
</font> </font>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">font-size: 16pt</string> <string notr="true">font-size: 16pt</string>
</property> </property>
<property name="text"> <property name="text">
<string>Menu 1 - Left Menu</string> <string>Menu 1 - Left Menu</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="menu_2"> <widget class="QWidget" name="menu_2">
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing"> <property name="spacing">
<number>5</number> <number>5</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>5</number> <number>5</number>
</property> </property>
<item> <item>
<widget class="QWidget" name="btn_4_widget" native="true"> <widget class="QWidget" name="btn_4_widget" native="true">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>40</height> <height>40</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>16777215</width> <width>16777215</width>
<height>40</height> <height>40</height>
</size> </size>
</property> </property>
<layout class="QVBoxLayout" name="btn_4_layout"> <layout class="QVBoxLayout" name="btn_4_layout">
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
</layout> </layout>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="font"> <property name="font">
<font> <font>
<pointsize>16</pointsize> <pointsize>16</pointsize>
</font> </font>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">font-size: 16pt</string> <string notr="true">font-size: 16pt</string>
</property> </property>
<property name="text"> <property name="text">
<string>Menu 2 - Left Menu</string> <string>Menu 2 - Left Menu</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
<property name="font"> <property name="font">
<font> <font>
<pointsize>9</pointsize> <pointsize>9</pointsize>
</font> </font>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">font-size: 9pt</string> <string notr="true">font-size: 9pt</string>
</property> </property>
<property name="text"> <property name="text">
<string>This is just an example menu. <string>This is just an example menu.
Add Qt Widgets or your custom widgets here.</string> Add Qt Widgets or your custom widgets here.</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@@ -1,117 +1,117 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>RightColumn</class> <class>RightColumn</class>
<widget class="QWidget" name="RightColumn"> <widget class="QWidget" name="RightColumn">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>240</width> <width>240</width>
<height>600</height> <height>600</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QVBoxLayout" name="main_pages_layout"> <layout class="QVBoxLayout" name="main_pages_layout">
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>5</number> <number>5</number>
</property> </property>
<item> <item>
<widget class="QStackedWidget" name="menus"> <widget class="QStackedWidget" name="menus">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="menu_1"> <widget class="QWidget" name="menu_1">
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing"> <property name="spacing">
<number>5</number> <number>5</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>5</number> <number>5</number>
</property> </property>
<item> <item>
<widget class="QLabel" name="label_1"> <widget class="QLabel" name="label_1">
<property name="font"> <property name="font">
<font> <font>
<pointsize>16</pointsize> <pointsize>16</pointsize>
</font> </font>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">font-size: 16pt</string> <string notr="true">font-size: 16pt</string>
</property> </property>
<property name="text"> <property name="text">
<string>Menu 1 - Right Menu</string> <string>Menu 1 - Right Menu</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="menu_2"> <widget class="QWidget" name="menu_2">
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing"> <property name="spacing">
<number>5</number> <number>5</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>5</number> <number>5</number>
</property> </property>
<item> <item>
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="font"> <property name="font">
<font> <font>
<pointsize>16</pointsize> <pointsize>16</pointsize>
</font> </font>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">font-size: 16pt</string> <string notr="true">font-size: 16pt</string>
</property> </property>
<property name="text"> <property name="text">
<string>Menu 2 - Right Menu</string> <string>Menu 2 - Right Menu</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@@ -1,139 +1,139 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT QT CORE # IMPORT QT CORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from qt_core import * from qt_core import *
class Ui_LeftColumn(object): class Ui_LeftColumn(object):
def setupUi(self, LeftColumn): def setupUi(self, LeftColumn):
if not LeftColumn.objectName(): if not LeftColumn.objectName():
LeftColumn.setObjectName(u"LeftColumn") LeftColumn.setObjectName(u"LeftColumn")
LeftColumn.resize(240, 600) LeftColumn.resize(240, 600)
self.main_pages_layout = QVBoxLayout(LeftColumn) self.main_pages_layout = QVBoxLayout(LeftColumn)
self.main_pages_layout.setSpacing(0) self.main_pages_layout.setSpacing(0)
self.main_pages_layout.setObjectName(u"main_pages_layout") self.main_pages_layout.setObjectName(u"main_pages_layout")
self.main_pages_layout.setContentsMargins(5, 5, 5, 5) self.main_pages_layout.setContentsMargins(5, 5, 5, 5)
self.menus = QStackedWidget(LeftColumn) self.menus = QStackedWidget(LeftColumn)
self.menus.setObjectName(u"menus") self.menus.setObjectName(u"menus")
self.menu_1 = QWidget() self.menu_1 = QWidget()
self.menu_1.setObjectName(u"menu_1") self.menu_1.setObjectName(u"menu_1")
self.verticalLayout = QVBoxLayout(self.menu_1) self.verticalLayout = QVBoxLayout(self.menu_1)
self.verticalLayout.setSpacing(5) self.verticalLayout.setSpacing(5)
self.verticalLayout.setObjectName(u"verticalLayout") self.verticalLayout.setObjectName(u"verticalLayout")
self.verticalLayout.setContentsMargins(5, 5, 5, 5) self.verticalLayout.setContentsMargins(5, 5, 5, 5)
self.btn_1_widget = QWidget(self.menu_1) self.btn_1_widget = QWidget(self.menu_1)
self.btn_1_widget.setObjectName(u"btn_1_widget") self.btn_1_widget.setObjectName(u"btn_1_widget")
self.btn_1_widget.setMinimumSize(QSize(0, 40)) self.btn_1_widget.setMinimumSize(QSize(0, 40))
self.btn_1_widget.setMaximumSize(QSize(16777215, 40)) self.btn_1_widget.setMaximumSize(QSize(16777215, 40))
self.btn_1_layout = QVBoxLayout(self.btn_1_widget) self.btn_1_layout = QVBoxLayout(self.btn_1_widget)
self.btn_1_layout.setSpacing(0) self.btn_1_layout.setSpacing(0)
self.btn_1_layout.setObjectName(u"btn_1_layout") self.btn_1_layout.setObjectName(u"btn_1_layout")
self.btn_1_layout.setContentsMargins(0, 0, 0, 0) self.btn_1_layout.setContentsMargins(0, 0, 0, 0)
self.verticalLayout.addWidget(self.btn_1_widget) self.verticalLayout.addWidget(self.btn_1_widget)
self.btn_2_widget = QWidget(self.menu_1) self.btn_2_widget = QWidget(self.menu_1)
self.btn_2_widget.setObjectName(u"btn_2_widget") self.btn_2_widget.setObjectName(u"btn_2_widget")
self.btn_2_widget.setMinimumSize(QSize(0, 40)) self.btn_2_widget.setMinimumSize(QSize(0, 40))
self.btn_2_widget.setMaximumSize(QSize(16777215, 40)) self.btn_2_widget.setMaximumSize(QSize(16777215, 40))
self.btn_2_layout = QVBoxLayout(self.btn_2_widget) self.btn_2_layout = QVBoxLayout(self.btn_2_widget)
self.btn_2_layout.setSpacing(0) self.btn_2_layout.setSpacing(0)
self.btn_2_layout.setObjectName(u"btn_2_layout") self.btn_2_layout.setObjectName(u"btn_2_layout")
self.btn_2_layout.setContentsMargins(0, 0, 0, 0) self.btn_2_layout.setContentsMargins(0, 0, 0, 0)
self.verticalLayout.addWidget(self.btn_2_widget) self.verticalLayout.addWidget(self.btn_2_widget)
self.btn_3_widget = QWidget(self.menu_1) self.btn_3_widget = QWidget(self.menu_1)
self.btn_3_widget.setObjectName(u"btn_3_widget") self.btn_3_widget.setObjectName(u"btn_3_widget")
self.btn_3_widget.setMinimumSize(QSize(0, 40)) self.btn_3_widget.setMinimumSize(QSize(0, 40))
self.btn_3_widget.setMaximumSize(QSize(16777215, 40)) self.btn_3_widget.setMaximumSize(QSize(16777215, 40))
self.btn_3_layout = QVBoxLayout(self.btn_3_widget) self.btn_3_layout = QVBoxLayout(self.btn_3_widget)
self.btn_3_layout.setSpacing(0) self.btn_3_layout.setSpacing(0)
self.btn_3_layout.setObjectName(u"btn_3_layout") self.btn_3_layout.setObjectName(u"btn_3_layout")
self.btn_3_layout.setContentsMargins(0, 0, 0, 0) self.btn_3_layout.setContentsMargins(0, 0, 0, 0)
self.verticalLayout.addWidget(self.btn_3_widget) self.verticalLayout.addWidget(self.btn_3_widget)
self.label_1 = QLabel(self.menu_1) self.label_1 = QLabel(self.menu_1)
self.label_1.setObjectName(u"label_1") self.label_1.setObjectName(u"label_1")
font = QFont() font = QFont()
font.setPointSize(16) font.setPointSize(16)
self.label_1.setFont(font) self.label_1.setFont(font)
self.label_1.setStyleSheet(u"font-size: 16pt") self.label_1.setStyleSheet(u"font-size: 16pt")
self.label_1.setAlignment(Qt.AlignCenter) self.label_1.setAlignment(Qt.AlignCenter)
self.verticalLayout.addWidget(self.label_1) self.verticalLayout.addWidget(self.label_1)
self.menus.addWidget(self.menu_1) self.menus.addWidget(self.menu_1)
self.menu_2 = QWidget() self.menu_2 = QWidget()
self.menu_2.setObjectName(u"menu_2") self.menu_2.setObjectName(u"menu_2")
self.verticalLayout_2 = QVBoxLayout(self.menu_2) self.verticalLayout_2 = QVBoxLayout(self.menu_2)
self.verticalLayout_2.setSpacing(5) self.verticalLayout_2.setSpacing(5)
self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.verticalLayout_2.setObjectName(u"verticalLayout_2")
self.verticalLayout_2.setContentsMargins(5, 5, 5, 5) self.verticalLayout_2.setContentsMargins(5, 5, 5, 5)
self.btn_4_widget = QWidget(self.menu_2) self.btn_4_widget = QWidget(self.menu_2)
self.btn_4_widget.setObjectName(u"btn_4_widget") self.btn_4_widget.setObjectName(u"btn_4_widget")
self.btn_4_widget.setMinimumSize(QSize(0, 40)) self.btn_4_widget.setMinimumSize(QSize(0, 40))
self.btn_4_widget.setMaximumSize(QSize(16777215, 40)) self.btn_4_widget.setMaximumSize(QSize(16777215, 40))
self.btn_4_layout = QVBoxLayout(self.btn_4_widget) self.btn_4_layout = QVBoxLayout(self.btn_4_widget)
self.btn_4_layout.setSpacing(0) self.btn_4_layout.setSpacing(0)
self.btn_4_layout.setObjectName(u"btn_4_layout") self.btn_4_layout.setObjectName(u"btn_4_layout")
self.btn_4_layout.setContentsMargins(0, 0, 0, 0) self.btn_4_layout.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_2.addWidget(self.btn_4_widget) self.verticalLayout_2.addWidget(self.btn_4_widget)
self.label_2 = QLabel(self.menu_2) self.label_2 = QLabel(self.menu_2)
self.label_2.setObjectName(u"label_2") self.label_2.setObjectName(u"label_2")
self.label_2.setFont(font) self.label_2.setFont(font)
self.label_2.setStyleSheet(u"font-size: 16pt") self.label_2.setStyleSheet(u"font-size: 16pt")
self.label_2.setAlignment(Qt.AlignCenter) self.label_2.setAlignment(Qt.AlignCenter)
self.verticalLayout_2.addWidget(self.label_2) self.verticalLayout_2.addWidget(self.label_2)
self.label_3 = QLabel(self.menu_2) self.label_3 = QLabel(self.menu_2)
self.label_3.setObjectName(u"label_3") self.label_3.setObjectName(u"label_3")
font1 = QFont() font1 = QFont()
font1.setPointSize(9) font1.setPointSize(9)
self.label_3.setFont(font1) self.label_3.setFont(font1)
self.label_3.setStyleSheet(u"font-size: 9pt") self.label_3.setStyleSheet(u"font-size: 9pt")
self.label_3.setAlignment(Qt.AlignCenter) self.label_3.setAlignment(Qt.AlignCenter)
self.label_3.setWordWrap(True) self.label_3.setWordWrap(True)
self.verticalLayout_2.addWidget(self.label_3) self.verticalLayout_2.addWidget(self.label_3)
self.menus.addWidget(self.menu_2) self.menus.addWidget(self.menu_2)
self.main_pages_layout.addWidget(self.menus) self.main_pages_layout.addWidget(self.menus)
self.retranslateUi(LeftColumn) self.retranslateUi(LeftColumn)
self.menus.setCurrentIndex(0) self.menus.setCurrentIndex(0)
QMetaObject.connectSlotsByName(LeftColumn) QMetaObject.connectSlotsByName(LeftColumn)
# setupUi # setupUi
def retranslateUi(self, LeftColumn): def retranslateUi(self, LeftColumn):
LeftColumn.setWindowTitle(QCoreApplication.translate("LeftColumn", u"Form", None)) LeftColumn.setWindowTitle(QCoreApplication.translate("LeftColumn", u"Form", None))
self.label_1.setText(QCoreApplication.translate("LeftColumn", u"Menu 1 - Left Menu", None)) self.label_1.setText(QCoreApplication.translate("LeftColumn", u"Menu 1 - Left Menu", None))
self.label_2.setText(QCoreApplication.translate("LeftColumn", u"Menu 2 - Left Menu", None)) self.label_2.setText(QCoreApplication.translate("LeftColumn", u"Menu 2 - Left Menu", None))
self.label_3.setText(QCoreApplication.translate("LeftColumn", u"This is just an example menu.\n" self.label_3.setText(QCoreApplication.translate("LeftColumn", u"This is just an example menu.\n"
"Add Qt Widgets or your custom widgets here.", None)) "Add Qt Widgets or your custom widgets here.", None))
# retranslateUi # retranslateUi

View File

@@ -1,117 +1,117 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT QT CORE # IMPORT QT CORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from qt_core import * from qt_core import *
class Ui_RightColumn(object): class Ui_RightColumn(object):
def setupUi(self, RightColumn): def setupUi(self, RightColumn):
if not RightColumn.objectName(): if not RightColumn.objectName():
RightColumn.setObjectName(u"RightColumn") RightColumn.setObjectName(u"RightColumn")
RightColumn.resize(240, 600) RightColumn.resize(240, 600)
self.main_pages_layout = QVBoxLayout(RightColumn) self.main_pages_layout = QVBoxLayout(RightColumn)
self.main_pages_layout.setSpacing(0) self.main_pages_layout.setSpacing(0)
self.main_pages_layout.setObjectName(u"main_pages_layout") self.main_pages_layout.setObjectName(u"main_pages_layout")
self.main_pages_layout.setContentsMargins(5, 5, 5, 5) self.main_pages_layout.setContentsMargins(5, 5, 5, 5)
self.menus = QStackedWidget(RightColumn) self.menus = QStackedWidget(RightColumn)
self.menus.setObjectName(u"menus") self.menus.setObjectName(u"menus")
self.menu_1 = QWidget() self.menu_1 = QWidget()
self.menu_1.setObjectName(u"menu_1") self.menu_1.setObjectName(u"menu_1")
self.verticalLayout = QVBoxLayout(self.menu_1) self.verticalLayout = QVBoxLayout(self.menu_1)
self.verticalLayout.setSpacing(5) self.verticalLayout.setSpacing(5)
self.verticalLayout.setObjectName(u"verticalLayout") self.verticalLayout.setObjectName(u"verticalLayout")
self.verticalLayout.setContentsMargins(5, 5, 5, 5) self.verticalLayout.setContentsMargins(5, 5, 5, 5)
self.btn_1_widget = QWidget(self.menu_1) self.btn_1_widget = QWidget(self.menu_1)
self.btn_1_widget.setObjectName(u"btn_1_widget") self.btn_1_widget.setObjectName(u"btn_1_widget")
self.btn_1_widget.setMinimumSize(QSize(0, 40)) self.btn_1_widget.setMinimumSize(QSize(0, 40))
self.btn_1_widget.setMaximumSize(QSize(16777215, 40)) self.btn_1_widget.setMaximumSize(QSize(16777215, 40))
self.btn_1_layout = QVBoxLayout(self.btn_1_widget) self.btn_1_layout = QVBoxLayout(self.btn_1_widget)
self.btn_1_layout.setSpacing(0) self.btn_1_layout.setSpacing(0)
self.btn_1_layout.setObjectName(u"btn_1_layout") self.btn_1_layout.setObjectName(u"btn_1_layout")
self.btn_1_layout.setContentsMargins(0, 0, 0, 0) self.btn_1_layout.setContentsMargins(0, 0, 0, 0)
self.verticalLayout.addWidget(self.btn_1_widget) self.verticalLayout.addWidget(self.btn_1_widget)
self.label_1 = QLabel(self.menu_1) self.label_1 = QLabel(self.menu_1)
self.label_1.setObjectName(u"label_1") self.label_1.setObjectName(u"label_1")
font = QFont() font = QFont()
font.setPointSize(16) font.setPointSize(16)
self.label_1.setFont(font) self.label_1.setFont(font)
self.label_1.setStyleSheet(u"font-size: 16pt") self.label_1.setStyleSheet(u"font-size: 16pt")
self.label_1.setAlignment(Qt.AlignCenter) self.label_1.setAlignment(Qt.AlignCenter)
self.verticalLayout.addWidget(self.label_1) self.verticalLayout.addWidget(self.label_1)
self.menus.addWidget(self.menu_1) self.menus.addWidget(self.menu_1)
self.menu_2 = QWidget() self.menu_2 = QWidget()
self.menu_2.setObjectName(u"menu_2") self.menu_2.setObjectName(u"menu_2")
self.verticalLayout_2 = QVBoxLayout(self.menu_2) self.verticalLayout_2 = QVBoxLayout(self.menu_2)
self.verticalLayout_2.setSpacing(5) self.verticalLayout_2.setSpacing(5)
self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.verticalLayout_2.setObjectName(u"verticalLayout_2")
self.verticalLayout_2.setContentsMargins(5, 5, 5, 5) self.verticalLayout_2.setContentsMargins(5, 5, 5, 5)
self.btn_2_widget = QWidget(self.menu_2) self.btn_2_widget = QWidget(self.menu_2)
self.btn_2_widget.setObjectName(u"btn_2_widget") self.btn_2_widget.setObjectName(u"btn_2_widget")
self.btn_2_widget.setMinimumSize(QSize(0, 40)) self.btn_2_widget.setMinimumSize(QSize(0, 40))
self.btn_2_widget.setMaximumSize(QSize(16777215, 40)) self.btn_2_widget.setMaximumSize(QSize(16777215, 40))
self.btn_2_layout = QVBoxLayout(self.btn_2_widget) self.btn_2_layout = QVBoxLayout(self.btn_2_widget)
self.btn_2_layout.setSpacing(0) self.btn_2_layout.setSpacing(0)
self.btn_2_layout.setObjectName(u"btn_2_layout") self.btn_2_layout.setObjectName(u"btn_2_layout")
self.btn_2_layout.setContentsMargins(0, 0, 0, 0) self.btn_2_layout.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_2.addWidget(self.btn_2_widget) self.verticalLayout_2.addWidget(self.btn_2_widget)
self.label_2 = QLabel(self.menu_2) self.label_2 = QLabel(self.menu_2)
self.label_2.setObjectName(u"label_2") self.label_2.setObjectName(u"label_2")
self.label_2.setFont(font) self.label_2.setFont(font)
self.label_2.setStyleSheet(u"font-size: 16pt") self.label_2.setStyleSheet(u"font-size: 16pt")
self.label_2.setAlignment(Qt.AlignCenter) self.label_2.setAlignment(Qt.AlignCenter)
self.verticalLayout_2.addWidget(self.label_2) self.verticalLayout_2.addWidget(self.label_2)
self.label_3 = QLabel(self.menu_2) self.label_3 = QLabel(self.menu_2)
self.label_3.setObjectName(u"label_3") self.label_3.setObjectName(u"label_3")
font1 = QFont() font1 = QFont()
font1.setPointSize(9) font1.setPointSize(9)
self.label_3.setFont(font1) self.label_3.setFont(font1)
self.label_3.setStyleSheet(u"font-size: 9pt") self.label_3.setStyleSheet(u"font-size: 9pt")
self.label_3.setAlignment(Qt.AlignCenter) self.label_3.setAlignment(Qt.AlignCenter)
self.label_3.setWordWrap(True) self.label_3.setWordWrap(True)
self.verticalLayout_2.addWidget(self.label_3) self.verticalLayout_2.addWidget(self.label_3)
self.menus.addWidget(self.menu_2) self.menus.addWidget(self.menu_2)
self.main_pages_layout.addWidget(self.menus) self.main_pages_layout.addWidget(self.menus)
self.retranslateUi(RightColumn) self.retranslateUi(RightColumn)
self.menus.setCurrentIndex(1) self.menus.setCurrentIndex(1)
QMetaObject.connectSlotsByName(RightColumn) QMetaObject.connectSlotsByName(RightColumn)
# setupUi # setupUi
def retranslateUi(self, RightColumn): def retranslateUi(self, RightColumn):
RightColumn.setWindowTitle(QCoreApplication.translate("RightColumn", u"Form", None)) RightColumn.setWindowTitle(QCoreApplication.translate("RightColumn", u"Form", None))
self.label_1.setText(QCoreApplication.translate("RightColumn", u"Menu 1 - Right Menu", None)) self.label_1.setText(QCoreApplication.translate("RightColumn", u"Menu 1 - Right Menu", None))
self.label_2.setText(QCoreApplication.translate("RightColumn", u"Menu 2 - Right Menu", None)) self.label_2.setText(QCoreApplication.translate("RightColumn", u"Menu 2 - Right Menu", None))
self.label_3.setText(QCoreApplication.translate("RightColumn", u"This is just an example menu.\n" self.label_3.setText(QCoreApplication.translate("RightColumn", u"This is just an example menu.\n"
"Add Qt Widgets or your custom widgets here.", None)) "Add Qt Widgets or your custom widgets here.", None))
# retranslateUi # retranslateUi

View File

@@ -1,298 +1,298 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>MainPages</class> <class>MainPages</class>
<widget class="QWidget" name="MainPages"> <widget class="QWidget" name="MainPages">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>860</width> <width>860</width>
<height>600</height> <height>600</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QVBoxLayout" name="main_pages_layout"> <layout class="QVBoxLayout" name="main_pages_layout">
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>5</number> <number>5</number>
</property> </property>
<item> <item>
<widget class="QStackedWidget" name="pages"> <widget class="QStackedWidget" name="pages">
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>1</number>
</property> </property>
<widget class="QWidget" name="page_1"> <widget class="QWidget" name="page_1">
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">font-size: 14pt</string> <string notr="true">font-size: 14pt</string>
</property> </property>
<layout class="QVBoxLayout" name="page_1_layout"> <layout class="QVBoxLayout" name="page_1_layout">
<property name="spacing"> <property name="spacing">
<number>5</number> <number>5</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>5</number> <number>5</number>
</property> </property>
<item alignment="Qt::AlignHCenter"> <item alignment="Qt::AlignHCenter">
<widget class="QFrame" name="welcome_base"> <widget class="QFrame" name="welcome_base">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>300</width> <width>300</width>
<height>150</height> <height>150</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>300</width> <width>300</width>
<height>150</height> <height>150</height>
</size> </size>
</property> </property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="frameShadow"> <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QVBoxLayout" name="center_page_layout"> <layout class="QVBoxLayout" name="center_page_layout">
<property name="spacing"> <property name="spacing">
<number>10</number> <number>10</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QFrame" name="logo"> <widget class="QFrame" name="logo">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>300</width> <width>300</width>
<height>120</height> <height>120</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>300</width> <width>300</width>
<height>120</height> <height>120</height>
</size> </size>
</property> </property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="frameShadow"> <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QVBoxLayout" name="logo_layout"> <layout class="QVBoxLayout" name="logo_layout">
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
</layout> </layout>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>Welcome To PyOneDark GUI</string> <string>Welcome To PyOneDark GUI</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="page_2"> <widget class="QWidget" name="page_2">
<layout class="QVBoxLayout" name="page_2_layout"> <layout class="QVBoxLayout" name="page_2_layout">
<property name="spacing"> <property name="spacing">
<number>5</number> <number>5</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>5</number> <number>5</number>
</property> </property>
<item> <item>
<widget class="QScrollArea" name="scroll_area"> <widget class="QScrollArea" name="scroll_area">
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">background: transparent;</string> <string notr="true">background: transparent;</string>
</property> </property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="verticalScrollBarPolicy"> <property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum> <enum>Qt::ScrollBarAlwaysOff</enum>
</property> </property>
<property name="horizontalScrollBarPolicy"> <property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum> <enum>Qt::ScrollBarAlwaysOff</enum>
</property> </property>
<property name="widgetResizable"> <property name="widgetResizable">
<bool>true</bool> <bool>true</bool>
</property> </property>
<widget class="QWidget" name="contents"> <widget class="QWidget" name="contents">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>840</width> <width>840</width>
<height>580</height> <height>580</height>
</rect> </rect>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">background: transparent;</string> <string notr="true">background: transparent;</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing"> <property name="spacing">
<number>15</number> <number>15</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>5</number> <number>5</number>
</property> </property>
<item> <item>
<widget class="QLabel" name="title_label"> <widget class="QLabel" name="title_label">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>16777215</width> <width>16777215</width>
<height>40</height> <height>40</height>
</size> </size>
</property> </property>
<property name="font"> <property name="font">
<font> <font>
<pointsize>16</pointsize> <pointsize>16</pointsize>
</font> </font>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">font-size: 16pt</string> <string notr="true">font-size: 16pt</string>
</property> </property>
<property name="text"> <property name="text">
<string>Custom Widgets Page</string> <string>Custom Widgets Page</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="description_label"> <widget class="QLabel" name="description_label">
<property name="text"> <property name="text">
<string>Here will be all the custom widgets, they will be added over time on this page. <string>Here will be all the custom widgets, they will be added over time on this page.
I will try to always record a new tutorial when adding a new Widget and updating the project on Patreon before launching on GitHub and GitHub after the public release.</string> I will try to always record a new tutorial when adding a new Widget and updating the project on Patreon before launching on GitHub and GitHub after the public release.</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignHCenter|Qt::AlignTop</set> <set>Qt::AlignHCenter|Qt::AlignTop</set>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="row_1_layout"/> <layout class="QHBoxLayout" name="row_1_layout"/>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="row_2_layout"/> <layout class="QHBoxLayout" name="row_2_layout"/>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="row_3_layout"/> <layout class="QHBoxLayout" name="row_3_layout"/>
</item> </item>
<item> <item>
<layout class="QVBoxLayout" name="row_4_layout"/> <layout class="QVBoxLayout" name="row_4_layout"/>
</item> </item>
<item> <item>
<layout class="QVBoxLayout" name="row_5_layout"/> <layout class="QVBoxLayout" name="row_5_layout"/>
</item> </item>
</layout> </layout>
</widget> </widget>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="page_3"> <widget class="QWidget" name="page_3">
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">QFrame { <string notr="true">QFrame {
font-size: 16pt; font-size: 16pt;
}</string> }</string>
</property> </property>
<layout class="QVBoxLayout" name="page_3_layout"> <layout class="QVBoxLayout" name="page_3_layout">
<item> <item>
<widget class="QLabel" name="empty_page_label"> <widget class="QLabel" name="empty_page_label">
<property name="font"> <property name="font">
<font> <font>
<pointsize>16</pointsize> <pointsize>16</pointsize>
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Empty Page</string> <string>Empty Page</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@@ -1,177 +1,177 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT QT CORE # IMPORT QT CORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from qt_core import * from qt_core import *
class Ui_MainPages(object): class Ui_MainPages(object):
def setupUi(self, MainPages): def setupUi(self, MainPages):
if not MainPages.objectName(): if not MainPages.objectName():
MainPages.setObjectName(u"MainPages") MainPages.setObjectName(u"MainPages")
MainPages.resize(860, 600) MainPages.resize(860, 600)
self.main_pages_layout = QVBoxLayout(MainPages) self.main_pages_layout = QVBoxLayout(MainPages)
self.main_pages_layout.setSpacing(0) self.main_pages_layout.setSpacing(0)
self.main_pages_layout.setObjectName(u"main_pages_layout") self.main_pages_layout.setObjectName(u"main_pages_layout")
self.main_pages_layout.setContentsMargins(5, 5, 5, 5) self.main_pages_layout.setContentsMargins(5, 5, 5, 5)
self.pages = QStackedWidget(MainPages) self.pages = QStackedWidget(MainPages)
self.pages.setObjectName(u"pages") self.pages.setObjectName(u"pages")
self.page_1 = QWidget() self.page_1 = QWidget()
self.page_1.setObjectName(u"page_1") self.page_1.setObjectName(u"page_1")
self.page_1.setStyleSheet(u"font-size: 14pt") self.page_1.setStyleSheet(u"font-size: 14pt")
self.page_1_layout = QVBoxLayout(self.page_1) self.page_1_layout = QVBoxLayout(self.page_1)
self.page_1_layout.setSpacing(5) self.page_1_layout.setSpacing(5)
self.page_1_layout.setObjectName(u"page_1_layout") self.page_1_layout.setObjectName(u"page_1_layout")
self.page_1_layout.setContentsMargins(5, 5, 5, 5) self.page_1_layout.setContentsMargins(5, 5, 5, 5)
self.welcome_base = QFrame(self.page_1) self.welcome_base = QFrame(self.page_1)
self.welcome_base.setObjectName(u"welcome_base") self.welcome_base.setObjectName(u"welcome_base")
self.welcome_base.setMinimumSize(QSize(300, 150)) self.welcome_base.setMinimumSize(QSize(300, 150))
self.welcome_base.setMaximumSize(QSize(300, 150)) self.welcome_base.setMaximumSize(QSize(300, 150))
self.welcome_base.setFrameShape(QFrame.NoFrame) self.welcome_base.setFrameShape(QFrame.NoFrame)
self.welcome_base.setFrameShadow(QFrame.Raised) self.welcome_base.setFrameShadow(QFrame.Raised)
self.center_page_layout = QVBoxLayout(self.welcome_base) self.center_page_layout = QVBoxLayout(self.welcome_base)
self.center_page_layout.setSpacing(10) self.center_page_layout.setSpacing(10)
self.center_page_layout.setObjectName(u"center_page_layout") self.center_page_layout.setObjectName(u"center_page_layout")
self.center_page_layout.setContentsMargins(0, 0, 0, 0) self.center_page_layout.setContentsMargins(0, 0, 0, 0)
self.logo = QFrame(self.welcome_base) self.logo = QFrame(self.welcome_base)
self.logo.setObjectName(u"logo") self.logo.setObjectName(u"logo")
self.logo.setMinimumSize(QSize(300, 120)) self.logo.setMinimumSize(QSize(300, 120))
self.logo.setMaximumSize(QSize(300, 120)) self.logo.setMaximumSize(QSize(300, 120))
self.logo.setFrameShape(QFrame.NoFrame) self.logo.setFrameShape(QFrame.NoFrame)
self.logo.setFrameShadow(QFrame.Raised) self.logo.setFrameShadow(QFrame.Raised)
self.logo_layout = QVBoxLayout(self.logo) self.logo_layout = QVBoxLayout(self.logo)
self.logo_layout.setSpacing(0) self.logo_layout.setSpacing(0)
self.logo_layout.setObjectName(u"logo_layout") self.logo_layout.setObjectName(u"logo_layout")
self.logo_layout.setContentsMargins(0, 0, 0, 0) self.logo_layout.setContentsMargins(0, 0, 0, 0)
self.center_page_layout.addWidget(self.logo) self.center_page_layout.addWidget(self.logo)
self.label = QLabel(self.welcome_base) self.label = QLabel(self.welcome_base)
self.label.setObjectName(u"label") self.label.setObjectName(u"label")
self.label.setAlignment(Qt.AlignCenter) self.label.setAlignment(Qt.AlignCenter)
self.center_page_layout.addWidget(self.label) self.center_page_layout.addWidget(self.label)
self.page_1_layout.addWidget(self.welcome_base, 0, Qt.AlignHCenter) self.page_1_layout.addWidget(self.welcome_base, 0, Qt.AlignHCenter)
self.pages.addWidget(self.page_1) self.pages.addWidget(self.page_1)
self.page_2 = QWidget() self.page_2 = QWidget()
self.page_2.setObjectName(u"page_2") self.page_2.setObjectName(u"page_2")
self.page_2_layout = QVBoxLayout(self.page_2) self.page_2_layout = QVBoxLayout(self.page_2)
self.page_2_layout.setSpacing(5) self.page_2_layout.setSpacing(5)
self.page_2_layout.setObjectName(u"page_2_layout") self.page_2_layout.setObjectName(u"page_2_layout")
self.page_2_layout.setContentsMargins(5, 5, 5, 5) self.page_2_layout.setContentsMargins(5, 5, 5, 5)
self.scroll_area = QScrollArea(self.page_2) self.scroll_area = QScrollArea(self.page_2)
self.scroll_area.setObjectName(u"scroll_area") self.scroll_area.setObjectName(u"scroll_area")
self.scroll_area.setStyleSheet(u"background: transparent;") self.scroll_area.setStyleSheet(u"background: transparent;")
self.scroll_area.setFrameShape(QFrame.NoFrame) self.scroll_area.setFrameShape(QFrame.NoFrame)
self.scroll_area.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.scroll_area.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.scroll_area.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.scroll_area.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.scroll_area.setWidgetResizable(True) self.scroll_area.setWidgetResizable(True)
self.contents = QWidget() self.contents = QWidget()
self.contents.setObjectName(u"contents") self.contents.setObjectName(u"contents")
self.contents.setGeometry(QRect(0, 0, 840, 580)) self.contents.setGeometry(QRect(0, 0, 840, 580))
self.contents.setStyleSheet(u"background: transparent;") self.contents.setStyleSheet(u"background: transparent;")
self.verticalLayout = QVBoxLayout(self.contents) self.verticalLayout = QVBoxLayout(self.contents)
self.verticalLayout.setSpacing(15) self.verticalLayout.setSpacing(15)
self.verticalLayout.setObjectName(u"verticalLayout") self.verticalLayout.setObjectName(u"verticalLayout")
self.verticalLayout.setContentsMargins(5, 5, 5, 5) self.verticalLayout.setContentsMargins(5, 5, 5, 5)
self.title_label = QLabel(self.contents) self.title_label = QLabel(self.contents)
self.title_label.setObjectName(u"title_label") self.title_label.setObjectName(u"title_label")
self.title_label.setMaximumSize(QSize(16777215, 40)) self.title_label.setMaximumSize(QSize(16777215, 40))
font = QFont() font = QFont()
font.setPointSize(16) font.setPointSize(16)
self.title_label.setFont(font) self.title_label.setFont(font)
self.title_label.setStyleSheet(u"font-size: 16pt") self.title_label.setStyleSheet(u"font-size: 16pt")
self.title_label.setAlignment(Qt.AlignCenter) self.title_label.setAlignment(Qt.AlignCenter)
self.verticalLayout.addWidget(self.title_label) self.verticalLayout.addWidget(self.title_label)
self.description_label = QLabel(self.contents) self.description_label = QLabel(self.contents)
self.description_label.setObjectName(u"description_label") self.description_label.setObjectName(u"description_label")
self.description_label.setAlignment(Qt.AlignHCenter|Qt.AlignTop) self.description_label.setAlignment(Qt.AlignHCenter|Qt.AlignTop)
self.description_label.setWordWrap(True) self.description_label.setWordWrap(True)
self.verticalLayout.addWidget(self.description_label) self.verticalLayout.addWidget(self.description_label)
self.row_1_layout = QHBoxLayout() self.row_1_layout = QHBoxLayout()
self.row_1_layout.setObjectName(u"row_1_layout") self.row_1_layout.setObjectName(u"row_1_layout")
self.verticalLayout.addLayout(self.row_1_layout) self.verticalLayout.addLayout(self.row_1_layout)
self.row_2_layout = QHBoxLayout() self.row_2_layout = QHBoxLayout()
self.row_2_layout.setObjectName(u"row_2_layout") self.row_2_layout.setObjectName(u"row_2_layout")
self.verticalLayout.addLayout(self.row_2_layout) self.verticalLayout.addLayout(self.row_2_layout)
self.row_3_layout = QHBoxLayout() self.row_3_layout = QHBoxLayout()
self.row_3_layout.setObjectName(u"row_3_layout") self.row_3_layout.setObjectName(u"row_3_layout")
self.verticalLayout.addLayout(self.row_3_layout) self.verticalLayout.addLayout(self.row_3_layout)
self.row_4_layout = QVBoxLayout() self.row_4_layout = QVBoxLayout()
self.row_4_layout.setObjectName(u"row_4_layout") self.row_4_layout.setObjectName(u"row_4_layout")
self.verticalLayout.addLayout(self.row_4_layout) self.verticalLayout.addLayout(self.row_4_layout)
self.row_5_layout = QVBoxLayout() self.row_5_layout = QVBoxLayout()
self.row_5_layout.setObjectName(u"row_5_layout") self.row_5_layout.setObjectName(u"row_5_layout")
self.verticalLayout.addLayout(self.row_5_layout) self.verticalLayout.addLayout(self.row_5_layout)
self.scroll_area.setWidget(self.contents) self.scroll_area.setWidget(self.contents)
self.page_2_layout.addWidget(self.scroll_area) self.page_2_layout.addWidget(self.scroll_area)
self.pages.addWidget(self.page_2) self.pages.addWidget(self.page_2)
self.page_3 = QWidget() self.page_3 = QWidget()
self.page_3.setObjectName(u"page_3") self.page_3.setObjectName(u"page_3")
self.page_3.setStyleSheet(u"QFrame {\n" self.page_3.setStyleSheet(u"QFrame {\n"
" font-size: 16pt;\n" " font-size: 16pt;\n"
"}") "}")
self.page_3_layout = QVBoxLayout(self.page_3) self.page_3_layout = QVBoxLayout(self.page_3)
self.page_3_layout.setObjectName(u"page_3_layout") self.page_3_layout.setObjectName(u"page_3_layout")
self.empty_page_label = QLabel(self.page_3) self.empty_page_label = QLabel(self.page_3)
self.empty_page_label.setObjectName(u"empty_page_label") self.empty_page_label.setObjectName(u"empty_page_label")
self.empty_page_label.setFont(font) self.empty_page_label.setFont(font)
self.empty_page_label.setAlignment(Qt.AlignCenter) self.empty_page_label.setAlignment(Qt.AlignCenter)
self.page_3_layout.addWidget(self.empty_page_label) self.page_3_layout.addWidget(self.empty_page_label)
self.pages.addWidget(self.page_3) self.pages.addWidget(self.page_3)
self.main_pages_layout.addWidget(self.pages) self.main_pages_layout.addWidget(self.pages)
self.retranslateUi(MainPages) self.retranslateUi(MainPages)
self.pages.setCurrentIndex(0) self.pages.setCurrentIndex(0)
QMetaObject.connectSlotsByName(MainPages) QMetaObject.connectSlotsByName(MainPages)
# setupUi # setupUi
def retranslateUi(self, MainPages): def retranslateUi(self, MainPages):
MainPages.setWindowTitle(QCoreApplication.translate("MainPages", u"Form", None)) MainPages.setWindowTitle(QCoreApplication.translate("MainPages", u"Form", None))
self.label.setText(QCoreApplication.translate("MainPages", u"Welcome To PyOneDark GUI", None)) self.label.setText(QCoreApplication.translate("MainPages", u"Welcome To PyOneDark GUI", None))
self.title_label.setText(QCoreApplication.translate("MainPages", u"Custom Widgets Page", None)) self.title_label.setText(QCoreApplication.translate("MainPages", u"Custom Widgets Page", None))
self.description_label.setText(QCoreApplication.translate("MainPages", u"Here will be all the custom widgets, they will be added over time on this page.\n" self.description_label.setText(QCoreApplication.translate("MainPages", u"Here will be all the custom widgets, they will be added over time on this page.\n"
"I will try to always record a new tutorial when adding a new Widget and updating the project on Patreon before launching on GitHub and GitHub after the public release.", None)) "I will try to always record a new tutorial when adding a new Widget and updating the project on Patreon before launching on GitHub and GitHub after the public release.", None))
self.empty_page_label.setText(QCoreApplication.translate("MainPages", u"Empty Page", None)) self.empty_page_label.setText(QCoreApplication.translate("MainPages", u"Empty Page", None))
# retranslateUi # retranslateUi

View File

@@ -1,23 +1,23 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# MAIN WINDOW # MAIN WINDOW
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . ui_main import UI_MainWindow from . ui_main import UI_MainWindow
# SETUP MAIN WINDOW # SETUP MAIN WINDOW
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . setup_main_window import SetupMainWindow from . setup_main_window import SetupMainWindow

View File

@@ -1,145 +1,145 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT PACKAGES AND MODULES # IMPORT PACKAGES AND MODULES
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
import sys import sys
# IMPORT QT CORE # IMPORT QT CORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from qt_core import * from qt_core import *
# LOAD UI MAIN # LOAD UI MAIN
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . ui_main import * from . ui_main import *
# FUNCTIONS # FUNCTIONS
class MainFunctions(): class MainFunctions():
def __init__(self): def __init__(self):
super().__init__() super().__init__()
# SETUP MAIN WINDOw # SETUP MAIN WINDOw
# Load widgets from "gui\uis\main_window\ui_main.py" # Load widgets from "gui\uis\main_window\ui_main.py"
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.ui = UI_MainWindow() self.ui = UI_MainWindow()
self.ui.setup_ui(self) self.ui.setup_ui(self)
# SET MAIN WINDOW PAGES # SET MAIN WINDOW PAGES
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def set_page(self, page): def set_page(self, page):
self.ui.load_pages.pages.setCurrentWidget(page) self.ui.load_pages.pages.setCurrentWidget(page)
# SET LEFT COLUMN PAGES # SET LEFT COLUMN PAGES
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def set_left_column_menu( def set_left_column_menu(
self, self,
menu, menu,
title, title,
icon_path icon_path
): ):
self.ui.left_column.menus.menus.setCurrentWidget(menu) self.ui.left_column.menus.menus.setCurrentWidget(menu)
self.ui.left_column.title_label.setText(title) self.ui.left_column.title_label.setText(title)
self.ui.left_column.icon.set_icon(icon_path) self.ui.left_column.icon.set_icon(icon_path)
# RETURN IF LEFT COLUMN IS VISIBLE # RETURN IF LEFT COLUMN IS VISIBLE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def left_column_is_visible(self): def left_column_is_visible(self):
width = self.ui.left_column_frame.width() width = self.ui.left_column_frame.width()
if width == 0: if width == 0:
return False return False
else: else:
return True return True
# RETURN IF RIGHT COLUMN IS VISIBLE # RETURN IF RIGHT COLUMN IS VISIBLE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def right_column_is_visible(self): def right_column_is_visible(self):
width = self.ui.right_column_frame.width() width = self.ui.right_column_frame.width()
if width == 0: if width == 0:
return False return False
else: else:
return True return True
# SET RIGHT COLUMN PAGES # SET RIGHT COLUMN PAGES
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def set_right_column_menu(self, menu): def set_right_column_menu(self, menu):
self.ui.right_column.menus.setCurrentWidget(menu) self.ui.right_column.menus.setCurrentWidget(menu)
# GET TITLE BUTTON BY OBJECT NAME # GET TITLE BUTTON BY OBJECT NAME
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def get_title_bar_btn(self, object_name): def get_title_bar_btn(self, object_name):
return self.ui.title_bar_frame.findChild(QPushButton, object_name) return self.ui.title_bar_frame.findChild(QPushButton, object_name)
# GET TITLE BUTTON BY OBJECT NAME # GET TITLE BUTTON BY OBJECT NAME
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def get_left_menu_btn(self, object_name): def get_left_menu_btn(self, object_name):
return self.ui.left_menu.findChild(QPushButton, object_name) return self.ui.left_menu.findChild(QPushButton, object_name)
# LEDT AND RIGHT COLUMNS / SHOW / HIDE # LEDT AND RIGHT COLUMNS / SHOW / HIDE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def toggle_left_column(self): def toggle_left_column(self):
# GET ACTUAL CLUMNS SIZE # GET ACTUAL CLUMNS SIZE
width = self.ui.left_column_frame.width() width = self.ui.left_column_frame.width()
right_column_width = self.ui.right_column_frame.width() right_column_width = self.ui.right_column_frame.width()
MainFunctions.start_box_animation(self, width, right_column_width, "left") MainFunctions.start_box_animation(self, width, right_column_width, "left")
def toggle_right_column(self): def toggle_right_column(self):
# GET ACTUAL CLUMNS SIZE # GET ACTUAL CLUMNS SIZE
left_column_width = self.ui.left_column_frame.width() left_column_width = self.ui.left_column_frame.width()
width = self.ui.right_column_frame.width() width = self.ui.right_column_frame.width()
MainFunctions.start_box_animation(self, left_column_width, width, "right") MainFunctions.start_box_animation(self, left_column_width, width, "right")
def start_box_animation(self, left_box_width, right_box_width, direction): def start_box_animation(self, left_box_width, right_box_width, direction):
right_width = 0 right_width = 0
left_width = 0 left_width = 0
time_animation = self.ui.settings["time_animation"] time_animation = self.ui.settings["time_animation"]
minimum_left = self.ui.settings["left_column_size"]["minimum"] minimum_left = self.ui.settings["left_column_size"]["minimum"]
maximum_left = self.ui.settings["left_column_size"]["maximum"] maximum_left = self.ui.settings["left_column_size"]["maximum"]
minimum_right = self.ui.settings["right_column_size"]["minimum"] minimum_right = self.ui.settings["right_column_size"]["minimum"]
maximum_right = self.ui.settings["right_column_size"]["maximum"] maximum_right = self.ui.settings["right_column_size"]["maximum"]
# Check Left Values # Check Left Values
if left_box_width == minimum_left and direction == "left": if left_box_width == minimum_left and direction == "left":
left_width = maximum_left left_width = maximum_left
else: else:
left_width = minimum_left left_width = minimum_left
# Check Right values # Check Right values
if right_box_width == minimum_right and direction == "right": if right_box_width == minimum_right and direction == "right":
right_width = maximum_right right_width = maximum_right
else: else:
right_width = minimum_right right_width = minimum_right
# ANIMATION LEFT BOX # ANIMATION LEFT BOX
self.left_box = QPropertyAnimation(self.ui.left_column_frame, b"minimumWidth") self.left_box = QPropertyAnimation(self.ui.left_column_frame, b"minimumWidth")
self.left_box.setDuration(time_animation) self.left_box.setDuration(time_animation)
self.left_box.setStartValue(left_box_width) self.left_box.setStartValue(left_box_width)
self.left_box.setEndValue(left_width) self.left_box.setEndValue(left_width)
self.left_box.setEasingCurve(QEasingCurve.InOutQuart) self.left_box.setEasingCurve(QEasingCurve.InOutQuart)
# ANIMATION RIGHT BOX # ANIMATION RIGHT BOX
self.right_box = QPropertyAnimation(self.ui.right_column_frame, b"minimumWidth") self.right_box = QPropertyAnimation(self.ui.right_column_frame, b"minimumWidth")
self.right_box.setDuration(time_animation) self.right_box.setDuration(time_animation)
self.right_box.setStartValue(right_box_width) self.right_box.setStartValue(right_box_width)
self.right_box.setEndValue(right_width) self.right_box.setEndValue(right_width)
self.right_box.setEasingCurve(QEasingCurve.InOutQuart) self.right_box.setEasingCurve(QEasingCurve.InOutQuart)
# GROUP ANIMATION # GROUP ANIMATION
self.group = QParallelAnimationGroup() self.group = QParallelAnimationGroup()
self.group.stop() self.group.stop()
self.group.addAnimation(self.left_box) self.group.addAnimation(self.left_box)
self.group.addAnimation(self.right_box) self.group.addAnimation(self.right_box)
self.group.start() self.group.start()

File diff suppressed because it is too large Load Diff

View File

@@ -1,305 +1,305 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT PACKAGES AND MODULES # IMPORT PACKAGES AND MODULES
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from gui.core.functions import Functions from gui.core.functions import Functions
# IMPORT QT CORE # IMPORT QT CORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from qt_core import * from qt_core import *
# IMPORT SETTINGS # IMPORT SETTINGS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from gui.core.json_settings import Settings from gui.core.json_settings import Settings
# IMPORT THEME COLORS # IMPORT THEME COLORS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from gui.core.json_themes import Themes from gui.core.json_themes import Themes
# IMPORT PY ONE DARK WIDGETS # IMPORT PY ONE DARK WIDGETS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from gui.widgets import * from gui.widgets import *
# IMPORT SETUP MAIN WINDOW # IMPORT SETUP MAIN WINDOW
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . setup_main_window import * from . setup_main_window import *
# IMPORT MAIN WINDOW PAGES / AND SIDE BOXES FOR APP # IMPORT MAIN WINDOW PAGES / AND SIDE BOXES FOR APP
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from gui.uis.pages.ui_main_pages import Ui_MainPages from gui.uis.pages.ui_main_pages import Ui_MainPages
# RIGHT COLUMN # RIGHT COLUMN
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from gui.uis.columns.ui_right_column import Ui_RightColumn from gui.uis.columns.ui_right_column import Ui_RightColumn
# CREDITS # CREDITS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from gui.widgets.py_credits_bar.py_credits import PyCredits from gui.widgets.py_credits_bar.py_credits import PyCredits
# PY WINDOW # PY WINDOW
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
class UI_MainWindow(object): class UI_MainWindow(object):
def setup_ui(self, parent): def setup_ui(self, parent):
if not parent.objectName(): if not parent.objectName():
parent.setObjectName("MainWindow") parent.setObjectName("MainWindow")
# LOAD SETTINGS # LOAD SETTINGS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
settings = Settings() settings = Settings()
self.settings = settings.items self.settings = settings.items
# LOAD THEME COLOR # LOAD THEME COLOR
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
themes = Themes() themes = Themes()
self.themes = themes.items self.themes = themes.items
# SET INITIAL PARAMETERS # SET INITIAL PARAMETERS
parent.resize(self.settings["startup_size"][0], self.settings["startup_size"][1]) parent.resize(self.settings["startup_size"][0], self.settings["startup_size"][1])
parent.setMinimumSize(self.settings["minimum_size"][0], self.settings["minimum_size"][1]) parent.setMinimumSize(self.settings["minimum_size"][0], self.settings["minimum_size"][1])
# SET CENTRAL WIDGET # SET CENTRAL WIDGET
# Add central widget to app # Add central widget to app
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.central_widget = QWidget() self.central_widget = QWidget()
self.central_widget.setStyleSheet(f''' self.central_widget.setStyleSheet(f'''
font: {self.settings["font"]["text_size"]}pt "{self.settings["font"]["family"]}"; font: {self.settings["font"]["text_size"]}pt "{self.settings["font"]["family"]}";
color: {self.themes["app_color"]["text_foreground"]}; color: {self.themes["app_color"]["text_foreground"]};
''') ''')
self.central_widget_layout = QVBoxLayout(self.central_widget) self.central_widget_layout = QVBoxLayout(self.central_widget)
if self.settings["custom_title_bar"]: if self.settings["custom_title_bar"]:
self.central_widget_layout.setContentsMargins(10,10,10,10) self.central_widget_layout.setContentsMargins(10,10,10,10)
else: else:
self.central_widget_layout.setContentsMargins(0,0,0,0) self.central_widget_layout.setContentsMargins(0,0,0,0)
# LOAD PY WINDOW CUSTOM WIDGET # LOAD PY WINDOW CUSTOM WIDGET
# Add inside PyWindow "layout" all Widgets # Add inside PyWindow "layout" all Widgets
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.window = PyWindow( self.window = PyWindow(
parent, parent,
bg_color = self.themes["app_color"]["bg_one"], bg_color = self.themes["app_color"]["bg_one"],
border_color = self.themes["app_color"]["bg_two"], border_color = self.themes["app_color"]["bg_two"],
text_color = self.themes["app_color"]["text_foreground"] text_color = self.themes["app_color"]["text_foreground"]
) )
# If disable custom title bar # If disable custom title bar
if not self.settings["custom_title_bar"]: if not self.settings["custom_title_bar"]:
self.window.set_stylesheet(border_radius = 0, border_size = 0) self.window.set_stylesheet(border_radius = 0, border_size = 0)
# ADD PY WINDOW TO CENTRAL WIDGET # ADD PY WINDOW TO CENTRAL WIDGET
self.central_widget_layout.addWidget(self.window) self.central_widget_layout.addWidget(self.window)
# ADD FRAME LEFT MENU # ADD FRAME LEFT MENU
# Add here the custom left menu bar # Add here the custom left menu bar
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
left_menu_margin = self.settings["left_menu_content_margins"] left_menu_margin = self.settings["left_menu_content_margins"]
left_menu_minimum = self.settings["lef_menu_size"]["minimum"] left_menu_minimum = self.settings["lef_menu_size"]["minimum"]
self.left_menu_frame = QFrame() self.left_menu_frame = QFrame()
self.left_menu_frame.setMaximumSize(left_menu_minimum + (left_menu_margin * 2), 17280) self.left_menu_frame.setMaximumSize(left_menu_minimum + (left_menu_margin * 2), 17280)
self.left_menu_frame.setMinimumSize(left_menu_minimum + (left_menu_margin * 2), 0) self.left_menu_frame.setMinimumSize(left_menu_minimum + (left_menu_margin * 2), 0)
# LEFT MENU LAYOUT # LEFT MENU LAYOUT
self.left_menu_layout = QHBoxLayout(self.left_menu_frame) self.left_menu_layout = QHBoxLayout(self.left_menu_frame)
self.left_menu_layout.setContentsMargins( self.left_menu_layout.setContentsMargins(
left_menu_margin, left_menu_margin,
left_menu_margin, left_menu_margin,
left_menu_margin, left_menu_margin,
left_menu_margin left_menu_margin
) )
# ADD LEFT MENU # ADD LEFT MENU
# Add custom left menu here # Add custom left menu here
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.left_menu = PyLeftMenu( self.left_menu = PyLeftMenu(
parent = self.left_menu_frame, parent = self.left_menu_frame,
app_parent = self.central_widget, # For tooltip parent app_parent = self.central_widget, # For tooltip parent
dark_one = self.themes["app_color"]["dark_one"], dark_one = self.themes["app_color"]["dark_one"],
dark_three = self.themes["app_color"]["dark_three"], dark_three = self.themes["app_color"]["dark_three"],
dark_four = self.themes["app_color"]["dark_four"], dark_four = self.themes["app_color"]["dark_four"],
bg_one = self.themes["app_color"]["bg_one"], bg_one = self.themes["app_color"]["bg_one"],
icon_color = self.themes["app_color"]["icon_color"], icon_color = self.themes["app_color"]["icon_color"],
icon_color_hover = self.themes["app_color"]["icon_hover"], icon_color_hover = self.themes["app_color"]["icon_hover"],
icon_color_pressed = self.themes["app_color"]["icon_pressed"], icon_color_pressed = self.themes["app_color"]["icon_pressed"],
icon_color_active = self.themes["app_color"]["icon_active"], icon_color_active = self.themes["app_color"]["icon_active"],
context_color = self.themes["app_color"]["context_color"], context_color = self.themes["app_color"]["context_color"],
text_foreground = self.themes["app_color"]["text_foreground"], text_foreground = self.themes["app_color"]["text_foreground"],
text_active = self.themes["app_color"]["text_active"] text_active = self.themes["app_color"]["text_active"]
) )
self.left_menu_layout.addWidget(self.left_menu) self.left_menu_layout.addWidget(self.left_menu)
# ADD LEFT COLUMN # ADD LEFT COLUMN
# Add here the left column with Stacked Widgets # Add here the left column with Stacked Widgets
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.left_column_frame = QFrame() self.left_column_frame = QFrame()
self.left_column_frame.setMaximumWidth(self.settings["left_column_size"]["minimum"]) self.left_column_frame.setMaximumWidth(self.settings["left_column_size"]["minimum"])
self.left_column_frame.setMinimumWidth(self.settings["left_column_size"]["minimum"]) self.left_column_frame.setMinimumWidth(self.settings["left_column_size"]["minimum"])
self.left_column_frame.setStyleSheet(f"background: {self.themes['app_color']['bg_two']}") self.left_column_frame.setStyleSheet(f"background: {self.themes['app_color']['bg_two']}")
# ADD LAYOUT TO LEFT COLUMN # ADD LAYOUT TO LEFT COLUMN
self.left_column_layout = QVBoxLayout(self.left_column_frame) self.left_column_layout = QVBoxLayout(self.left_column_frame)
self.left_column_layout.setContentsMargins(0,0,0,0) self.left_column_layout.setContentsMargins(0,0,0,0)
# ADD CUSTOM LEFT MENU WIDGET # ADD CUSTOM LEFT MENU WIDGET
self.left_column = PyLeftColumn( self.left_column = PyLeftColumn(
parent, parent,
app_parent = self.central_widget, app_parent = self.central_widget,
text_title = "Settings Left Frame", text_title = "Settings Left Frame",
text_title_size = self.settings["font"]["title_size"], text_title_size = self.settings["font"]["title_size"],
text_title_color = self.themes['app_color']['text_foreground'], text_title_color = self.themes['app_color']['text_foreground'],
icon_path = Functions.set_svg_icon("icon_settings.svg"), icon_path = Functions.set_svg_icon("icon_settings.svg"),
dark_one = self.themes['app_color']['dark_one'], dark_one = self.themes['app_color']['dark_one'],
bg_color = self.themes['app_color']['bg_three'], bg_color = self.themes['app_color']['bg_three'],
btn_color = self.themes['app_color']['bg_three'], btn_color = self.themes['app_color']['bg_three'],
btn_color_hover = self.themes['app_color']['bg_two'], btn_color_hover = self.themes['app_color']['bg_two'],
btn_color_pressed = self.themes['app_color']['bg_one'], btn_color_pressed = self.themes['app_color']['bg_one'],
icon_color = self.themes['app_color']['icon_color'], icon_color = self.themes['app_color']['icon_color'],
icon_color_hover = self.themes['app_color']['icon_hover'], icon_color_hover = self.themes['app_color']['icon_hover'],
context_color = self.themes['app_color']['context_color'], context_color = self.themes['app_color']['context_color'],
icon_color_pressed = self.themes['app_color']['icon_pressed'], icon_color_pressed = self.themes['app_color']['icon_pressed'],
icon_close_path = Functions.set_svg_icon("icon_close.svg") icon_close_path = Functions.set_svg_icon("icon_close.svg")
) )
self.left_column_layout.addWidget(self.left_column) self.left_column_layout.addWidget(self.left_column)
# ADD RIGHT WIDGETS # ADD RIGHT WIDGETS
# Add here the right widgets # Add here the right widgets
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.right_app_frame = QFrame() self.right_app_frame = QFrame()
# ADD RIGHT APP LAYOUT # ADD RIGHT APP LAYOUT
self.right_app_layout = QVBoxLayout(self.right_app_frame) self.right_app_layout = QVBoxLayout(self.right_app_frame)
self.right_app_layout.setContentsMargins(3,3,3,3) self.right_app_layout.setContentsMargins(3,3,3,3)
self.right_app_layout.setSpacing(6) self.right_app_layout.setSpacing(6)
# ADD TITLE BAR FRAME # ADD TITLE BAR FRAME
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.title_bar_frame = QFrame() self.title_bar_frame = QFrame()
self.title_bar_frame.setMinimumHeight(40) self.title_bar_frame.setMinimumHeight(40)
self.title_bar_frame.setMaximumHeight(40) self.title_bar_frame.setMaximumHeight(40)
self.title_bar_layout = QVBoxLayout(self.title_bar_frame) self.title_bar_layout = QVBoxLayout(self.title_bar_frame)
self.title_bar_layout.setContentsMargins(0,0,0,0) self.title_bar_layout.setContentsMargins(0,0,0,0)
# ADD CUSTOM TITLE BAR TO LAYOUT # ADD CUSTOM TITLE BAR TO LAYOUT
self.title_bar = PyTitleBar( self.title_bar = PyTitleBar(
parent, parent,
logo_width = 100, logo_width = 100,
app_parent = self.central_widget, app_parent = self.central_widget,
logo_image = "logo_top_100x22.svg", logo_image = "logo_top_100x22.svg",
bg_color = self.themes["app_color"]["bg_two"], bg_color = self.themes["app_color"]["bg_two"],
div_color = self.themes["app_color"]["bg_three"], div_color = self.themes["app_color"]["bg_three"],
btn_bg_color = self.themes["app_color"]["bg_two"], btn_bg_color = self.themes["app_color"]["bg_two"],
btn_bg_color_hover = self.themes["app_color"]["bg_three"], btn_bg_color_hover = self.themes["app_color"]["bg_three"],
btn_bg_color_pressed = self.themes["app_color"]["bg_one"], btn_bg_color_pressed = self.themes["app_color"]["bg_one"],
icon_color = self.themes["app_color"]["icon_color"], icon_color = self.themes["app_color"]["icon_color"],
icon_color_hover = self.themes["app_color"]["icon_hover"], icon_color_hover = self.themes["app_color"]["icon_hover"],
icon_color_pressed = self.themes["app_color"]["icon_pressed"], icon_color_pressed = self.themes["app_color"]["icon_pressed"],
icon_color_active = self.themes["app_color"]["icon_active"], icon_color_active = self.themes["app_color"]["icon_active"],
context_color = self.themes["app_color"]["context_color"], context_color = self.themes["app_color"]["context_color"],
dark_one = self.themes["app_color"]["dark_one"], dark_one = self.themes["app_color"]["dark_one"],
text_foreground = self.themes["app_color"]["text_foreground"], text_foreground = self.themes["app_color"]["text_foreground"],
radius = 8, radius = 8,
font_family = self.settings["font"]["family"], font_family = self.settings["font"]["family"],
title_size = self.settings["font"]["title_size"], title_size = self.settings["font"]["title_size"],
is_custom_title_bar = self.settings["custom_title_bar"] is_custom_title_bar = self.settings["custom_title_bar"]
) )
self.title_bar_layout.addWidget(self.title_bar) self.title_bar_layout.addWidget(self.title_bar)
# ADD CONTENT AREA # ADD CONTENT AREA
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.content_area_frame = QFrame() self.content_area_frame = QFrame()
# CREATE LAYOUT # CREATE LAYOUT
self.content_area_layout = QHBoxLayout(self.content_area_frame) self.content_area_layout = QHBoxLayout(self.content_area_frame)
self.content_area_layout.setContentsMargins(0,0,0,0) self.content_area_layout.setContentsMargins(0,0,0,0)
self.content_area_layout.setSpacing(0) self.content_area_layout.setSpacing(0)
# LEFT CONTENT # LEFT CONTENT
self.content_area_left_frame = QFrame() self.content_area_left_frame = QFrame()
# IMPORT MAIN PAGES TO CONTENT AREA # IMPORT MAIN PAGES TO CONTENT AREA
self.load_pages = Ui_MainPages() self.load_pages = Ui_MainPages()
self.load_pages.setupUi(self.content_area_left_frame) self.load_pages.setupUi(self.content_area_left_frame)
# RIGHT BAR # RIGHT BAR
self.right_column_frame = QFrame() self.right_column_frame = QFrame()
self.right_column_frame.setMinimumWidth(self.settings["right_column_size"]["minimum"]) self.right_column_frame.setMinimumWidth(self.settings["right_column_size"]["minimum"])
self.right_column_frame.setMaximumWidth(self.settings["right_column_size"]["minimum"]) self.right_column_frame.setMaximumWidth(self.settings["right_column_size"]["minimum"])
# IMPORT RIGHT COLUMN # IMPORT RIGHT COLUMN
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.content_area_right_layout = QVBoxLayout(self.right_column_frame) self.content_area_right_layout = QVBoxLayout(self.right_column_frame)
self.content_area_right_layout.setContentsMargins(5,5,5,5) self.content_area_right_layout.setContentsMargins(5,5,5,5)
self.content_area_right_layout.setSpacing(0) self.content_area_right_layout.setSpacing(0)
# RIGHT BG # RIGHT BG
self.content_area_right_bg_frame = QFrame() self.content_area_right_bg_frame = QFrame()
self.content_area_right_bg_frame.setObjectName("content_area_right_bg_frame") self.content_area_right_bg_frame.setObjectName("content_area_right_bg_frame")
self.content_area_right_bg_frame.setStyleSheet(f''' self.content_area_right_bg_frame.setStyleSheet(f'''
#content_area_right_bg_frame {{ #content_area_right_bg_frame {{
border-radius: 8px; border-radius: 8px;
background-color: {self.themes["app_color"]["bg_two"]}; background-color: {self.themes["app_color"]["bg_two"]};
}} }}
''') ''')
# ADD BG # ADD BG
self.content_area_right_layout.addWidget(self.content_area_right_bg_frame) self.content_area_right_layout.addWidget(self.content_area_right_bg_frame)
# ADD RIGHT PAGES TO RIGHT COLUMN # ADD RIGHT PAGES TO RIGHT COLUMN
self.right_column = Ui_RightColumn() self.right_column = Ui_RightColumn()
self.right_column.setupUi(self.content_area_right_bg_frame) self.right_column.setupUi(self.content_area_right_bg_frame)
# ADD TO LAYOUTS # ADD TO LAYOUTS
self.content_area_layout.addWidget(self.content_area_left_frame) self.content_area_layout.addWidget(self.content_area_left_frame)
self.content_area_layout.addWidget(self.right_column_frame) self.content_area_layout.addWidget(self.right_column_frame)
# CREDITS / BOTTOM APP FRAME # CREDITS / BOTTOM APP FRAME
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.credits_frame = QFrame() self.credits_frame = QFrame()
self.credits_frame.setMinimumHeight(26) self.credits_frame.setMinimumHeight(26)
self.credits_frame.setMaximumHeight(26) self.credits_frame.setMaximumHeight(26)
# CREATE LAYOUT # CREATE LAYOUT
self.credits_layout = QVBoxLayout(self.credits_frame) self.credits_layout = QVBoxLayout(self.credits_frame)
self.credits_layout.setContentsMargins(0,0,0,0) self.credits_layout.setContentsMargins(0,0,0,0)
# ADD CUSTOM WIDGET CREDITS # ADD CUSTOM WIDGET CREDITS
self.credits = PyCredits( self.credits = PyCredits(
bg_two = self.themes["app_color"]["bg_two"], bg_two = self.themes["app_color"]["bg_two"],
copyright = self.settings["copyright"], copyright = self.settings["copyright"],
version = self.settings["version"], version = self.settings["version"],
font_family = self.settings["font"]["family"], font_family = self.settings["font"]["family"],
text_size = self.settings["font"]["text_size"], text_size = self.settings["font"]["text_size"],
text_description_color = self.themes["app_color"]["text_description"] text_description_color = self.themes["app_color"]["text_description"]
) )
# ADD TO LAYOUT # ADD TO LAYOUT
self.credits_layout.addWidget(self.credits) self.credits_layout.addWidget(self.credits)
# ADD WIDGETS TO RIGHT LAYOUT # ADD WIDGETS TO RIGHT LAYOUT
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.right_app_layout.addWidget(self.title_bar_frame) self.right_app_layout.addWidget(self.title_bar_frame)
self.right_app_layout.addWidget(self.content_area_frame) self.right_app_layout.addWidget(self.content_area_frame)
self.right_app_layout.addWidget(self.credits_frame) self.right_app_layout.addWidget(self.credits_frame)
# ADD WIDGETS TO "PyWindow" # ADD WIDGETS TO "PyWindow"
# Add here your custom widgets or default widgets # Add here your custom widgets or default widgets
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.window.layout.addWidget(self.left_menu_frame) self.window.layout.addWidget(self.left_menu_frame)
self.window.layout.addWidget(self.left_column_frame) self.window.layout.addWidget(self.left_column_frame)
self.window.layout.addWidget(self.right_app_frame) self.window.layout.addWidget(self.right_app_frame)
# ADD CENTRAL WIDGET AND SET CONTENT MARGINS # ADD CENTRAL WIDGET AND SET CONTENT MARGINS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
parent.setCentralWidget(self.central_widget) parent.setCentralWidget(self.central_widget)

View File

@@ -1,71 +1,71 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT WIDGETS # IMPORT WIDGETS
# ADD here all custom widgets # ADD here all custom widgets
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# PY WINDOW # PY WINDOW
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_window import PyWindow from . py_window import PyWindow
# RESIZE GRIP # RESIZE GRIP
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_grips import PyGrips from . py_grips import PyGrips
# LEFT MENU # LEFT MENU
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_left_menu import PyLeftMenu from . py_left_menu import PyLeftMenu
# PY LEFT COLUMN # PY LEFT COLUMN
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_left_column import PyLeftColumn from . py_left_column import PyLeftColumn
# PY TITLE BAR # PY TITLE BAR
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_title_bar import PyTitleBar from . py_title_bar import PyTitleBar
# PY CREDITS # PY CREDITS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_credits_bar import PyCredits from . py_credits_bar import PyCredits
# PY PUSH BUTTON # PY PUSH BUTTON
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_push_button import PyPushButton from . py_push_button import PyPushButton
# PY TOGGLE # PY TOGGLE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_toggle import PyToggle from . py_toggle import PyToggle
# PY SLIDER # PY SLIDER
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_slider import PySlider from . py_slider import PySlider
# PY CIRCULAR PROGRESS # PY CIRCULAR PROGRESS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_circular_progress import PyCircularProgress from . py_circular_progress import PyCircularProgress
# PY ICON BUTTON # PY ICON BUTTON
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_icon_button import PyIconButton from . py_icon_button import PyIconButton
# PY LINE EDIT # PY LINE EDIT
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_line_edit import PyLineEdit from . py_line_edit import PyLineEdit
# PY TABLE WIDGET # PY TABLE WIDGET
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_table_widget import PyTableWidget from . py_table_widget import PyTableWidget

View File

@@ -1,19 +1,19 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# PY TITLE BAR # PY TITLE BAR
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_circular_progress import PyCircularProgress from . py_circular_progress import PyCircularProgress

View File

@@ -1,114 +1,114 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT QT CORE # IMPORT QT CORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from qt_core import * from qt_core import *
class PyCircularProgress(QWidget): class PyCircularProgress(QWidget):
def __init__( def __init__(
self, self,
value = 0, value = 0,
progress_width = 10, progress_width = 10,
is_rounded = True, is_rounded = True,
max_value = 100, max_value = 100,
progress_color = "#ff79c6", progress_color = "#ff79c6",
enable_text = True, enable_text = True,
font_family = "Segoe UI", font_family = "Segoe UI",
font_size = 12, font_size = 12,
suffix = "%", suffix = "%",
text_color = "#ff79c6", text_color = "#ff79c6",
enable_bg = True, enable_bg = True,
bg_color = "#44475a" bg_color = "#44475a"
): ):
QWidget.__init__(self) QWidget.__init__(self)
# CUSTOM PROPERTIES # CUSTOM PROPERTIES
self.value = value self.value = value
self.progress_width = progress_width self.progress_width = progress_width
self.progress_rounded_cap = is_rounded self.progress_rounded_cap = is_rounded
self.max_value = max_value self.max_value = max_value
self.progress_color = progress_color self.progress_color = progress_color
# Text # Text
self.enable_text = enable_text self.enable_text = enable_text
self.font_family = font_family self.font_family = font_family
self.font_size = font_size self.font_size = font_size
self.suffix = suffix self.suffix = suffix
self.text_color = text_color self.text_color = text_color
# BG # BG
self.enable_bg = enable_bg self.enable_bg = enable_bg
self.bg_color = bg_color self.bg_color = bg_color
# ADD DROPSHADOW # ADD DROPSHADOW
def add_shadow(self, enable): def add_shadow(self, enable):
if enable: if enable:
self.shadow = QGraphicsDropShadowEffect(self) self.shadow = QGraphicsDropShadowEffect(self)
self.shadow.setBlurRadius(15) self.shadow.setBlurRadius(15)
self.shadow.setXOffset(0) self.shadow.setXOffset(0)
self.shadow.setYOffset(0) self.shadow.setYOffset(0)
self.shadow.setColor(QColor(0, 0, 0, 80)) self.shadow.setColor(QColor(0, 0, 0, 80))
self.setGraphicsEffect(self.shadow) self.setGraphicsEffect(self.shadow)
# SET VALUE # SET VALUE
def set_value(self, value): def set_value(self, value):
self.value = value self.value = value
self.repaint() # Render progress bar after change value self.repaint() # Render progress bar after change value
# PAINT EVENT (DESIGN YOUR CIRCULAR PROGRESS HERE) # PAINT EVENT (DESIGN YOUR CIRCULAR PROGRESS HERE)
def paintEvent(self, e): def paintEvent(self, e):
# SET PROGRESS PARAMETERS # SET PROGRESS PARAMETERS
width = self.width() - self.progress_width width = self.width() - self.progress_width
height = self.height() - self.progress_width height = self.height() - self.progress_width
margin = self.progress_width / 2 margin = self.progress_width / 2
value = self.value * 360 / self.max_value value = self.value * 360 / self.max_value
# PAINTER # PAINTER
paint = QPainter() paint = QPainter()
paint.begin(self) paint.begin(self)
paint.setRenderHint(QPainter.Antialiasing) # remove pixelated edges paint.setRenderHint(QPainter.Antialiasing) # remove pixelated edges
paint.setFont(QFont(self.font_family, self.font_size)) paint.setFont(QFont(self.font_family, self.font_size))
# CREATE RECTANGLE # CREATE RECTANGLE
rect = QRect(0, 0, self.width(), self.height()) rect = QRect(0, 0, self.width(), self.height())
paint.setPen(Qt.NoPen) paint.setPen(Qt.NoPen)
# PEN # PEN
pen = QPen() pen = QPen()
pen.setWidth(self.progress_width) pen.setWidth(self.progress_width)
# Set Round Cap # Set Round Cap
if self.progress_rounded_cap: if self.progress_rounded_cap:
pen.setCapStyle(Qt.RoundCap) pen.setCapStyle(Qt.RoundCap)
# ENABLE BG # ENABLE BG
if self.enable_bg: if self.enable_bg:
pen.setColor(QColor(self.bg_color)) pen.setColor(QColor(self.bg_color))
paint.setPen(pen) paint.setPen(pen)
paint.drawArc(margin, margin, width, height, 0, 360 * 16) paint.drawArc(margin, margin, width, height, 0, 360 * 16)
# CREATE ARC / CIRCULAR PROGRESS # CREATE ARC / CIRCULAR PROGRESS
pen.setColor(QColor(self.progress_color)) pen.setColor(QColor(self.progress_color))
paint.setPen(pen) paint.setPen(pen)
paint.drawArc(margin, margin, width, height, -90 * 16, -value * 16) paint.drawArc(margin, margin, width, height, -90 * 16, -value * 16)
# CREATE TEXT # CREATE TEXT
if self.enable_text: if self.enable_text:
pen.setColor(QColor(self.text_color)) pen.setColor(QColor(self.text_color))
paint.setPen(pen) paint.setPen(pen)
paint.drawText(rect, Qt.AlignCenter, f"{self.value}{self.suffix}") paint.drawText(rect, Qt.AlignCenter, f"{self.value}{self.suffix}")
# END # END
paint.end() paint.end()

View File

@@ -1,19 +1,19 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# PY CREDITS # PY CREDITS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_credits import PyCredits from . py_credits import PyCredits

View File

@@ -1,95 +1,95 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT QT CORE # IMPORT QT CORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from qt_core import * from qt_core import *
# PY CREDITS BAR AND VERSION # PY CREDITS BAR AND VERSION
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
class PyCredits(QWidget): class PyCredits(QWidget):
def __init__( def __init__(
self, self,
copyright, copyright,
version, version,
bg_two, bg_two,
font_family, font_family,
text_size, text_size,
text_description_color, text_description_color,
radius = 8, radius = 8,
padding = 10 padding = 10
): ):
super().__init__() super().__init__()
# PROPERTIES # PROPERTIES
self._copyright = copyright self._copyright = copyright
self._version = version self._version = version
self._bg_two = bg_two self._bg_two = bg_two
self._font_family = font_family self._font_family = font_family
self._text_size = text_size self._text_size = text_size
self._text_description_color = text_description_color self._text_description_color = text_description_color
self._radius = radius self._radius = radius
self._padding = padding self._padding = padding
# SETUP UI # SETUP UI
self.setup_ui() self.setup_ui()
def setup_ui(self): def setup_ui(self):
# ADD LAYOUT # ADD LAYOUT
self.widget_layout = QHBoxLayout(self) self.widget_layout = QHBoxLayout(self)
self.widget_layout.setContentsMargins(0,0,0,0) self.widget_layout.setContentsMargins(0,0,0,0)
# BG STYLE # BG STYLE
style = f""" style = f"""
#bg_frame {{ #bg_frame {{
border-radius: {self._radius}px; border-radius: {self._radius}px;
background-color: {self._bg_two}; background-color: {self._bg_two};
}} }}
.QLabel {{ .QLabel {{
font: {self._text_size}pt "{self._font_family}"; font: {self._text_size}pt "{self._font_family}";
color: {self._text_description_color}; color: {self._text_description_color};
padding-left: {self._padding}px; padding-left: {self._padding}px;
padding-right: {self._padding}px; padding-right: {self._padding}px;
}} }}
""" """
# BG FRAME # BG FRAME
self.bg_frame = QFrame() self.bg_frame = QFrame()
self.bg_frame.setObjectName("bg_frame") self.bg_frame.setObjectName("bg_frame")
self.bg_frame.setStyleSheet(style) self.bg_frame.setStyleSheet(style)
# ADD TO LAYOUT # ADD TO LAYOUT
self.widget_layout.addWidget(self.bg_frame) self.widget_layout.addWidget(self.bg_frame)
# ADD BG LAYOUT # ADD BG LAYOUT
self.bg_layout = QHBoxLayout(self.bg_frame) self.bg_layout = QHBoxLayout(self.bg_frame)
self.bg_layout.setContentsMargins(0,0,0,0) self.bg_layout.setContentsMargins(0,0,0,0)
# ADD COPYRIGHT TEXT # ADD COPYRIGHT TEXT
self.copyright_label = QLabel(self._copyright) self.copyright_label = QLabel(self._copyright)
self.copyright_label.setAlignment(Qt.AlignVCenter) self.copyright_label.setAlignment(Qt.AlignVCenter)
# ADD VERSION TEXT # ADD VERSION TEXT
self.version_label = QLabel(self._version) self.version_label = QLabel(self._version)
self.version_label.setAlignment(Qt.AlignVCenter) self.version_label.setAlignment(Qt.AlignVCenter)
# SEPARATOR # SEPARATOR
self.separator = QSpacerItem(20, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.separator = QSpacerItem(20, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
# ADD TO LAYOUT # ADD TO LAYOUT
self.bg_layout.addWidget(self.copyright_label) self.bg_layout.addWidget(self.copyright_label)
self.bg_layout.addSpacerItem(self.separator) self.bg_layout.addSpacerItem(self.separator)
self.bg_layout.addWidget(self.version_label) self.bg_layout.addWidget(self.version_label)

View File

@@ -1,17 +1,17 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_grips import PyGrips from . py_grips import PyGrips

View File

@@ -1,249 +1,249 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT PACKAGES AND MODULES # IMPORT PACKAGES AND MODULES
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
import sys import sys
# IMPORT QT CORE # IMPORT QT CORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from qt_core import * from qt_core import *
# PY GRIPS # PY GRIPS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
class PyGrips(QWidget): class PyGrips(QWidget):
def __init__(self, parent, position, disable_color = False): def __init__(self, parent, position, disable_color = False):
# SETUP UI # SETUP UI
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
super().__init__() super().__init__()
self.parent = parent self.parent = parent
self.setParent(parent) self.setParent(parent)
self.wi = Widgets() self.wi = Widgets()
# SHOW TOP LEFT GRIP # SHOW TOP LEFT GRIP
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
if position == "top_left": if position == "top_left":
self.wi.top_left(self) self.wi.top_left(self)
grip = QSizeGrip(self.wi.top_left_grip) grip = QSizeGrip(self.wi.top_left_grip)
grip.setFixedSize(self.wi.top_left_grip.size()) grip.setFixedSize(self.wi.top_left_grip.size())
self.setGeometry(5, 5, 15, 15) self.setGeometry(5, 5, 15, 15)
# ENABLE COLOR # ENABLE COLOR
if disable_color: if disable_color:
self.wi.top_left_grip.setStyleSheet("background: transparent") self.wi.top_left_grip.setStyleSheet("background: transparent")
# SHOW TOP RIGHT GRIP # SHOW TOP RIGHT GRIP
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
if position == "top_right": if position == "top_right":
self.wi.top_right(self) self.wi.top_right(self)
grip = QSizeGrip(self.wi.top_right_grip) grip = QSizeGrip(self.wi.top_right_grip)
grip.setFixedSize(self.wi.top_right_grip.size()) grip.setFixedSize(self.wi.top_right_grip.size())
self.setGeometry(self.parent.width() - 20, 5, 15, 15) self.setGeometry(self.parent.width() - 20, 5, 15, 15)
# ENABLE COLOR # ENABLE COLOR
if disable_color: if disable_color:
self.wi.top_right_grip.setStyleSheet("background: transparent") self.wi.top_right_grip.setStyleSheet("background: transparent")
# SHOW BOTTOM LEFT GRIP # SHOW BOTTOM LEFT GRIP
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
if position == "bottom_left": if position == "bottom_left":
self.wi.bottom_left(self) self.wi.bottom_left(self)
grip = QSizeGrip(self.wi.bottom_left_grip) grip = QSizeGrip(self.wi.bottom_left_grip)
grip.setFixedSize(self.wi.bottom_left_grip.size()) grip.setFixedSize(self.wi.bottom_left_grip.size())
self.setGeometry(5, self.parent.height() - 20, 15, 15) self.setGeometry(5, self.parent.height() - 20, 15, 15)
# ENABLE COLOR # ENABLE COLOR
if disable_color: if disable_color:
self.wi.bottom_left_grip.setStyleSheet("background: transparent") self.wi.bottom_left_grip.setStyleSheet("background: transparent")
# SHOW BOTTOM RIGHT GRIP # SHOW BOTTOM RIGHT GRIP
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
if position == "bottom_right": if position == "bottom_right":
self.wi.bottom_right(self) self.wi.bottom_right(self)
grip = QSizeGrip(self.wi.bottom_right_grip) grip = QSizeGrip(self.wi.bottom_right_grip)
grip.setFixedSize(self.wi.bottom_right_grip.size()) grip.setFixedSize(self.wi.bottom_right_grip.size())
self.setGeometry(self.parent.width() - 20, self.parent.height() - 20, 15, 15) self.setGeometry(self.parent.width() - 20, self.parent.height() - 20, 15, 15)
# ENABLE COLOR # ENABLE COLOR
if disable_color: if disable_color:
self.wi.bottom_right_grip.setStyleSheet("background: transparent") self.wi.bottom_right_grip.setStyleSheet("background: transparent")
# SHOW TOP GRIP # SHOW TOP GRIP
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
if position == "top": if position == "top":
self.wi.top(self) self.wi.top(self)
self.setGeometry(0, 5, self.parent.width(), 10) self.setGeometry(0, 5, self.parent.width(), 10)
self.setMaximumHeight(10) self.setMaximumHeight(10)
# RESIZE TOP # RESIZE TOP
def resize_top(event): def resize_top(event):
delta = event.pos() delta = event.pos()
height = max(self.parent.minimumHeight(), self.parent.height() - delta.y()) height = max(self.parent.minimumHeight(), self.parent.height() - delta.y())
geo = self.parent.geometry() geo = self.parent.geometry()
geo.setTop(geo.bottom() - height) geo.setTop(geo.bottom() - height)
self.parent.setGeometry(geo) self.parent.setGeometry(geo)
event.accept() event.accept()
self.wi.top_grip.mouseMoveEvent = resize_top self.wi.top_grip.mouseMoveEvent = resize_top
# ENABLE COLOR # ENABLE COLOR
if disable_color: if disable_color:
self.wi.top_grip.setStyleSheet("background: transparent") self.wi.top_grip.setStyleSheet("background: transparent")
# SHOW BOTTOM GRIP # SHOW BOTTOM GRIP
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
elif position == "bottom": elif position == "bottom":
self.wi.bottom(self) self.wi.bottom(self)
self.setGeometry(0, self.parent.height() - 10, self.parent.width(), 10) self.setGeometry(0, self.parent.height() - 10, self.parent.width(), 10)
self.setMaximumHeight(10) self.setMaximumHeight(10)
# RESIZE BOTTOM # RESIZE BOTTOM
def resize_bottom(event): def resize_bottom(event):
delta = event.pos() delta = event.pos()
height = max(self.parent.minimumHeight(), self.parent.height() + delta.y()) height = max(self.parent.minimumHeight(), self.parent.height() + delta.y())
self.parent.resize(self.parent.width(), height) self.parent.resize(self.parent.width(), height)
event.accept() event.accept()
self.wi.bottom_grip.mouseMoveEvent = resize_bottom self.wi.bottom_grip.mouseMoveEvent = resize_bottom
# ENABLE COLOR # ENABLE COLOR
if disable_color: if disable_color:
self.wi.bottom_grip.setStyleSheet("background: transparent") self.wi.bottom_grip.setStyleSheet("background: transparent")
# SHOW LEFT GRIP # SHOW LEFT GRIP
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
elif position == "left": elif position == "left":
self.wi.left(self) self.wi.left(self)
self.setGeometry(0, 10, 10, self.parent.height()) self.setGeometry(0, 10, 10, self.parent.height())
self.setMaximumWidth(10) self.setMaximumWidth(10)
# RESIZE LEFT # RESIZE LEFT
def resize_left(event): def resize_left(event):
delta = event.pos() delta = event.pos()
width = max(self.parent.minimumWidth(), self.parent.width() - delta.x()) width = max(self.parent.minimumWidth(), self.parent.width() - delta.x())
geo = self.parent.geometry() geo = self.parent.geometry()
geo.setLeft(geo.right() - width) geo.setLeft(geo.right() - width)
self.parent.setGeometry(geo) self.parent.setGeometry(geo)
event.accept() event.accept()
self.wi.left_grip.mouseMoveEvent = resize_left self.wi.left_grip.mouseMoveEvent = resize_left
# ENABLE COLOR # ENABLE COLOR
if disable_color: if disable_color:
self.wi.left_grip.setStyleSheet("background: transparent") self.wi.left_grip.setStyleSheet("background: transparent")
# RESIZE RIGHT # RESIZE RIGHT
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
elif position == "right": elif position == "right":
self.wi.right(self) self.wi.right(self)
self.setGeometry(self.parent.width() - 10, 10, 10, self.parent.height()) self.setGeometry(self.parent.width() - 10, 10, 10, self.parent.height())
self.setMaximumWidth(10) self.setMaximumWidth(10)
def resize_right(event): def resize_right(event):
delta = event.pos() delta = event.pos()
width = max(self.parent.minimumWidth(), self.parent.width() + delta.x()) width = max(self.parent.minimumWidth(), self.parent.width() + delta.x())
self.parent.resize(width, self.parent.height()) self.parent.resize(width, self.parent.height())
event.accept() event.accept()
self.wi.right_grip.mouseMoveEvent = resize_right self.wi.right_grip.mouseMoveEvent = resize_right
# ENABLE COLOR # ENABLE COLOR
if disable_color: if disable_color:
self.wi.right_grip.setStyleSheet("background: transparent") self.wi.right_grip.setStyleSheet("background: transparent")
# MOUSE RELEASE # MOUSE RELEASE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def mouseReleaseEvent(self, event): def mouseReleaseEvent(self, event):
self.mousePos = None self.mousePos = None
# RESIZE EVENT # RESIZE EVENT
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def resizeEvent(self, event): def resizeEvent(self, event):
if hasattr(self.wi, 'top_grip'): if hasattr(self.wi, 'top_grip'):
self.wi.top_grip.setGeometry(0, 0, self.width(), 10) self.wi.top_grip.setGeometry(0, 0, self.width(), 10)
elif hasattr(self.wi, 'bottom_grip'): elif hasattr(self.wi, 'bottom_grip'):
self.wi.bottom_grip.setGeometry(0, 0, self.width(), 10) self.wi.bottom_grip.setGeometry(0, 0, self.width(), 10)
elif hasattr(self.wi, 'left_grip'): elif hasattr(self.wi, 'left_grip'):
self.wi.left_grip.setGeometry(0, 0, 10, self.height() - 20) self.wi.left_grip.setGeometry(0, 0, 10, self.height() - 20)
elif hasattr(self.wi, 'right_grip'): elif hasattr(self.wi, 'right_grip'):
self.wi.right_grip.setGeometry(0, 0, 10, self.height() - 20) self.wi.right_grip.setGeometry(0, 0, 10, self.height() - 20)
elif hasattr(self.wi, 'top_right_grip'): elif hasattr(self.wi, 'top_right_grip'):
self.wi.top_right_grip.setGeometry(self.width() - 15, 0, 15, 15) self.wi.top_right_grip.setGeometry(self.width() - 15, 0, 15, 15)
elif hasattr(self.wi, 'bottom_left_grip'): elif hasattr(self.wi, 'bottom_left_grip'):
self.wi.bottom_left_grip.setGeometry(0, self.height() - 15, 15, 15) self.wi.bottom_left_grip.setGeometry(0, self.height() - 15, 15, 15)
elif hasattr(self.wi, 'bottom_right_grip'): elif hasattr(self.wi, 'bottom_right_grip'):
self.wi.bottom_right_grip.setGeometry(self.width() - 15, self.height() - 15, 15, 15) self.wi.bottom_right_grip.setGeometry(self.width() - 15, self.height() - 15, 15, 15)
# GRIP WIDGTES # GRIP WIDGTES
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
class Widgets(object): class Widgets(object):
def top_left(self, form): def top_left(self, form):
self.top_left_grip = QFrame(form) self.top_left_grip = QFrame(form)
self.top_left_grip.setObjectName(u"top_left_grip") self.top_left_grip.setObjectName(u"top_left_grip")
self.top_left_grip.setFixedSize(15, 15) self.top_left_grip.setFixedSize(15, 15)
self.top_left_grip.setStyleSheet(u"background-color: #333; border: 2px solid #55FF00;") self.top_left_grip.setStyleSheet(u"background-color: #333; border: 2px solid #55FF00;")
def top_right(self, form): def top_right(self, form):
self.top_right_grip = QFrame(form) self.top_right_grip = QFrame(form)
self.top_right_grip.setObjectName(u"top_right_grip") self.top_right_grip.setObjectName(u"top_right_grip")
self.top_right_grip.setFixedSize(15, 15) self.top_right_grip.setFixedSize(15, 15)
self.top_right_grip.setStyleSheet(u"background-color: #333; border: 2px solid #55FF00;") self.top_right_grip.setStyleSheet(u"background-color: #333; border: 2px solid #55FF00;")
def bottom_left(self, form): def bottom_left(self, form):
self.bottom_left_grip = QFrame(form) self.bottom_left_grip = QFrame(form)
self.bottom_left_grip.setObjectName(u"bottom_left_grip") self.bottom_left_grip.setObjectName(u"bottom_left_grip")
self.bottom_left_grip.setFixedSize(15, 15) self.bottom_left_grip.setFixedSize(15, 15)
self.bottom_left_grip.setStyleSheet(u"background-color: #333; border: 2px solid #55FF00;") self.bottom_left_grip.setStyleSheet(u"background-color: #333; border: 2px solid #55FF00;")
def bottom_right(self, form): def bottom_right(self, form):
self.bottom_right_grip = QFrame(form) self.bottom_right_grip = QFrame(form)
self.bottom_right_grip.setObjectName(u"bottom_right_grip") self.bottom_right_grip.setObjectName(u"bottom_right_grip")
self.bottom_right_grip.setFixedSize(15, 15) self.bottom_right_grip.setFixedSize(15, 15)
self.bottom_right_grip.setStyleSheet(u"background-color: #333; border: 2px solid #55FF00;") self.bottom_right_grip.setStyleSheet(u"background-color: #333; border: 2px solid #55FF00;")
def top(self, form): def top(self, form):
self.top_grip = QFrame(form) self.top_grip = QFrame(form)
self.top_grip.setObjectName(u"top_grip") self.top_grip.setObjectName(u"top_grip")
self.top_grip.setGeometry(QRect(0, 0, 500, 10)) self.top_grip.setGeometry(QRect(0, 0, 500, 10))
self.top_grip.setStyleSheet(u"background-color: rgb(85, 255, 255);") self.top_grip.setStyleSheet(u"background-color: rgb(85, 255, 255);")
self.top_grip.setCursor(QCursor(Qt.SizeVerCursor)) self.top_grip.setCursor(QCursor(Qt.SizeVerCursor))
def bottom(self, form): def bottom(self, form):
self.bottom_grip = QFrame(form) self.bottom_grip = QFrame(form)
self.bottom_grip.setObjectName(u"bottom_grip") self.bottom_grip.setObjectName(u"bottom_grip")
self.bottom_grip.setGeometry(QRect(0, 0, 500, 10)) self.bottom_grip.setGeometry(QRect(0, 0, 500, 10))
self.bottom_grip.setStyleSheet(u"background-color: rgb(85, 170, 0);") self.bottom_grip.setStyleSheet(u"background-color: rgb(85, 170, 0);")
self.bottom_grip.setCursor(QCursor(Qt.SizeVerCursor)) self.bottom_grip.setCursor(QCursor(Qt.SizeVerCursor))
def left(self, form): def left(self, form):
self.left_grip = QFrame(form) self.left_grip = QFrame(form)
self.left_grip.setObjectName(u"left") self.left_grip.setObjectName(u"left")
self.left_grip.setGeometry(QRect(0, 10, 10, 480)) self.left_grip.setGeometry(QRect(0, 10, 10, 480))
self.left_grip.setMinimumSize(QSize(10, 0)) self.left_grip.setMinimumSize(QSize(10, 0))
self.left_grip.setCursor(QCursor(Qt.SizeHorCursor)) self.left_grip.setCursor(QCursor(Qt.SizeHorCursor))
self.left_grip.setStyleSheet(u"background-color: rgb(255, 121, 198);") self.left_grip.setStyleSheet(u"background-color: rgb(255, 121, 198);")
def right(self, form): def right(self, form):
self.right_grip = QFrame(form) self.right_grip = QFrame(form)
self.right_grip.setObjectName(u"right") self.right_grip.setObjectName(u"right")
self.right_grip.setGeometry(QRect(0, 0, 10, 500)) self.right_grip.setGeometry(QRect(0, 0, 10, 500))
self.right_grip.setMinimumSize(QSize(10, 0)) self.right_grip.setMinimumSize(QSize(10, 0))
self.right_grip.setCursor(QCursor(Qt.SizeHorCursor)) self.right_grip.setCursor(QCursor(Qt.SizeHorCursor))
self.right_grip.setStyleSheet(u"background-color: rgb(255, 0, 127);") self.right_grip.setStyleSheet(u"background-color: rgb(255, 0, 127);")

View File

@@ -1,19 +1,19 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# PY ICON BUTTON # PY ICON BUTTON
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_icon_button import PyIconButton from . py_icon_button import PyIconButton

View File

@@ -1,268 +1,268 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT QT CORE # IMPORT QT CORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from qt_core import * from qt_core import *
# PY TITLE BUTTON # PY TITLE BUTTON
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
class PyIconButton(QPushButton): class PyIconButton(QPushButton):
def __init__( def __init__(
self, self,
icon_path = None, icon_path = None,
parent = None, parent = None,
app_parent = None, app_parent = None,
tooltip_text = "", tooltip_text = "",
btn_id = None, btn_id = None,
width = 30, width = 30,
height = 30, height = 30,
radius = 8, radius = 8,
bg_color = "#343b48", bg_color = "#343b48",
bg_color_hover = "#3c4454", bg_color_hover = "#3c4454",
bg_color_pressed = "#2c313c", bg_color_pressed = "#2c313c",
icon_color = "#c3ccdf", icon_color = "#c3ccdf",
icon_color_hover = "#dce1ec", icon_color_hover = "#dce1ec",
icon_color_pressed = "#edf0f5", icon_color_pressed = "#edf0f5",
icon_color_active = "#f5f6f9", icon_color_active = "#f5f6f9",
dark_one = "#1b1e23", dark_one = "#1b1e23",
text_foreground = "#8a95aa", text_foreground = "#8a95aa",
context_color = "#568af2", context_color = "#568af2",
top_margin = 40, top_margin = 40,
is_active = False is_active = False
): ):
super().__init__() super().__init__()
# SET DEFAULT PARAMETERS # SET DEFAULT PARAMETERS
self.setFixedSize(width, height) self.setFixedSize(width, height)
self.setCursor(Qt.PointingHandCursor) self.setCursor(Qt.PointingHandCursor)
self.setObjectName(btn_id) self.setObjectName(btn_id)
# PROPERTIES # PROPERTIES
self._bg_color = bg_color self._bg_color = bg_color
self._bg_color_hover = bg_color_hover self._bg_color_hover = bg_color_hover
self._bg_color_pressed = bg_color_pressed self._bg_color_pressed = bg_color_pressed
self._icon_color = icon_color self._icon_color = icon_color
self._icon_color_hover = icon_color_hover self._icon_color_hover = icon_color_hover
self._icon_color_pressed = icon_color_pressed self._icon_color_pressed = icon_color_pressed
self._icon_color_active = icon_color_active self._icon_color_active = icon_color_active
self._context_color = context_color self._context_color = context_color
self._top_margin = top_margin self._top_margin = top_margin
self._is_active = is_active self._is_active = is_active
# Set Parameters # Set Parameters
self._set_bg_color = bg_color self._set_bg_color = bg_color
self._set_icon_path = icon_path self._set_icon_path = icon_path
self._set_icon_color = icon_color self._set_icon_color = icon_color
self._set_border_radius = radius self._set_border_radius = radius
# Parent # Parent
self._parent = parent self._parent = parent
self._app_parent = app_parent self._app_parent = app_parent
# TOOLTIP # TOOLTIP
self._tooltip_text = tooltip_text self._tooltip_text = tooltip_text
self._tooltip = _ToolTip( self._tooltip = _ToolTip(
app_parent, app_parent,
tooltip_text, tooltip_text,
dark_one, dark_one,
text_foreground text_foreground
) )
self._tooltip.hide() self._tooltip.hide()
# SET ACTIVE MENU # SET ACTIVE MENU
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def set_active(self, is_active): def set_active(self, is_active):
self._is_active = is_active self._is_active = is_active
self.repaint() self.repaint()
# RETURN IF IS ACTIVE MENU # RETURN IF IS ACTIVE MENU
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def is_active(self): def is_active(self):
return self._is_active return self._is_active
# PAINT EVENT # PAINT EVENT
# painting the button and the icon # painting the button and the icon
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def paintEvent(self, event): def paintEvent(self, event):
# PAINTER # PAINTER
paint = QPainter() paint = QPainter()
paint.begin(self) paint.begin(self)
paint.setRenderHint(QPainter.RenderHint.Antialiasing) paint.setRenderHint(QPainter.RenderHint.Antialiasing)
if self._is_active: if self._is_active:
# BRUSH # BRUSH
brush = QBrush(QColor(self._context_color)) brush = QBrush(QColor(self._context_color))
else: else:
# BRUSH # BRUSH
brush = QBrush(QColor(self._set_bg_color)) brush = QBrush(QColor(self._set_bg_color))
# CREATE RECTANGLE # CREATE RECTANGLE
rect = QRect(0, 0, self.width(), self.height()) rect = QRect(0, 0, self.width(), self.height())
paint.setPen(Qt.NoPen) paint.setPen(Qt.NoPen)
paint.setBrush(brush) paint.setBrush(brush)
paint.drawRoundedRect( paint.drawRoundedRect(
rect, rect,
self._set_border_radius, self._set_border_radius,
self._set_border_radius self._set_border_radius
) )
# DRAW ICONS # DRAW ICONS
self.icon_paint(paint, self._set_icon_path, rect) self.icon_paint(paint, self._set_icon_path, rect)
# END PAINTER # END PAINTER
paint.end() paint.end()
# CHANGE STYLES # CHANGE STYLES
# Functions with custom styles # Functions with custom styles
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def change_style(self, event): def change_style(self, event):
if event == QEvent.Enter: if event == QEvent.Enter:
self._set_bg_color = self._bg_color_hover self._set_bg_color = self._bg_color_hover
self._set_icon_color = self._icon_color_hover self._set_icon_color = self._icon_color_hover
self.repaint() self.repaint()
elif event == QEvent.Leave: elif event == QEvent.Leave:
self._set_bg_color = self._bg_color self._set_bg_color = self._bg_color
self._set_icon_color = self._icon_color self._set_icon_color = self._icon_color
self.repaint() self.repaint()
elif event == QEvent.MouseButtonPress: elif event == QEvent.MouseButtonPress:
self._set_bg_color = self._bg_color_pressed self._set_bg_color = self._bg_color_pressed
self._set_icon_color = self._icon_color_pressed self._set_icon_color = self._icon_color_pressed
self.repaint() self.repaint()
elif event == QEvent.MouseButtonRelease: elif event == QEvent.MouseButtonRelease:
self._set_bg_color = self._bg_color_hover self._set_bg_color = self._bg_color_hover
self._set_icon_color = self._icon_color_hover self._set_icon_color = self._icon_color_hover
self.repaint() self.repaint()
# MOUSE OVER # MOUSE OVER
# Event triggered when the mouse is over the BTN # Event triggered when the mouse is over the BTN
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def enterEvent(self, event): def enterEvent(self, event):
self.change_style(QEvent.Enter) self.change_style(QEvent.Enter)
self.move_tooltip() self.move_tooltip()
self._tooltip.show() self._tooltip.show()
# MOUSE LEAVE # MOUSE LEAVE
# Event fired when the mouse leaves the BTN # Event fired when the mouse leaves the BTN
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def leaveEvent(self, event): def leaveEvent(self, event):
self.change_style(QEvent.Leave) self.change_style(QEvent.Leave)
self.move_tooltip() self.move_tooltip()
self._tooltip.hide() self._tooltip.hide()
# MOUSE PRESS # MOUSE PRESS
# Event triggered when the left button is pressed # Event triggered when the left button is pressed
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def mousePressEvent(self, event): def mousePressEvent(self, event):
if event.button() == Qt.LeftButton: if event.button() == Qt.LeftButton:
self.change_style(QEvent.MouseButtonPress) self.change_style(QEvent.MouseButtonPress)
# SET FOCUS # SET FOCUS
self.setFocus() self.setFocus()
# EMIT SIGNAL # EMIT SIGNAL
return self.clicked.emit() return self.clicked.emit()
# MOUSE RELEASED # MOUSE RELEASED
# Event triggered after the mouse button is released # Event triggered after the mouse button is released
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def mouseReleaseEvent(self, event): def mouseReleaseEvent(self, event):
if event.button() == Qt.LeftButton: if event.button() == Qt.LeftButton:
self.change_style(QEvent.MouseButtonRelease) self.change_style(QEvent.MouseButtonRelease)
# EMIT SIGNAL # EMIT SIGNAL
return self.released.emit() return self.released.emit()
# DRAW ICON WITH COLORS # DRAW ICON WITH COLORS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def icon_paint(self, qp, image, rect): def icon_paint(self, qp, image, rect):
icon = QPixmap(image) icon = QPixmap(image)
painter = QPainter(icon) painter = QPainter(icon)
painter.setCompositionMode(QPainter.CompositionMode_SourceIn) painter.setCompositionMode(QPainter.CompositionMode_SourceIn)
if self._is_active: if self._is_active:
painter.fillRect(icon.rect(), self._icon_color_active) painter.fillRect(icon.rect(), self._icon_color_active)
else: else:
painter.fillRect(icon.rect(), self._set_icon_color) painter.fillRect(icon.rect(), self._set_icon_color)
qp.drawPixmap( qp.drawPixmap(
(rect.width() - icon.width()) / 2, (rect.width() - icon.width()) / 2,
(rect.height() - icon.height()) / 2, (rect.height() - icon.height()) / 2,
icon icon
) )
painter.end() painter.end()
# SET ICON # SET ICON
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def set_icon(self, icon_path): def set_icon(self, icon_path):
self._set_icon_path = icon_path self._set_icon_path = icon_path
self.repaint() self.repaint()
# MOVE TOOLTIP # MOVE TOOLTIP
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def move_tooltip(self): def move_tooltip(self):
# GET MAIN WINDOW PARENT # GET MAIN WINDOW PARENT
gp = self.mapToGlobal(QPoint(0, 0)) gp = self.mapToGlobal(QPoint(0, 0))
# SET WIDGET TO GET POSTION # SET WIDGET TO GET POSTION
# Return absolute position of widget inside app # Return absolute position of widget inside app
pos = self._parent.mapFromGlobal(gp) pos = self._parent.mapFromGlobal(gp)
# FORMAT POSITION # FORMAT POSITION
# Adjust tooltip position with offset # Adjust tooltip position with offset
pos_x = (pos.x() - (self._tooltip.width() // 2)) + (self.width() // 2) pos_x = (pos.x() - (self._tooltip.width() // 2)) + (self.width() // 2)
pos_y = pos.y() - self._top_margin pos_y = pos.y() - self._top_margin
# SET POSITION TO WIDGET # SET POSITION TO WIDGET
# Move tooltip position # Move tooltip position
self._tooltip.move(pos_x, pos_y) self._tooltip.move(pos_x, pos_y)
# TOOLTIP # TOOLTIP
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
class _ToolTip(QLabel): class _ToolTip(QLabel):
# TOOLTIP / LABEL StyleSheet # TOOLTIP / LABEL StyleSheet
style_tooltip = """ style_tooltip = """
QLabel {{ QLabel {{
background-color: {_dark_one}; background-color: {_dark_one};
color: {_text_foreground}; color: {_text_foreground};
padding-left: 10px; padding-left: 10px;
padding-right: 10px; padding-right: 10px;
border-radius: 17px; border-radius: 17px;
border: 0px solid transparent; border: 0px solid transparent;
font: 800 9pt "Segoe UI"; font: 800 9pt "Segoe UI";
}} }}
""" """
def __init__( def __init__(
self, self,
parent, parent,
tooltip, tooltip,
dark_one, dark_one,
text_foreground text_foreground
): ):
QLabel.__init__(self) QLabel.__init__(self)
# LABEL SETUP # LABEL SETUP
style = self.style_tooltip.format( style = self.style_tooltip.format(
_dark_one = dark_one, _dark_one = dark_one,
_text_foreground = text_foreground _text_foreground = text_foreground
) )
self.setObjectName(u"label_tooltip") self.setObjectName(u"label_tooltip")
self.setStyleSheet(style) self.setStyleSheet(style)
self.setMinimumHeight(34) self.setMinimumHeight(34)
self.setParent(parent) self.setParent(parent)
self.setText(tooltip) self.setText(tooltip)
self.adjustSize() self.adjustSize()
# SET DROP SHADOW # SET DROP SHADOW
self.shadow = QGraphicsDropShadowEffect(self) self.shadow = QGraphicsDropShadowEffect(self)
self.shadow.setBlurRadius(30) self.shadow.setBlurRadius(30)
self.shadow.setXOffset(0) self.shadow.setXOffset(0)
self.shadow.setYOffset(0) self.shadow.setYOffset(0)
self.shadow.setColor(QColor(0, 0, 0, 80)) self.shadow.setColor(QColor(0, 0, 0, 80))
self.setGraphicsEffect(self.shadow) self.setGraphicsEffect(self.shadow)

View File

@@ -1,20 +1,20 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# PY LEFT COLUMN # PY LEFT COLUMN
# Left column with custom widgets # Left column with custom widgets
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_left_column import PyLeftColumn from . py_left_column import PyLeftColumn

View File

@@ -1,70 +1,70 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT QT CORE # IMPORT QT CORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from qt_core import * from qt_core import *
# PY ICON WITH CUSTOM COLORS # PY ICON WITH CUSTOM COLORS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
class PyIcon(QWidget): class PyIcon(QWidget):
def __init__( def __init__(
self, self,
icon_path, icon_path,
icon_color icon_color
): ):
super().__init__() super().__init__()
# PROPERTIES # PROPERTIES
self._icon_path = icon_path self._icon_path = icon_path
self._icon_color = icon_color self._icon_color = icon_color
# SETUP UI # SETUP UI
self.setup_ui() self.setup_ui()
def setup_ui(self): def setup_ui(self):
# LAYOUT # LAYOUT
self.layout = QVBoxLayout(self) self.layout = QVBoxLayout(self)
self.layout.setContentsMargins(0,0,0,0) self.layout.setContentsMargins(0,0,0,0)
# LABEL # LABEL
self.icon = QLabel() self.icon = QLabel()
self.icon.setAlignment(Qt.AlignCenter) self.icon.setAlignment(Qt.AlignCenter)
# PAINTER # PAINTER
self.set_icon(self._icon_path, self._icon_color) self.set_icon(self._icon_path, self._icon_color)
# ADD TO LAYOUT # ADD TO LAYOUT
self.layout.addWidget(self.icon) self.layout.addWidget(self.icon)
def set_icon(self, icon_path, icon_color = None): def set_icon(self, icon_path, icon_color = None):
# GET COLOR # GET COLOR
color = "" color = ""
if icon_color != None: if icon_color != None:
color = icon_color color = icon_color
else: else:
color = self._icon_color color = self._icon_color
# PAINTER / PIXMAP # PAINTER / PIXMAP
icon = QPixmap(icon_path) icon = QPixmap(icon_path)
painter = QPainter(icon) painter = QPainter(icon)
painter.setCompositionMode(QPainter.CompositionMode_SourceIn) painter.setCompositionMode(QPainter.CompositionMode_SourceIn)
painter.fillRect(icon.rect(), color) painter.fillRect(icon.rect(), color)
painter.end() painter.end()
# SET PIXMAP # SET PIXMAP
self.icon.setPixmap(icon) self.icon.setPixmap(icon)

View File

@@ -1,271 +1,271 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT QT CORE # IMPORT QT CORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from qt_core import * from qt_core import *
# PY TITLE BUTTON # PY TITLE BUTTON
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
class PyLeftButton(QPushButton): class PyLeftButton(QPushButton):
def __init__( def __init__(
self, self,
parent, parent,
app_parent = None, app_parent = None,
tooltip_text = "", tooltip_text = "",
btn_id = None, btn_id = None,
width = 30, width = 30,
height = 30, height = 30,
radius = 8, radius = 8,
bg_color = "#343b48", bg_color = "#343b48",
bg_color_hover = "#3c4454", bg_color_hover = "#3c4454",
bg_color_pressed = "#2c313c", bg_color_pressed = "#2c313c",
icon_color = "#c3ccdf", icon_color = "#c3ccdf",
icon_color_hover = "#dce1ec", icon_color_hover = "#dce1ec",
icon_color_pressed = "#edf0f5", icon_color_pressed = "#edf0f5",
icon_color_active = "#f5f6f9", icon_color_active = "#f5f6f9",
icon_path = "no_icon.svg", icon_path = "no_icon.svg",
dark_one = "#1b1e23", dark_one = "#1b1e23",
context_color = "#568af2", context_color = "#568af2",
text_foreground = "#8a95aa", text_foreground = "#8a95aa",
is_active = False is_active = False
): ):
super().__init__() super().__init__()
# SET DEFAULT PARAMETERS # SET DEFAULT PARAMETERS
self.setFixedSize(width, height) self.setFixedSize(width, height)
self.setCursor(Qt.PointingHandCursor) self.setCursor(Qt.PointingHandCursor)
self.setObjectName(btn_id) self.setObjectName(btn_id)
# PROPERTIES # PROPERTIES
self._bg_color = bg_color self._bg_color = bg_color
self._bg_color_hover = bg_color_hover self._bg_color_hover = bg_color_hover
self._bg_color_pressed = bg_color_pressed self._bg_color_pressed = bg_color_pressed
self._icon_color = icon_color self._icon_color = icon_color
self._icon_color_hover = icon_color_hover self._icon_color_hover = icon_color_hover
self._icon_color_pressed = icon_color_pressed self._icon_color_pressed = icon_color_pressed
self._icon_color_active = icon_color_active self._icon_color_active = icon_color_active
self._context_color = context_color self._context_color = context_color
self._top_margin = self.height() + 6 self._top_margin = self.height() + 6
self._is_active = is_active self._is_active = is_active
# Set Parameters # Set Parameters
self._set_bg_color = bg_color self._set_bg_color = bg_color
self._set_icon_path = icon_path self._set_icon_path = icon_path
self._set_icon_color = icon_color self._set_icon_color = icon_color
self._set_border_radius = radius self._set_border_radius = radius
# Parent # Parent
self._parent = parent self._parent = parent
self._app_parent = app_parent self._app_parent = app_parent
# TOOLTIP # TOOLTIP
self._tooltip_text = tooltip_text self._tooltip_text = tooltip_text
self._tooltip = _ToolTip( self._tooltip = _ToolTip(
app_parent, app_parent,
tooltip_text, tooltip_text,
dark_one, dark_one,
context_color, context_color,
text_foreground text_foreground
) )
self._tooltip.hide() self._tooltip.hide()
# SET ACTIVE MENU # SET ACTIVE MENU
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def set_active(self, is_active): def set_active(self, is_active):
self._is_active = is_active self._is_active = is_active
self.repaint() self.repaint()
# RETURN IF IS ACTIVE MENU # RETURN IF IS ACTIVE MENU
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def is_active(self): def is_active(self):
return self._is_active return self._is_active
# PAINT EVENT # PAINT EVENT
# painting the button and the icon # painting the button and the icon
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def paintEvent(self, event): def paintEvent(self, event):
# PAINTER # PAINTER
paint = QPainter() paint = QPainter()
paint.begin(self) paint.begin(self)
paint.setRenderHint(QPainter.RenderHint.Antialiasing) paint.setRenderHint(QPainter.RenderHint.Antialiasing)
if self._is_active: if self._is_active:
# BRUSH # BRUSH
brush = QBrush(QColor(self._bg_color_pressed)) brush = QBrush(QColor(self._bg_color_pressed))
else: else:
# BRUSH # BRUSH
brush = QBrush(QColor(self._set_bg_color)) brush = QBrush(QColor(self._set_bg_color))
# CREATE RECTANGLE # CREATE RECTANGLE
rect = QRect(0, 0, self.width(), self.height()) rect = QRect(0, 0, self.width(), self.height())
paint.setPen(Qt.NoPen) paint.setPen(Qt.NoPen)
paint.setBrush(brush) paint.setBrush(brush)
paint.drawRoundedRect( paint.drawRoundedRect(
rect, rect,
self._set_border_radius, self._set_border_radius,
self._set_border_radius self._set_border_radius
) )
# DRAW ICONS # DRAW ICONS
self.icon_paint(paint, self._set_icon_path, rect) self.icon_paint(paint, self._set_icon_path, rect)
# END PAINTER # END PAINTER
paint.end() paint.end()
# CHANGE STYLES # CHANGE STYLES
# Functions with custom styles # Functions with custom styles
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def change_style(self, event): def change_style(self, event):
if event == QEvent.Enter: if event == QEvent.Enter:
self._set_bg_color = self._bg_color_hover self._set_bg_color = self._bg_color_hover
self._set_icon_color = self._icon_color_hover self._set_icon_color = self._icon_color_hover
self.repaint() self.repaint()
elif event == QEvent.Leave: elif event == QEvent.Leave:
self._set_bg_color = self._bg_color self._set_bg_color = self._bg_color
self._set_icon_color = self._icon_color self._set_icon_color = self._icon_color
self.repaint() self.repaint()
elif event == QEvent.MouseButtonPress: elif event == QEvent.MouseButtonPress:
self._set_bg_color = self._bg_color_pressed self._set_bg_color = self._bg_color_pressed
self._set_icon_color = self._icon_color_pressed self._set_icon_color = self._icon_color_pressed
self.repaint() self.repaint()
elif event == QEvent.MouseButtonRelease: elif event == QEvent.MouseButtonRelease:
self._set_bg_color = self._bg_color_hover self._set_bg_color = self._bg_color_hover
self._set_icon_color = self._icon_color_hover self._set_icon_color = self._icon_color_hover
self.repaint() self.repaint()
# MOUSE OVER # MOUSE OVER
# Event triggered when the mouse is over the BTN # Event triggered when the mouse is over the BTN
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def enterEvent(self, event): def enterEvent(self, event):
self.change_style(QEvent.Enter) self.change_style(QEvent.Enter)
self.move_tooltip() self.move_tooltip()
self._tooltip.show() self._tooltip.show()
# MOUSE LEAVE # MOUSE LEAVE
# Event fired when the mouse leaves the BTN # Event fired when the mouse leaves the BTN
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def leaveEvent(self, event): def leaveEvent(self, event):
self.change_style(QEvent.Leave) self.change_style(QEvent.Leave)
self.move_tooltip() self.move_tooltip()
self._tooltip.hide() self._tooltip.hide()
# MOUSE PRESS # MOUSE PRESS
# Event triggered when the left button is pressed # Event triggered when the left button is pressed
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def mousePressEvent(self, event): def mousePressEvent(self, event):
if event.button() == Qt.LeftButton: if event.button() == Qt.LeftButton:
self.change_style(QEvent.MouseButtonPress) self.change_style(QEvent.MouseButtonPress)
# SET FOCUS # SET FOCUS
self.setFocus() self.setFocus()
# EMIT SIGNAL # EMIT SIGNAL
return self.clicked.emit() return self.clicked.emit()
# MOUSE RELEASED # MOUSE RELEASED
# Event triggered after the mouse button is released # Event triggered after the mouse button is released
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def mouseReleaseEvent(self, event): def mouseReleaseEvent(self, event):
if event.button() == Qt.LeftButton: if event.button() == Qt.LeftButton:
self.change_style(QEvent.MouseButtonRelease) self.change_style(QEvent.MouseButtonRelease)
# EMIT SIGNAL # EMIT SIGNAL
return self.released.emit() return self.released.emit()
# DRAW ICON WITH COLORS # DRAW ICON WITH COLORS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def icon_paint(self, qp, image, rect): def icon_paint(self, qp, image, rect):
icon = QPixmap(image) icon = QPixmap(image)
painter = QPainter(icon) painter = QPainter(icon)
painter.setCompositionMode(QPainter.CompositionMode_SourceIn) painter.setCompositionMode(QPainter.CompositionMode_SourceIn)
if self._is_active: if self._is_active:
painter.fillRect(icon.rect(), self._context_color) painter.fillRect(icon.rect(), self._context_color)
else: else:
painter.fillRect(icon.rect(), self._set_icon_color) painter.fillRect(icon.rect(), self._set_icon_color)
qp.drawPixmap( qp.drawPixmap(
(rect.width() - icon.width()) / 2, (rect.width() - icon.width()) / 2,
(rect.height() - icon.height()) / 2, (rect.height() - icon.height()) / 2,
icon icon
) )
painter.end() painter.end()
# SET ICON # SET ICON
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def set_icon(self, icon_path): def set_icon(self, icon_path):
self._set_icon_path = icon_path self._set_icon_path = icon_path
self.repaint() self.repaint()
# MOVE TOOLTIP # MOVE TOOLTIP
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def move_tooltip(self): def move_tooltip(self):
# GET MAIN WINDOW PARENT # GET MAIN WINDOW PARENT
gp = self.mapToGlobal(QPoint(0, 0)) gp = self.mapToGlobal(QPoint(0, 0))
# SET WIDGET TO GET POSTION # SET WIDGET TO GET POSTION
# Return absolute position of widget inside app # Return absolute position of widget inside app
pos = self._parent.mapFromGlobal(gp) pos = self._parent.mapFromGlobal(gp)
# FORMAT POSITION # FORMAT POSITION
# Adjust tooltip position with offset # Adjust tooltip position with offset
pos_x = (pos.x() - self._tooltip.width()) + self.width() + 5 pos_x = (pos.x() - self._tooltip.width()) + self.width() + 5
pos_y = pos.y() + self._top_margin pos_y = pos.y() + self._top_margin
# SET POSITION TO WIDGET # SET POSITION TO WIDGET
# Move tooltip position # Move tooltip position
self._tooltip.move(pos_x, pos_y) self._tooltip.move(pos_x, pos_y)
# TOOLTIP # TOOLTIP
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
class _ToolTip(QLabel): class _ToolTip(QLabel):
# TOOLTIP / LABEL StyleSheet # TOOLTIP / LABEL StyleSheet
style_tooltip = """ style_tooltip = """
QLabel {{ QLabel {{
background-color: {_dark_one}; background-color: {_dark_one};
color: {_text_foreground}; color: {_text_foreground};
padding-left: 10px; padding-left: 10px;
padding-right: 10px; padding-right: 10px;
border-radius: 17px; border-radius: 17px;
border: 0px solid transparent; border: 0px solid transparent;
border-right: 3px solid {_context_color}; border-right: 3px solid {_context_color};
font: 800 9pt "Segoe UI"; font: 800 9pt "Segoe UI";
}} }}
""" """
def __init__( def __init__(
self, self,
parent, parent,
tooltip, tooltip,
dark_one, dark_one,
context_color, context_color,
text_foreground text_foreground
): ):
QLabel.__init__(self) QLabel.__init__(self)
# LABEL SETUP # LABEL SETUP
style = self.style_tooltip.format( style = self.style_tooltip.format(
_dark_one = dark_one, _dark_one = dark_one,
_context_color = context_color, _context_color = context_color,
_text_foreground = text_foreground _text_foreground = text_foreground
) )
self.setObjectName(u"label_tooltip") self.setObjectName(u"label_tooltip")
self.setStyleSheet(style) self.setStyleSheet(style)
self.setMinimumHeight(34) self.setMinimumHeight(34)
self.setParent(parent) self.setParent(parent)
self.setText(tooltip) self.setText(tooltip)
self.adjustSize() self.adjustSize()
# SET DROP SHADOW # SET DROP SHADOW
self.shadow = QGraphicsDropShadowEffect(self) self.shadow = QGraphicsDropShadowEffect(self)
self.shadow.setBlurRadius(30) self.shadow.setBlurRadius(30)
self.shadow.setXOffset(0) self.shadow.setXOffset(0)
self.shadow.setYOffset(0) self.shadow.setYOffset(0)
self.shadow.setColor(QColor(0, 0, 0, 80)) self.shadow.setColor(QColor(0, 0, 0, 80))
self.setGraphicsEffect(self.shadow) self.setGraphicsEffect(self.shadow)

View File

@@ -1,194 +1,194 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT QT CORE # IMPORT QT CORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from qt_core import * from qt_core import *
# IMPORT CLOSE BUTTON # IMPORT CLOSE BUTTON
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_left_button import * from . py_left_button import *
# IMPORT ICON # IMPORT ICON
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_icon import * from . py_icon import *
# IMPORT LEFT COLUMN # IMPORT LEFT COLUMN
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from gui.uis.columns.ui_left_column import Ui_LeftColumn from gui.uis.columns.ui_left_column import Ui_LeftColumn
class PyLeftColumn(QWidget): class PyLeftColumn(QWidget):
# SIGNALS # SIGNALS
clicked = Signal(object) clicked = Signal(object)
released = Signal(object) released = Signal(object)
def __init__( def __init__(
self, self,
parent, parent,
app_parent, app_parent,
text_title, text_title,
text_title_size, text_title_size,
text_title_color, text_title_color,
dark_one, dark_one,
bg_color, bg_color,
btn_color, btn_color,
btn_color_hover, btn_color_hover,
btn_color_pressed, btn_color_pressed,
icon_path, icon_path,
icon_color, icon_color,
icon_color_hover, icon_color_hover,
icon_color_pressed, icon_color_pressed,
context_color, context_color,
icon_close_path, icon_close_path,
radius = 8 radius = 8
): ):
super().__init__() super().__init__()
# PARAMETERS # PARAMETERS
self._parent = parent self._parent = parent
self._app_parent = app_parent self._app_parent = app_parent
self._text_title = text_title self._text_title = text_title
self._text_title_size = text_title_size self._text_title_size = text_title_size
self._text_title_color = text_title_color self._text_title_color = text_title_color
self._icon_path = icon_path self._icon_path = icon_path
self._dark_one = dark_one self._dark_one = dark_one
self._bg_color = bg_color self._bg_color = bg_color
self._btn_color = btn_color self._btn_color = btn_color
self._btn_color_hover = btn_color_hover self._btn_color_hover = btn_color_hover
self._btn_color_pressed = btn_color_pressed self._btn_color_pressed = btn_color_pressed
self._icon_color = icon_color self._icon_color = icon_color
self._icon_color_hover = icon_color_hover self._icon_color_hover = icon_color_hover
self._icon_color_pressed = icon_color_pressed self._icon_color_pressed = icon_color_pressed
self._context_color = context_color self._context_color = context_color
self._icon_close_path = icon_close_path self._icon_close_path = icon_close_path
self._radius = radius self._radius = radius
# SETUP UI # SETUP UI
self.setup_ui() self.setup_ui()
# ADD LEFT COLUMN TO BG FRAME # ADD LEFT COLUMN TO BG FRAME
self.menus = Ui_LeftColumn() self.menus = Ui_LeftColumn()
self.menus.setupUi(self.content_frame) self.menus.setupUi(self.content_frame)
# CONNECT SIGNALS # CONNECT SIGNALS
self.btn_close.clicked.connect(self.btn_clicked) self.btn_close.clicked.connect(self.btn_clicked)
self.btn_close.released.connect(self.btn_released) self.btn_close.released.connect(self.btn_released)
# TITLE LEFT COLUMN EMIT SIGNALS # TITLE LEFT COLUMN EMIT SIGNALS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def btn_clicked(self): def btn_clicked(self):
self.clicked.emit(self.btn_close) self.clicked.emit(self.btn_close)
def btn_released(self): def btn_released(self):
self.released.emit(self.btn_close) self.released.emit(self.btn_close)
# WIDGETS # WIDGETS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def setup_ui(self): def setup_ui(self):
# BASE LAYOUT # BASE LAYOUT
self.base_layout = QVBoxLayout(self) self.base_layout = QVBoxLayout(self)
self.base_layout.setContentsMargins(0,0,0,0) self.base_layout.setContentsMargins(0,0,0,0)
self.base_layout.setSpacing(0) self.base_layout.setSpacing(0)
# TITLE FRAME # TITLE FRAME
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.title_frame = QFrame() self.title_frame = QFrame()
self.title_frame.setMaximumHeight(47) self.title_frame.setMaximumHeight(47)
self.title_frame.setMinimumHeight(47) self.title_frame.setMinimumHeight(47)
# TITLE BASE LAYOUT # TITLE BASE LAYOUT
self.title_base_layout = QVBoxLayout(self.title_frame) self.title_base_layout = QVBoxLayout(self.title_frame)
self.title_base_layout.setContentsMargins(5,3,5,3) self.title_base_layout.setContentsMargins(5,3,5,3)
# TITLE BG # TITLE BG
self.title_bg_frame = QFrame() self.title_bg_frame = QFrame()
self.title_bg_frame.setObjectName("title_bg_frame") self.title_bg_frame.setObjectName("title_bg_frame")
self.title_bg_frame.setStyleSheet(f''' self.title_bg_frame.setStyleSheet(f'''
#title_bg_frame {{ #title_bg_frame {{
background-color: {self._bg_color}; background-color: {self._bg_color};
border-radius: {self._radius}px; border-radius: {self._radius}px;
}} }}
''') ''')
# LAYOUT TITLE BG # LAYOUT TITLE BG
self.title_bg_layout = QHBoxLayout(self.title_bg_frame) self.title_bg_layout = QHBoxLayout(self.title_bg_frame)
self.title_bg_layout.setContentsMargins(5,5,5,5) self.title_bg_layout.setContentsMargins(5,5,5,5)
self.title_bg_layout.setSpacing(3) self.title_bg_layout.setSpacing(3)
# ICON # ICON
self.icon_frame = QFrame() self.icon_frame = QFrame()
self.icon_frame.setFixedSize(30,30) self.icon_frame.setFixedSize(30,30)
self.icon_frame.setStyleSheet("background: none;") self.icon_frame.setStyleSheet("background: none;")
self.icon_layout = QVBoxLayout(self.icon_frame) self.icon_layout = QVBoxLayout(self.icon_frame)
self.icon_layout.setContentsMargins(0,0,0,0) self.icon_layout.setContentsMargins(0,0,0,0)
self.icon_layout.setSpacing(5) self.icon_layout.setSpacing(5)
self.icon = PyIcon(self._icon_path, self._icon_color) self.icon = PyIcon(self._icon_path, self._icon_color)
self.icon_layout.addWidget(self.icon, Qt.AlignCenter, Qt.AlignCenter) self.icon_layout.addWidget(self.icon, Qt.AlignCenter, Qt.AlignCenter)
# LABEL # LABEL
self.title_label = QLabel(self._text_title) self.title_label = QLabel(self._text_title)
self.title_label.setObjectName("title_label") self.title_label.setObjectName("title_label")
self.title_label.setStyleSheet(f''' self.title_label.setStyleSheet(f'''
#title_label {{ #title_label {{
font-size: {self._text_title_size}pt; font-size: {self._text_title_size}pt;
color: {self._text_title_color}; color: {self._text_title_color};
padding-bottom: 2px; padding-bottom: 2px;
background: none; background: none;
}} }}
''') ''')
# BTN FRAME # BTN FRAME
self.btn_frame = QFrame() self.btn_frame = QFrame()
self.btn_frame.setFixedSize(30,30) self.btn_frame.setFixedSize(30,30)
self.btn_frame.setStyleSheet("background: none;") self.btn_frame.setStyleSheet("background: none;")
# CLOSE BUTTON # CLOSE BUTTON
self.btn_close = PyLeftButton( self.btn_close = PyLeftButton(
self._parent, self._parent,
self._app_parent, self._app_parent,
tooltip_text = "Hide", tooltip_text = "Hide",
dark_one = self._dark_one, dark_one = self._dark_one,
bg_color = self._btn_color, bg_color = self._btn_color,
bg_color_hover = self._btn_color_hover, bg_color_hover = self._btn_color_hover,
bg_color_pressed = self._btn_color_pressed, bg_color_pressed = self._btn_color_pressed,
icon_color = self._icon_color, icon_color = self._icon_color,
icon_color_hover = self._icon_color_hover, icon_color_hover = self._icon_color_hover,
icon_color_pressed = self._icon_color_pressed, icon_color_pressed = self._icon_color_pressed,
icon_color_active = self._icon_color_pressed, icon_color_active = self._icon_color_pressed,
context_color = self._context_color, context_color = self._context_color,
text_foreground = self._text_title_color, text_foreground = self._text_title_color,
icon_path = self._icon_close_path, icon_path = self._icon_close_path,
radius = 6, radius = 6,
) )
self.btn_close.setParent(self.btn_frame) self.btn_close.setParent(self.btn_frame)
self.btn_close.setObjectName("btn_close_left_column") self.btn_close.setObjectName("btn_close_left_column")
# ADD TO TITLE LAYOUT # ADD TO TITLE LAYOUT
self.title_bg_layout.addWidget(self.icon_frame) self.title_bg_layout.addWidget(self.icon_frame)
self.title_bg_layout.addWidget(self.title_label) self.title_bg_layout.addWidget(self.title_label)
self.title_bg_layout.addWidget(self.btn_frame) self.title_bg_layout.addWidget(self.btn_frame)
# ADD TITLE BG TO LAYOUT # ADD TITLE BG TO LAYOUT
self.title_base_layout.addWidget(self.title_bg_frame) self.title_base_layout.addWidget(self.title_bg_frame)
# CONTENT FRAME # CONTENT FRAME
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.content_frame = QFrame() self.content_frame = QFrame()
self.content_frame.setStyleSheet("background: none") self.content_frame.setStyleSheet("background: none")
# ADD TO LAYOUT # ADD TO LAYOUT
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.base_layout.addWidget(self.title_frame) self.base_layout.addWidget(self.title_frame)
self.base_layout.addWidget(self.content_frame) self.base_layout.addWidget(self.content_frame)

View File

@@ -1,20 +1,20 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# PY LEFT MENU # PY LEFT MENU
# Left menu bar # Left menu bar
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_left_menu import PyLeftMenu from . py_left_menu import PyLeftMenu

View File

@@ -1,34 +1,34 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT QT CORE # IMPORT QT CORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from qt_core import * from qt_core import *
# CUSTOM LEFT MENU # CUSTOM LEFT MENU
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
class PyDiv(QWidget): class PyDiv(QWidget):
def __init__(self, color): def __init__(self, color):
super().__init__() super().__init__()
self.layout = QHBoxLayout(self) self.layout = QHBoxLayout(self)
self.layout.setContentsMargins(5,0,5,0) self.layout.setContentsMargins(5,0,5,0)
self.frame_line = QFrame() self.frame_line = QFrame()
self.frame_line.setStyleSheet(f"background: {color};") self.frame_line.setStyleSheet(f"background: {color};")
self.frame_line.setMaximumHeight(1) self.frame_line.setMaximumHeight(1)
self.frame_line.setMinimumHeight(1) self.frame_line.setMinimumHeight(1)
self.layout.addWidget(self.frame_line) self.layout.addWidget(self.frame_line)
self.setMaximumHeight(1) self.setMaximumHeight(1)

View File

@@ -1,266 +1,266 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT QT CORE # IMPORT QT CORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from qt_core import * from qt_core import *
# IMPORT BUTTON AND DIV # IMPORT BUTTON AND DIV
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_left_menu_button import PyLeftMenuButton from . py_left_menu_button import PyLeftMenuButton
from . py_div import PyDiv from . py_div import PyDiv
# IMPORT FUNCTIONS # IMPORT FUNCTIONS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from gui.core.functions import * from gui.core.functions import *
# PY LEFT MENU # PY LEFT MENU
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
class PyLeftMenu(QWidget): class PyLeftMenu(QWidget):
# SIGNALS # SIGNALS
clicked = Signal(object) clicked = Signal(object)
released = Signal(object) released = Signal(object)
def __init__( def __init__(
self, self,
parent = None, parent = None,
app_parent = None, app_parent = None,
dark_one = "#1b1e23", dark_one = "#1b1e23",
dark_three = "#21252d", dark_three = "#21252d",
dark_four = "#272c36", dark_four = "#272c36",
bg_one = "#2c313c", bg_one = "#2c313c",
icon_color = "#c3ccdf", icon_color = "#c3ccdf",
icon_color_hover = "#dce1ec", icon_color_hover = "#dce1ec",
icon_color_pressed = "#edf0f5", icon_color_pressed = "#edf0f5",
icon_color_active = "#f5f6f9", icon_color_active = "#f5f6f9",
context_color = "#568af2", context_color = "#568af2",
text_foreground = "#8a95aa", text_foreground = "#8a95aa",
text_active = "#dce1ec", text_active = "#dce1ec",
duration_time = 500, duration_time = 500,
radius = 8, radius = 8,
minimum_width = 50, minimum_width = 50,
maximum_width = 240, maximum_width = 240,
icon_path = "icon_menu.svg", icon_path = "icon_menu.svg",
icon_path_close = "icon_menu_close.svg", icon_path_close = "icon_menu_close.svg",
toggle_text = "Hide Menu", toggle_text = "Hide Menu",
toggle_tooltip = "Show menu" toggle_tooltip = "Show menu"
): ):
super().__init__() super().__init__()
# PROPERTIES # PROPERTIES
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self._dark_one = dark_one self._dark_one = dark_one
self._dark_three = dark_three self._dark_three = dark_three
self._dark_four = dark_four self._dark_four = dark_four
self._bg_one = bg_one self._bg_one = bg_one
self._icon_color = icon_color self._icon_color = icon_color
self._icon_color_hover = icon_color_hover self._icon_color_hover = icon_color_hover
self._icon_color_pressed = icon_color_pressed self._icon_color_pressed = icon_color_pressed
self._icon_color_active = icon_color_active self._icon_color_active = icon_color_active
self._context_color = context_color self._context_color = context_color
self._text_foreground = text_foreground self._text_foreground = text_foreground
self._text_active = text_active self._text_active = text_active
self._duration_time = duration_time self._duration_time = duration_time
self._radius = radius self._radius = radius
self._minimum_width = minimum_width self._minimum_width = minimum_width
self._maximum_width = maximum_width self._maximum_width = maximum_width
self._icon_path = Functions.set_svg_icon(icon_path) self._icon_path = Functions.set_svg_icon(icon_path)
self._icon_path_close = Functions.set_svg_icon(icon_path_close) self._icon_path_close = Functions.set_svg_icon(icon_path_close)
# SET PARENT # SET PARENT
self._parent = parent self._parent = parent
self._app_parent = app_parent self._app_parent = app_parent
# SETUP WIDGETS # SETUP WIDGETS
self.setup_ui() self.setup_ui()
# SET BG COLOR # SET BG COLOR
self.bg.setStyleSheet(f"background: {dark_one}; border-radius: {radius};") self.bg.setStyleSheet(f"background: {dark_one}; border-radius: {radius};")
# TOGGLE BUTTON AND DIV MENUS # TOGGLE BUTTON AND DIV MENUS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.toggle_button = PyLeftMenuButton( self.toggle_button = PyLeftMenuButton(
app_parent, app_parent,
text = toggle_text, text = toggle_text,
tooltip_text = toggle_tooltip, tooltip_text = toggle_tooltip,
dark_one = self._dark_one, dark_one = self._dark_one,
dark_three = self._dark_three, dark_three = self._dark_three,
dark_four = self._dark_four, dark_four = self._dark_four,
bg_one = self._bg_one, bg_one = self._bg_one,
icon_color = self._icon_color, icon_color = self._icon_color,
icon_color_hover = self._icon_color_active, icon_color_hover = self._icon_color_active,
icon_color_pressed = self._icon_color_pressed, icon_color_pressed = self._icon_color_pressed,
icon_color_active = self._icon_color_active, icon_color_active = self._icon_color_active,
context_color = self._context_color, context_color = self._context_color,
text_foreground = self._text_foreground, text_foreground = self._text_foreground,
text_active = self._text_active, text_active = self._text_active,
icon_path = icon_path icon_path = icon_path
) )
self.toggle_button.clicked.connect(self.toggle_animation) self.toggle_button.clicked.connect(self.toggle_animation)
self.div_top = PyDiv(dark_four) self.div_top = PyDiv(dark_four)
# ADD TO TOP LAYOUT # ADD TO TOP LAYOUT
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.top_layout.addWidget(self.toggle_button) self.top_layout.addWidget(self.toggle_button)
self.top_layout.addWidget(self.div_top) self.top_layout.addWidget(self.div_top)
# ADD TO BOTTOM LAYOUT # ADD TO BOTTOM LAYOUT
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.div_bottom = PyDiv(dark_four) self.div_bottom = PyDiv(dark_four)
self.div_bottom.hide() self.div_bottom.hide()
self.bottom_layout.addWidget(self.div_bottom) self.bottom_layout.addWidget(self.div_bottom)
# ADD BUTTONS TO LEFT MENU # ADD BUTTONS TO LEFT MENU
# Add btns and emit signals # Add btns and emit signals
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def add_menus(self, parameters): def add_menus(self, parameters):
if parameters != None: if parameters != None:
for parameter in parameters: for parameter in parameters:
_btn_icon = parameter['btn_icon'] _btn_icon = parameter['btn_icon']
_btn_id = parameter['btn_id'] _btn_id = parameter['btn_id']
_btn_text = parameter['btn_text'] _btn_text = parameter['btn_text']
_btn_tooltip = parameter['btn_tooltip'] _btn_tooltip = parameter['btn_tooltip']
_show_top = parameter['show_top'] _show_top = parameter['show_top']
_is_active = parameter['is_active'] _is_active = parameter['is_active']
self.menu = PyLeftMenuButton( self.menu = PyLeftMenuButton(
self._app_parent, self._app_parent,
text = _btn_text, text = _btn_text,
btn_id = _btn_id, btn_id = _btn_id,
tooltip_text = _btn_tooltip, tooltip_text = _btn_tooltip,
dark_one = self._dark_one, dark_one = self._dark_one,
dark_three = self._dark_three, dark_three = self._dark_three,
dark_four = self._dark_four, dark_four = self._dark_four,
bg_one = self._bg_one, bg_one = self._bg_one,
icon_color = self._icon_color, icon_color = self._icon_color,
icon_color_hover = self._icon_color_active, icon_color_hover = self._icon_color_active,
icon_color_pressed = self._icon_color_pressed, icon_color_pressed = self._icon_color_pressed,
icon_color_active = self._icon_color_active, icon_color_active = self._icon_color_active,
context_color = self._context_color, context_color = self._context_color,
text_foreground = self._text_foreground, text_foreground = self._text_foreground,
text_active = self._text_active, text_active = self._text_active,
icon_path = _btn_icon, icon_path = _btn_icon,
is_active = _is_active is_active = _is_active
) )
self.menu.clicked.connect(self.btn_clicked) self.menu.clicked.connect(self.btn_clicked)
self.menu.released.connect(self.btn_released) self.menu.released.connect(self.btn_released)
# ADD TO LAYOUT # ADD TO LAYOUT
if _show_top: if _show_top:
self.top_layout.addWidget(self.menu) self.top_layout.addWidget(self.menu)
else: else:
self.div_bottom.show() self.div_bottom.show()
self.bottom_layout.addWidget(self.menu) self.bottom_layout.addWidget(self.menu)
# LEFT MENU EMIT SIGNALS # LEFT MENU EMIT SIGNALS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def btn_clicked(self): def btn_clicked(self):
self.clicked.emit(self.menu) self.clicked.emit(self.menu)
def btn_released(self): def btn_released(self):
self.released.emit(self.menu) self.released.emit(self.menu)
# EXPAND / RETRACT LEF MENU # EXPAND / RETRACT LEF MENU
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def toggle_animation(self): def toggle_animation(self):
# CREATE ANIMATION # CREATE ANIMATION
self.animation = QPropertyAnimation(self._parent, b"minimumWidth") self.animation = QPropertyAnimation(self._parent, b"minimumWidth")
self.animation.stop() self.animation.stop()
if self.width() == self._minimum_width: if self.width() == self._minimum_width:
self.animation.setStartValue(self.width()) self.animation.setStartValue(self.width())
self.animation.setEndValue(self._maximum_width) self.animation.setEndValue(self._maximum_width)
self.toggle_button.set_active_toggle(True) self.toggle_button.set_active_toggle(True)
self.toggle_button.set_icon(self._icon_path_close) self.toggle_button.set_icon(self._icon_path_close)
else: else:
self.animation.setStartValue(self.width()) self.animation.setStartValue(self.width())
self.animation.setEndValue(self._minimum_width) self.animation.setEndValue(self._minimum_width)
self.toggle_button.set_active_toggle(False) self.toggle_button.set_active_toggle(False)
self.toggle_button.set_icon(self._icon_path) self.toggle_button.set_icon(self._icon_path)
self.animation.setEasingCurve(QEasingCurve.InOutCubic) self.animation.setEasingCurve(QEasingCurve.InOutCubic)
self.animation.setDuration(self._duration_time) self.animation.setDuration(self._duration_time)
self.animation.start() self.animation.start()
# SELECT ONLY ONE BTN # SELECT ONLY ONE BTN
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def select_only_one(self, widget: str): def select_only_one(self, widget: str):
for btn in self.findChildren(QPushButton): for btn in self.findChildren(QPushButton):
if btn.objectName() == widget: if btn.objectName() == widget:
btn.set_active(True) btn.set_active(True)
else: else:
btn.set_active(False) btn.set_active(False)
# SELECT ONLY ONE TAB BTN # SELECT ONLY ONE TAB BTN
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def select_only_one_tab(self, widget: str): def select_only_one_tab(self, widget: str):
for btn in self.findChildren(QPushButton): for btn in self.findChildren(QPushButton):
if btn.objectName() == widget: if btn.objectName() == widget:
btn.set_active_tab(True) btn.set_active_tab(True)
else: else:
btn.set_active_tab(False) btn.set_active_tab(False)
# DESELECT ALL BTNs # DESELECT ALL BTNs
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def deselect_all(self): def deselect_all(self):
for btn in self.findChildren(QPushButton): for btn in self.findChildren(QPushButton):
btn.set_active(False) btn.set_active(False)
# DESELECT ALL TAB BTNs # DESELECT ALL TAB BTNs
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def deselect_all_tab(self): def deselect_all_tab(self):
for btn in self.findChildren(QPushButton): for btn in self.findChildren(QPushButton):
btn.set_active_tab(False) btn.set_active_tab(False)
# SETUP APP # SETUP APP
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def setup_ui(self): def setup_ui(self):
# ADD MENU LAYOUT # ADD MENU LAYOUT
self.left_menu_layout = QVBoxLayout(self) self.left_menu_layout = QVBoxLayout(self)
self.left_menu_layout.setContentsMargins(0,0,0,0) self.left_menu_layout.setContentsMargins(0,0,0,0)
# ADD BG # ADD BG
self.bg = QFrame() self.bg = QFrame()
# TOP FRAME # TOP FRAME
self.top_frame = QFrame() self.top_frame = QFrame()
# BOTTOM FRAME # BOTTOM FRAME
self.bottom_frame = QFrame() self.bottom_frame = QFrame()
# ADD LAYOUTS # ADD LAYOUTS
self._layout = QVBoxLayout(self.bg) self._layout = QVBoxLayout(self.bg)
self._layout.setContentsMargins(0,0,0,0) self._layout.setContentsMargins(0,0,0,0)
# TOP LAYOUT # TOP LAYOUT
self.top_layout = QVBoxLayout(self.top_frame) self.top_layout = QVBoxLayout(self.top_frame)
self.top_layout.setContentsMargins(0,0,0,0) self.top_layout.setContentsMargins(0,0,0,0)
self.top_layout.setSpacing(1) self.top_layout.setSpacing(1)
# BOTTOM LAYOUT # BOTTOM LAYOUT
self.bottom_layout = QVBoxLayout(self.bottom_frame) self.bottom_layout = QVBoxLayout(self.bottom_frame)
self.bottom_layout.setContentsMargins(0,0,0,8) self.bottom_layout.setContentsMargins(0,0,0,8)
self.bottom_layout.setSpacing(1) self.bottom_layout.setSpacing(1)
# ADD TOP AND BOTTOM FRAME # ADD TOP AND BOTTOM FRAME
self._layout.addWidget(self.top_frame, 0, Qt.AlignTop) self._layout.addWidget(self.top_frame, 0, Qt.AlignTop)
self._layout.addWidget(self.bottom_frame, 0, Qt.AlignBottom) self._layout.addWidget(self.bottom_frame, 0, Qt.AlignBottom)
# ADD BG TO LAYOUT # ADD BG TO LAYOUT
self.left_menu_layout.addWidget(self.bg) self.left_menu_layout.addWidget(self.bg)

View File

@@ -1,380 +1,380 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT PACKAGES AND MODULES # IMPORT PACKAGES AND MODULES
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
import os import os
# IMPORT QT CORE # IMPORT QT CORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from qt_core import * from qt_core import *
# IMPORT FUNCTIONS # IMPORT FUNCTIONS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from gui.core.functions import * from gui.core.functions import *
# CUSTOM LEFT MENU # CUSTOM LEFT MENU
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
class PyLeftMenuButton(QPushButton): class PyLeftMenuButton(QPushButton):
def __init__( def __init__(
self, self,
app_parent, app_parent,
text, text,
btn_id = None, btn_id = None,
tooltip_text = "", tooltip_text = "",
margin = 4, margin = 4,
dark_one = "#1b1e23", dark_one = "#1b1e23",
dark_three = "#21252d", dark_three = "#21252d",
dark_four = "#272c36", dark_four = "#272c36",
bg_one = "#2c313c", bg_one = "#2c313c",
icon_color = "#c3ccdf", icon_color = "#c3ccdf",
icon_color_hover = "#dce1ec", icon_color_hover = "#dce1ec",
icon_color_pressed = "#edf0f5", icon_color_pressed = "#edf0f5",
icon_color_active = "#f5f6f9", icon_color_active = "#f5f6f9",
context_color = "#568af2", context_color = "#568af2",
text_foreground = "#8a95aa", text_foreground = "#8a95aa",
text_active = "#dce1ec", text_active = "#dce1ec",
icon_path = "icon_add_user.svg", icon_path = "icon_add_user.svg",
icon_active_menu = "active_menu.svg", icon_active_menu = "active_menu.svg",
is_active = False, is_active = False,
is_active_tab = False, is_active_tab = False,
is_toggle_active = False is_toggle_active = False
): ):
super().__init__() super().__init__()
self.setText(text) self.setText(text)
self.setCursor(Qt.PointingHandCursor) self.setCursor(Qt.PointingHandCursor)
self.setMaximumHeight(50) self.setMaximumHeight(50)
self.setMinimumHeight(50) self.setMinimumHeight(50)
self.setObjectName(btn_id) self.setObjectName(btn_id)
# APP PATH # APP PATH
self._icon_path = Functions.set_svg_icon(icon_path) self._icon_path = Functions.set_svg_icon(icon_path)
self._icon_active_menu = Functions.set_svg_icon(icon_active_menu) self._icon_active_menu = Functions.set_svg_icon(icon_active_menu)
# PROPERTIES # PROPERTIES
self._margin = margin self._margin = margin
self._dark_one = dark_one self._dark_one = dark_one
self._dark_three = dark_three self._dark_three = dark_three
self._dark_four = dark_four self._dark_four = dark_four
self._bg_one = bg_one self._bg_one = bg_one
self._context_color = context_color self._context_color = context_color
self._icon_color = icon_color self._icon_color = icon_color
self._icon_color_hover = icon_color_hover self._icon_color_hover = icon_color_hover
self._icon_color_pressed = icon_color_pressed self._icon_color_pressed = icon_color_pressed
self._icon_color_active = icon_color_active self._icon_color_active = icon_color_active
self._set_icon_color = self._icon_color # Set icon color self._set_icon_color = self._icon_color # Set icon color
self._set_bg_color = self._dark_one # Set BG color self._set_bg_color = self._dark_one # Set BG color
self._set_text_foreground = text_foreground self._set_text_foreground = text_foreground
self._set_text_active = text_active self._set_text_active = text_active
self._parent = app_parent self._parent = app_parent
self._is_active = is_active self._is_active = is_active
self._is_active_tab = is_active_tab self._is_active_tab = is_active_tab
self._is_toggle_active = is_toggle_active self._is_toggle_active = is_toggle_active
# TOOLTIP # TOOLTIP
self._tooltip_text = tooltip_text self._tooltip_text = tooltip_text
self.tooltip = _ToolTip( self.tooltip = _ToolTip(
app_parent, app_parent,
tooltip_text, tooltip_text,
dark_one, dark_one,
context_color, context_color,
text_foreground text_foreground
) )
self.tooltip.hide() self.tooltip.hide()
# PAINT EVENT # PAINT EVENT
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def paintEvent(self, event): def paintEvent(self, event):
# PAINTER # PAINTER
p = QPainter() p = QPainter()
p.begin(self) p.begin(self)
p.setRenderHint(QPainter.Antialiasing) p.setRenderHint(QPainter.Antialiasing)
p.setPen(Qt.NoPen) p.setPen(Qt.NoPen)
p.setFont(self.font()) p.setFont(self.font())
# RECTANGLES # RECTANGLES
rect = QRect(4, 5, self.width(), self.height() - 10) rect = QRect(4, 5, self.width(), self.height() - 10)
rect_inside = QRect(4, 5, self.width() - 8, self.height() - 10) rect_inside = QRect(4, 5, self.width() - 8, self.height() - 10)
rect_icon = QRect(0, 0, 50, self.height()) rect_icon = QRect(0, 0, 50, self.height())
rect_blue = QRect(4, 5, 20, self.height() - 10) rect_blue = QRect(4, 5, 20, self.height() - 10)
rect_inside_active = QRect(7, 5, self.width(), self.height() - 10) rect_inside_active = QRect(7, 5, self.width(), self.height() - 10)
rect_text = QRect(45, 0, self.width() - 50, self.height()) rect_text = QRect(45, 0, self.width() - 50, self.height())
if self._is_active: if self._is_active:
# DRAW BG BLUE # DRAW BG BLUE
p.setBrush(QColor(self._context_color)) p.setBrush(QColor(self._context_color))
p.drawRoundedRect(rect_blue, 8, 8) p.drawRoundedRect(rect_blue, 8, 8)
# BG INSIDE # BG INSIDE
p.setBrush(QColor(self._bg_one)) p.setBrush(QColor(self._bg_one))
p.drawRoundedRect(rect_inside_active, 8, 8) p.drawRoundedRect(rect_inside_active, 8, 8)
# DRAW ACTIVE # DRAW ACTIVE
icon_path = self._icon_active_menu icon_path = self._icon_active_menu
app_path = os.path.abspath(os.getcwd()) app_path = os.path.abspath(os.getcwd())
icon_path = os.path.normpath(os.path.join(app_path, icon_path)) icon_path = os.path.normpath(os.path.join(app_path, icon_path))
self._set_icon_color = self._icon_color_active self._set_icon_color = self._icon_color_active
self.icon_active(p, icon_path, self.width()) self.icon_active(p, icon_path, self.width())
# DRAW TEXT # DRAW TEXT
p.setPen(QColor(self._set_text_active)) p.setPen(QColor(self._set_text_active))
p.drawText(rect_text, Qt.AlignVCenter, self.text()) p.drawText(rect_text, Qt.AlignVCenter, self.text())
# DRAW ICONS # DRAW ICONS
self.icon_paint(p, self._icon_path, rect_icon, self._set_icon_color) self.icon_paint(p, self._icon_path, rect_icon, self._set_icon_color)
elif self._is_active_tab: elif self._is_active_tab:
# DRAW BG BLUE # DRAW BG BLUE
p.setBrush(QColor(self._dark_four)) p.setBrush(QColor(self._dark_four))
p.drawRoundedRect(rect_blue, 8, 8) p.drawRoundedRect(rect_blue, 8, 8)
# BG INSIDE # BG INSIDE
p.setBrush(QColor(self._bg_one)) p.setBrush(QColor(self._bg_one))
p.drawRoundedRect(rect_inside_active, 8, 8) p.drawRoundedRect(rect_inside_active, 8, 8)
# DRAW ACTIVE # DRAW ACTIVE
icon_path = self._icon_active_menu icon_path = self._icon_active_menu
app_path = os.path.abspath(os.getcwd()) app_path = os.path.abspath(os.getcwd())
icon_path = os.path.normpath(os.path.join(app_path, icon_path)) icon_path = os.path.normpath(os.path.join(app_path, icon_path))
self._set_icon_color = self._icon_color_active self._set_icon_color = self._icon_color_active
self.icon_active(p, icon_path, self.width()) self.icon_active(p, icon_path, self.width())
# DRAW TEXT # DRAW TEXT
p.setPen(QColor(self._set_text_active)) p.setPen(QColor(self._set_text_active))
p.drawText(rect_text, Qt.AlignVCenter, self.text()) p.drawText(rect_text, Qt.AlignVCenter, self.text())
# DRAW ICONS # DRAW ICONS
self.icon_paint(p, self._icon_path, rect_icon, self._set_icon_color) self.icon_paint(p, self._icon_path, rect_icon, self._set_icon_color)
# NORMAL BG # NORMAL BG
else: else:
if self._is_toggle_active: if self._is_toggle_active:
# BG INSIDE # BG INSIDE
p.setBrush(QColor(self._dark_three)) p.setBrush(QColor(self._dark_three))
p.drawRoundedRect(rect_inside, 8, 8) p.drawRoundedRect(rect_inside, 8, 8)
# DRAW TEXT # DRAW TEXT
p.setPen(QColor(self._set_text_foreground)) p.setPen(QColor(self._set_text_foreground))
p.drawText(rect_text, Qt.AlignVCenter, self.text()) p.drawText(rect_text, Qt.AlignVCenter, self.text())
# DRAW ICONS # DRAW ICONS
if self._is_toggle_active: if self._is_toggle_active:
self.icon_paint(p, self._icon_path, rect_icon, self._context_color) self.icon_paint(p, self._icon_path, rect_icon, self._context_color)
else: else:
self.icon_paint(p, self._icon_path, rect_icon, self._set_icon_color) self.icon_paint(p, self._icon_path, rect_icon, self._set_icon_color)
else: else:
# BG INSIDE # BG INSIDE
p.setBrush(QColor(self._set_bg_color)) p.setBrush(QColor(self._set_bg_color))
p.drawRoundedRect(rect_inside, 8, 8) p.drawRoundedRect(rect_inside, 8, 8)
# DRAW TEXT # DRAW TEXT
p.setPen(QColor(self._set_text_foreground)) p.setPen(QColor(self._set_text_foreground))
p.drawText(rect_text, Qt.AlignVCenter, self.text()) p.drawText(rect_text, Qt.AlignVCenter, self.text())
# DRAW ICONS # DRAW ICONS
self.icon_paint(p, self._icon_path, rect_icon, self._set_icon_color) self.icon_paint(p, self._icon_path, rect_icon, self._set_icon_color)
p.end() p.end()
# SET ACTIVE MENU # SET ACTIVE MENU
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def set_active(self, is_active): def set_active(self, is_active):
self._is_active = is_active self._is_active = is_active
if not is_active: if not is_active:
self._set_icon_color = self._icon_color self._set_icon_color = self._icon_color
self._set_bg_color = self._dark_one self._set_bg_color = self._dark_one
self.repaint() self.repaint()
# SET ACTIVE TAB MENU # SET ACTIVE TAB MENU
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def set_active_tab(self, is_active): def set_active_tab(self, is_active):
self._is_active_tab = is_active self._is_active_tab = is_active
if not is_active: if not is_active:
self._set_icon_color = self._icon_color self._set_icon_color = self._icon_color
self._set_bg_color = self._dark_one self._set_bg_color = self._dark_one
self.repaint() self.repaint()
# RETURN IF IS ACTIVE MENU # RETURN IF IS ACTIVE MENU
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def is_active(self): def is_active(self):
return self._is_active return self._is_active
# RETURN IF IS ACTIVE TAB MENU # RETURN IF IS ACTIVE TAB MENU
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def is_active_tab(self): def is_active_tab(self):
return self._is_active_tab return self._is_active_tab
# SET ACTIVE TOGGLE # SET ACTIVE TOGGLE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def set_active_toggle(self, is_active): def set_active_toggle(self, is_active):
self._is_toggle_active = is_active self._is_toggle_active = is_active
# SET ICON # SET ICON
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def set_icon(self, icon_path): def set_icon(self, icon_path):
self._icon_path = icon_path self._icon_path = icon_path
self.repaint() self.repaint()
# DRAW ICON WITH COLORS # DRAW ICON WITH COLORS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def icon_paint(self, qp, image, rect, color): def icon_paint(self, qp, image, rect, color):
icon = QPixmap(image) icon = QPixmap(image)
painter = QPainter(icon) painter = QPainter(icon)
painter.setCompositionMode(QPainter.CompositionMode_SourceIn) painter.setCompositionMode(QPainter.CompositionMode_SourceIn)
painter.fillRect(icon.rect(), color) painter.fillRect(icon.rect(), color)
qp.drawPixmap( qp.drawPixmap(
(rect.width() - icon.width()) / 2, (rect.width() - icon.width()) / 2,
(rect.height() - icon.height()) / 2, (rect.height() - icon.height()) / 2,
icon icon
) )
painter.end() painter.end()
# DRAW ACTIVE ICON / RIGHT SIDE # DRAW ACTIVE ICON / RIGHT SIDE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def icon_active(self, qp, image, width): def icon_active(self, qp, image, width):
icon = QPixmap(image) icon = QPixmap(image)
painter = QPainter(icon) painter = QPainter(icon)
painter.setCompositionMode(QPainter.CompositionMode_SourceIn) painter.setCompositionMode(QPainter.CompositionMode_SourceIn)
painter.fillRect(icon.rect(), self._bg_one) painter.fillRect(icon.rect(), self._bg_one)
qp.drawPixmap(width - 5, 0, icon) qp.drawPixmap(width - 5, 0, icon)
painter.end() painter.end()
# CHANGE STYLES # CHANGE STYLES
# Functions with custom styles # Functions with custom styles
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def change_style(self, event): def change_style(self, event):
if event == QEvent.Enter: if event == QEvent.Enter:
if not self._is_active: if not self._is_active:
self._set_icon_color = self._icon_color_hover self._set_icon_color = self._icon_color_hover
self._set_bg_color = self._dark_three self._set_bg_color = self._dark_three
self.repaint() self.repaint()
elif event == QEvent.Leave: elif event == QEvent.Leave:
if not self._is_active: if not self._is_active:
self._set_icon_color = self._icon_color self._set_icon_color = self._icon_color
self._set_bg_color = self._dark_one self._set_bg_color = self._dark_one
self.repaint() self.repaint()
elif event == QEvent.MouseButtonPress: elif event == QEvent.MouseButtonPress:
if not self._is_active: if not self._is_active:
self._set_icon_color = self._context_color self._set_icon_color = self._context_color
self._set_bg_color = self._dark_four self._set_bg_color = self._dark_four
self.repaint() self.repaint()
elif event == QEvent.MouseButtonRelease: elif event == QEvent.MouseButtonRelease:
if not self._is_active: if not self._is_active:
self._set_icon_color = self._icon_color_hover self._set_icon_color = self._icon_color_hover
self._set_bg_color = self._dark_three self._set_bg_color = self._dark_three
self.repaint() self.repaint()
# MOUSE OVER # MOUSE OVER
# Event triggered when the mouse is over the BTN # Event triggered when the mouse is over the BTN
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def enterEvent(self, event): def enterEvent(self, event):
self.change_style(QEvent.Enter) self.change_style(QEvent.Enter)
if self.width() == 50 and self._tooltip_text: if self.width() == 50 and self._tooltip_text:
self.move_tooltip() self.move_tooltip()
self.tooltip.show() self.tooltip.show()
# MOUSE LEAVE # MOUSE LEAVE
# Event fired when the mouse leaves the BTN # Event fired when the mouse leaves the BTN
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def leaveEvent(self, event): def leaveEvent(self, event):
self.change_style(QEvent.Leave) self.change_style(QEvent.Leave)
self.tooltip.hide() self.tooltip.hide()
# MOUSE PRESS # MOUSE PRESS
# Event triggered when the left button is pressed # Event triggered when the left button is pressed
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def mousePressEvent(self, event): def mousePressEvent(self, event):
if event.button() == Qt.LeftButton: if event.button() == Qt.LeftButton:
self.change_style(QEvent.MouseButtonPress) self.change_style(QEvent.MouseButtonPress)
self.tooltip.hide() self.tooltip.hide()
return self.clicked.emit() return self.clicked.emit()
# MOUSE RELEASED # MOUSE RELEASED
# Event triggered after the mouse button is released # Event triggered after the mouse button is released
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def mouseReleaseEvent(self, event): def mouseReleaseEvent(self, event):
if event.button() == Qt.LeftButton: if event.button() == Qt.LeftButton:
self.change_style(QEvent.MouseButtonRelease) self.change_style(QEvent.MouseButtonRelease)
return self.released.emit() return self.released.emit()
# MOVE TOOLTIP # MOVE TOOLTIP
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def move_tooltip(self): def move_tooltip(self):
# GET MAIN WINDOW PARENT # GET MAIN WINDOW PARENT
gp = self.mapToGlobal(QPoint(0, 0)) gp = self.mapToGlobal(QPoint(0, 0))
# SET WIDGET TO GET POSTION # SET WIDGET TO GET POSTION
# Return absolute position of widget inside app # Return absolute position of widget inside app
pos = self._parent.mapFromGlobal(gp) pos = self._parent.mapFromGlobal(gp)
# FORMAT POSITION # FORMAT POSITION
# Adjust tooltip position with offset # Adjust tooltip position with offset
pos_x = pos.x() + self.width() + 5 pos_x = pos.x() + self.width() + 5
pos_y = pos.y() + (self.width() - self.tooltip.height()) // 2 pos_y = pos.y() + (self.width() - self.tooltip.height()) // 2
# SET POSITION TO WIDGET # SET POSITION TO WIDGET
# Move tooltip position # Move tooltip position
self.tooltip.move(pos_x, pos_y) self.tooltip.move(pos_x, pos_y)
class _ToolTip(QLabel): class _ToolTip(QLabel):
# TOOLTIP / LABEL StyleSheet # TOOLTIP / LABEL StyleSheet
style_tooltip = """ style_tooltip = """
QLabel {{ QLabel {{
background-color: {_dark_one}; background-color: {_dark_one};
color: {_text_foreground}; color: {_text_foreground};
padding-left: 10px; padding-left: 10px;
padding-right: 10px; padding-right: 10px;
border-radius: 17px; border-radius: 17px;
border: 0px solid transparent; border: 0px solid transparent;
border-left: 3px solid {_context_color}; border-left: 3px solid {_context_color};
font: 800 9pt "Segoe UI"; font: 800 9pt "Segoe UI";
}} }}
""" """
def __init__( def __init__(
self, self,
parent, parent,
tooltip, tooltip,
dark_one, dark_one,
context_color, context_color,
text_foreground text_foreground
): ):
QLabel.__init__(self) QLabel.__init__(self)
# LABEL SETUP # LABEL SETUP
style = self.style_tooltip.format( style = self.style_tooltip.format(
_dark_one = dark_one, _dark_one = dark_one,
_context_color = context_color, _context_color = context_color,
_text_foreground = text_foreground _text_foreground = text_foreground
) )
self.setObjectName(u"label_tooltip") self.setObjectName(u"label_tooltip")
self.setStyleSheet(style) self.setStyleSheet(style)
self.setMinimumHeight(34) self.setMinimumHeight(34)
self.setParent(parent) self.setParent(parent)
self.setText(tooltip) self.setText(tooltip)
self.adjustSize() self.adjustSize()
# SET DROP SHADOW # SET DROP SHADOW
self.shadow = QGraphicsDropShadowEffect(self) self.shadow = QGraphicsDropShadowEffect(self)
self.shadow.setBlurRadius(30) self.shadow.setBlurRadius(30)
self.shadow.setXOffset(0) self.shadow.setXOffset(0)
self.shadow.setYOffset(0) self.shadow.setYOffset(0)
self.shadow.setColor(QColor(0, 0, 0, 80)) self.shadow.setColor(QColor(0, 0, 0, 80))
self.setGraphicsEffect(self.shadow) self.setGraphicsEffect(self.shadow)

View File

@@ -1,19 +1,19 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# PY LINE EDIT # PY LINE EDIT
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_line_edit import PyLineEdit from . py_line_edit import PyLineEdit

View File

@@ -1,95 +1,95 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT QT CORE # IMPORT QT CORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from qt_core import * from qt_core import *
# STYLE # STYLE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
style = ''' style = '''
QLineEdit {{ QLineEdit {{
background-color: {_bg_color}; background-color: {_bg_color};
border-radius: {_radius}px; border-radius: {_radius}px;
border: {_border_size}px solid transparent; border: {_border_size}px solid transparent;
padding-left: 10px; padding-left: 10px;
padding-right: 10px; padding-right: 10px;
selection-color: {_selection_color}; selection-color: {_selection_color};
selection-background-color: {_context_color}; selection-background-color: {_context_color};
color: {_color}; color: {_color};
}} }}
QLineEdit:focus {{ QLineEdit:focus {{
border: {_border_size}px solid {_context_color}; border: {_border_size}px solid {_context_color};
background-color: {_bg_color_active}; background-color: {_bg_color_active};
}} }}
''' '''
# PY PUSH BUTTON # PY PUSH BUTTON
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
class PyLineEdit(QLineEdit): class PyLineEdit(QLineEdit):
def __init__( def __init__(
self, self,
text = "", text = "",
place_holder_text = "", place_holder_text = "",
radius = 8, radius = 8,
border_size = 2, border_size = 2,
color = "#FFF", color = "#FFF",
selection_color = "#FFF", selection_color = "#FFF",
bg_color = "#333", bg_color = "#333",
bg_color_active = "#222", bg_color_active = "#222",
context_color = "#00ABE8" context_color = "#00ABE8"
): ):
super().__init__() super().__init__()
# PARAMETERS # PARAMETERS
if text: if text:
self.setText(text) self.setText(text)
if place_holder_text: if place_holder_text:
self.setPlaceholderText(place_holder_text) self.setPlaceholderText(place_holder_text)
# SET STYLESHEET # SET STYLESHEET
self.set_stylesheet( self.set_stylesheet(
radius, radius,
border_size, border_size,
color, color,
selection_color, selection_color,
bg_color, bg_color,
bg_color_active, bg_color_active,
context_color context_color
) )
# SET STYLESHEET # SET STYLESHEET
def set_stylesheet( def set_stylesheet(
self, self,
radius, radius,
border_size, border_size,
color, color,
selection_color, selection_color,
bg_color, bg_color,
bg_color_active, bg_color_active,
context_color context_color
): ):
# APPLY STYLESHEET # APPLY STYLESHEET
style_format = style.format( style_format = style.format(
_radius = radius, _radius = radius,
_border_size = border_size, _border_size = border_size,
_color = color, _color = color,
_selection_color = selection_color, _selection_color = selection_color,
_bg_color = bg_color, _bg_color = bg_color,
_bg_color_active = bg_color_active, _bg_color_active = bg_color_active,
_context_color = context_color _context_color = context_color
) )
self.setStyleSheet(style_format) self.setStyleSheet(style_format)

View File

@@ -1,19 +1,19 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# PY PUSH BUTTON # PY PUSH BUTTON
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_push_button import PyPushButton from . py_push_button import PyPushButton

View File

@@ -1,71 +1,71 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT QT CORE # IMPORT QT CORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from qt_core import * from qt_core import *
# STYLE # STYLE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
style = ''' style = '''
QPushButton {{ QPushButton {{
border: none; border: none;
padding-left: 10px; padding-left: 10px;
padding-right: 5px; padding-right: 5px;
color: {_color}; color: {_color};
border-radius: {_radius}; border-radius: {_radius};
background-color: {_bg_color}; background-color: {_bg_color};
}} }}
QPushButton:hover {{ QPushButton:hover {{
background-color: {_bg_color_hover}; background-color: {_bg_color_hover};
}} }}
QPushButton:pressed {{ QPushButton:pressed {{
background-color: {_bg_color_pressed}; background-color: {_bg_color_pressed};
}} }}
''' '''
# PY PUSH BUTTON # PY PUSH BUTTON
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
class PyPushButton(QPushButton): class PyPushButton(QPushButton):
def __init__( def __init__(
self, self,
text, text,
radius, radius,
color, color,
bg_color, bg_color,
bg_color_hover, bg_color_hover,
bg_color_pressed, bg_color_pressed,
parent = None, parent = None,
): ):
super().__init__() super().__init__()
# SET PARAMETRES # SET PARAMETRES
self.setText(text) self.setText(text)
if parent != None: if parent != None:
self.setParent(parent) self.setParent(parent)
self.setCursor(Qt.PointingHandCursor) self.setCursor(Qt.PointingHandCursor)
# SET STYLESHEET # SET STYLESHEET
custom_style = style.format( custom_style = style.format(
_color = color, _color = color,
_radius = radius, _radius = radius,
_bg_color = bg_color, _bg_color = bg_color,
_bg_color_hover = bg_color_hover, _bg_color_hover = bg_color_hover,
_bg_color_pressed = bg_color_pressed _bg_color_pressed = bg_color_pressed
) )
self.setStyleSheet(custom_style) self.setStyleSheet(custom_style)

View File

@@ -1,19 +1,19 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# PY SLIDER # PY SLIDER
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_slider import PySlider from . py_slider import PySlider

View File

@@ -1,97 +1,97 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT QT CORE # IMPORT QT CORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from qt_core import * from qt_core import *
style = """ style = """
/* HORIZONTAL */ /* HORIZONTAL */
QSlider {{ margin: {_margin}px; }} QSlider {{ margin: {_margin}px; }}
QSlider::groove:horizontal {{ QSlider::groove:horizontal {{
border-radius: {_bg_radius}px; border-radius: {_bg_radius}px;
height: {_bg_size}px; height: {_bg_size}px;
margin: 0px; margin: 0px;
background-color: {_bg_color}; background-color: {_bg_color};
}} }}
QSlider::groove:horizontal:hover {{ background-color: {_bg_color_hover}; }} QSlider::groove:horizontal:hover {{ background-color: {_bg_color_hover}; }}
QSlider::handle:horizontal {{ QSlider::handle:horizontal {{
border: none; border: none;
height: {_handle_size}px; height: {_handle_size}px;
width: {_handle_size}px; width: {_handle_size}px;
margin: {_handle_margin}px; margin: {_handle_margin}px;
border-radius: {_handle_radius}px; border-radius: {_handle_radius}px;
background-color: {_handle_color}; background-color: {_handle_color};
}} }}
QSlider::handle:horizontal:hover {{ background-color: {_handle_color_hover}; }} QSlider::handle:horizontal:hover {{ background-color: {_handle_color_hover}; }}
QSlider::handle:horizontal:pressed {{ background-color: {_handle_color_pressed}; }} QSlider::handle:horizontal:pressed {{ background-color: {_handle_color_pressed}; }}
/* VERTICAL */ /* VERTICAL */
QSlider::groove:vertical {{ QSlider::groove:vertical {{
border-radius: {_bg_radius}px; border-radius: {_bg_radius}px;
width: {_bg_size}px; width: {_bg_size}px;
margin: 0px; margin: 0px;
background-color: {_bg_color}; background-color: {_bg_color};
}} }}
QSlider::groove:vertical:hover {{ background-color: {_bg_color_hover}; }} QSlider::groove:vertical:hover {{ background-color: {_bg_color_hover}; }}
QSlider::handle:vertical {{ QSlider::handle:vertical {{
border: none; border: none;
height: {_handle_size}px; height: {_handle_size}px;
width: {_handle_size}px; width: {_handle_size}px;
margin: {_handle_margin}px; margin: {_handle_margin}px;
border-radius: {_handle_radius}px; border-radius: {_handle_radius}px;
background-color: {_handle_color}; background-color: {_handle_color};
}} }}
QSlider::handle:vertical:hover {{ background-color: {_handle_color_hover}; }} QSlider::handle:vertical:hover {{ background-color: {_handle_color_hover}; }}
QSlider::handle:vertical:pressed {{ background-color: {_handle_color_pressed}; }} QSlider::handle:vertical:pressed {{ background-color: {_handle_color_pressed}; }}
""" """
class PySlider(QSlider): class PySlider(QSlider):
def __init__( def __init__(
self, self,
margin = 0, margin = 0,
bg_size = 20, bg_size = 20,
bg_radius = 10, bg_radius = 10,
bg_color = "#1b1e23", bg_color = "#1b1e23",
bg_color_hover = "#1e2229", bg_color_hover = "#1e2229",
handle_margin = 2, handle_margin = 2,
handle_size = 16, handle_size = 16,
handle_radius = 8, handle_radius = 8,
handle_color = "#568af2", handle_color = "#568af2",
handle_color_hover = "#6c99f4", handle_color_hover = "#6c99f4",
handle_color_pressed = "#3f6fd1" handle_color_pressed = "#3f6fd1"
): ):
super(PySlider, self).__init__() super(PySlider, self).__init__()
# FORMAT STYLE # FORMAT STYLE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
adjust_style = style.format( adjust_style = style.format(
_margin = margin, _margin = margin,
_bg_size = bg_size, _bg_size = bg_size,
_bg_radius = bg_radius, _bg_radius = bg_radius,
_bg_color = bg_color, _bg_color = bg_color,
_bg_color_hover = bg_color_hover, _bg_color_hover = bg_color_hover,
_handle_margin = handle_margin, _handle_margin = handle_margin,
_handle_size = handle_size, _handle_size = handle_size,
_handle_radius = handle_radius, _handle_radius = handle_radius,
_handle_color = handle_color, _handle_color = handle_color,
_handle_color_hover = handle_color_hover, _handle_color_hover = handle_color_hover,
_handle_color_pressed = handle_color_pressed _handle_color_pressed = handle_color_pressed
) )
# APPLY CUSTOM STYLE # APPLY CUSTOM STYLE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.setStyleSheet(adjust_style) self.setStyleSheet(adjust_style)

View File

@@ -1,19 +1,19 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# PY TABLE WIDGET # PY TABLE WIDGET
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_table_widget import PyTableWidget from . py_table_widget import PyTableWidget

View File

@@ -1,90 +1,90 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT QT CORE # IMPORT QT CORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from qt_core import * from qt_core import *
# IMPORT STYLE # IMPORT STYLE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . style import * from . style import *
# PY PUSH BUTTON # PY PUSH BUTTON
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
class PyTableWidget(QTableWidget): class PyTableWidget(QTableWidget):
def __init__( def __init__(
self, self,
radius = 8, radius = 8,
color = "#FFF", color = "#FFF",
bg_color = "#444", bg_color = "#444",
selection_color = "#FFF", selection_color = "#FFF",
header_horizontal_color = "#333", header_horizontal_color = "#333",
header_vertical_color = "#444", header_vertical_color = "#444",
bottom_line_color = "#555", bottom_line_color = "#555",
grid_line_color = "#555", grid_line_color = "#555",
scroll_bar_bg_color = "#FFF", scroll_bar_bg_color = "#FFF",
scroll_bar_btn_color = "#3333", scroll_bar_btn_color = "#3333",
context_color = "#00ABE8" context_color = "#00ABE8"
): ):
super().__init__() super().__init__()
# PARAMETERS # PARAMETERS
# SET STYLESHEET # SET STYLESHEET
self.set_stylesheet( self.set_stylesheet(
radius, radius,
color, color,
bg_color, bg_color,
header_horizontal_color, header_horizontal_color,
header_vertical_color, header_vertical_color,
selection_color, selection_color,
bottom_line_color, bottom_line_color,
grid_line_color, grid_line_color,
scroll_bar_bg_color, scroll_bar_bg_color,
scroll_bar_btn_color, scroll_bar_btn_color,
context_color context_color
) )
# SET STYLESHEET # SET STYLESHEET
def set_stylesheet( def set_stylesheet(
self, self,
radius, radius,
color, color,
bg_color, bg_color,
header_horizontal_color, header_horizontal_color,
header_vertical_color, header_vertical_color,
selection_color, selection_color,
bottom_line_color, bottom_line_color,
grid_line_color, grid_line_color,
scroll_bar_bg_color, scroll_bar_bg_color,
scroll_bar_btn_color, scroll_bar_btn_color,
context_color context_color
): ):
# APPLY STYLESHEET # APPLY STYLESHEET
style_format = style.format( style_format = style.format(
_radius = radius, _radius = radius,
_color = color, _color = color,
_bg_color = bg_color, _bg_color = bg_color,
_header_horizontal_color = header_horizontal_color, _header_horizontal_color = header_horizontal_color,
_header_vertical_color = header_vertical_color, _header_vertical_color = header_vertical_color,
_selection_color = selection_color, _selection_color = selection_color,
_bottom_line_color = bottom_line_color, _bottom_line_color = bottom_line_color,
_grid_line_color = grid_line_color, _grid_line_color = grid_line_color,
_scroll_bar_bg_color = scroll_bar_bg_color, _scroll_bar_bg_color = scroll_bar_bg_color,
_scroll_bar_btn_color = scroll_bar_btn_color, _scroll_bar_btn_color = scroll_bar_btn_color,
_context_color = context_color _context_color = context_color
) )
self.setStyleSheet(style_format) self.setStyleSheet(style_format)

View File

@@ -1,135 +1,135 @@
# STYLE # STYLE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
style = ''' style = '''
/* ///////////////////////////////////////////////////////////////////////////////////////////////// /* /////////////////////////////////////////////////////////////////////////////////////////////////
QTableWidget */ QTableWidget */
QTableWidget {{ QTableWidget {{
background-color: {_bg_color}; background-color: {_bg_color};
padding: 5px; padding: 5px;
border-radius: {_radius}px; border-radius: {_radius}px;
gridline-color: {_grid_line_color}; gridline-color: {_grid_line_color};
color: {_color}; color: {_color};
}} }}
QTableWidget::item{{ QTableWidget::item{{
border-color: none; border-color: none;
padding-left: 5px; padding-left: 5px;
padding-right: 5px; padding-right: 5px;
gridline-color: rgb(44, 49, 60); gridline-color: rgb(44, 49, 60);
border-bottom: 1px solid {_bottom_line_color}; border-bottom: 1px solid {_bottom_line_color};
}} }}
QTableWidget::item:selected{{ QTableWidget::item:selected{{
background-color: {_selection_color}; background-color: {_selection_color};
}} }}
QHeaderView::section{{ QHeaderView::section{{
background-color: rgb(33, 37, 43); background-color: rgb(33, 37, 43);
max-width: 30px; max-width: 30px;
border: 1px solid rgb(44, 49, 58); border: 1px solid rgb(44, 49, 58);
border-style: none; border-style: none;
border-bottom: 1px solid rgb(44, 49, 60); border-bottom: 1px solid rgb(44, 49, 60);
border-right: 1px solid rgb(44, 49, 60); border-right: 1px solid rgb(44, 49, 60);
}} }}
QTableWidget::horizontalHeader {{ QTableWidget::horizontalHeader {{
background-color: rgb(33, 37, 43); background-color: rgb(33, 37, 43);
}} }}
QTableWidget QTableCornerButton::section {{ QTableWidget QTableCornerButton::section {{
border: none; border: none;
background-color: {_header_horizontal_color}; background-color: {_header_horizontal_color};
padding: 3px; padding: 3px;
border-top-left-radius: {_radius}px; border-top-left-radius: {_radius}px;
}} }}
QHeaderView::section:horizontal QHeaderView::section:horizontal
{{ {{
border: none; border: none;
background-color: {_header_horizontal_color}; background-color: {_header_horizontal_color};
padding: 3px; padding: 3px;
}} }}
QHeaderView::section:vertical QHeaderView::section:vertical
{{ {{
border: none; border: none;
background-color: {_header_vertical_color}; background-color: {_header_vertical_color};
padding-left: 5px; padding-left: 5px;
padding-right: 5px; padding-right: 5px;
border-bottom: 1px solid {_bottom_line_color}; border-bottom: 1px solid {_bottom_line_color};
margin-bottom: 1px; margin-bottom: 1px;
}} }}
/* ///////////////////////////////////////////////////////////////////////////////////////////////// /* /////////////////////////////////////////////////////////////////////////////////////////////////
ScrollBars */ ScrollBars */
QScrollBar:horizontal {{ QScrollBar:horizontal {{
border: none; border: none;
background: {_scroll_bar_bg_color}; background: {_scroll_bar_bg_color};
height: 8px; height: 8px;
margin: 0px 21px 0 21px; margin: 0px 21px 0 21px;
border-radius: 0px; border-radius: 0px;
}} }}
QScrollBar::handle:horizontal {{ QScrollBar::handle:horizontal {{
background: {_context_color}; background: {_context_color};
min-width: 25px; min-width: 25px;
border-radius: 4px border-radius: 4px
}} }}
QScrollBar::add-line:horizontal {{ QScrollBar::add-line:horizontal {{
border: none; border: none;
background: {_scroll_bar_btn_color}; background: {_scroll_bar_btn_color};
width: 20px; width: 20px;
border-top-right-radius: 4px; border-top-right-radius: 4px;
border-bottom-right-radius: 4px; border-bottom-right-radius: 4px;
subcontrol-position: right; subcontrol-position: right;
subcontrol-origin: margin; subcontrol-origin: margin;
}} }}
QScrollBar::sub-line:horizontal {{ QScrollBar::sub-line:horizontal {{
border: none; border: none;
background: {_scroll_bar_btn_color}; background: {_scroll_bar_btn_color};
width: 20px; width: 20px;
border-top-left-radius: 4px; border-top-left-radius: 4px;
border-bottom-left-radius: 4px; border-bottom-left-radius: 4px;
subcontrol-position: left; subcontrol-position: left;
subcontrol-origin: margin; subcontrol-origin: margin;
}} }}
QScrollBar::up-arrow:horizontal, QScrollBar::down-arrow:horizontal QScrollBar::up-arrow:horizontal, QScrollBar::down-arrow:horizontal
{{ {{
background: none; background: none;
}} }}
QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal
{{ {{
background: none; background: none;
}} }}
QScrollBar:vertical {{ QScrollBar:vertical {{
border: none; border: none;
background: {_scroll_bar_bg_color}; background: {_scroll_bar_bg_color};
width: 8px; width: 8px;
margin: 21px 0 21px 0; margin: 21px 0 21px 0;
border-radius: 0px; border-radius: 0px;
}} }}
QScrollBar::handle:vertical {{ QScrollBar::handle:vertical {{
background: {_context_color}; background: {_context_color};
min-height: 25px; min-height: 25px;
border-radius: 4px border-radius: 4px
}} }}
QScrollBar::add-line:vertical {{ QScrollBar::add-line:vertical {{
border: none; border: none;
background: {_scroll_bar_btn_color}; background: {_scroll_bar_btn_color};
height: 20px; height: 20px;
border-bottom-left-radius: 4px; border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px; border-bottom-right-radius: 4px;
subcontrol-position: bottom; subcontrol-position: bottom;
subcontrol-origin: margin; subcontrol-origin: margin;
}} }}
QScrollBar::sub-line:vertical {{ QScrollBar::sub-line:vertical {{
border: none; border: none;
background: {_scroll_bar_btn_color}; background: {_scroll_bar_btn_color};
height: 20px; height: 20px;
border-top-left-radius: 4px; border-top-left-radius: 4px;
border-top-right-radius: 4px; border-top-right-radius: 4px;
subcontrol-position: top; subcontrol-position: top;
subcontrol-origin: margin; subcontrol-origin: margin;
}} }}
QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical {{ QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical {{
background: none; background: none;
}} }}
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {{ QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {{
background: none; background: none;
}} }}
''' '''

View File

@@ -1,21 +1,21 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# PY TITLE BAR # PY TITLE BAR
# Top bar with move application, maximize, restore, minimize, # Top bar with move application, maximize, restore, minimize,
# close buttons and extra buttons # close buttons and extra buttons
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_title_bar import PyTitleBar from . py_title_bar import PyTitleBar

View File

@@ -1,35 +1,35 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT QT CORE # IMPORT QT CORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from qt_core import * from qt_core import *
# CUSTOM LEFT MENU # CUSTOM LEFT MENU
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
class PyDiv(QWidget): class PyDiv(QWidget):
def __init__(self, color): def __init__(self, color):
super().__init__() super().__init__()
self.layout = QHBoxLayout(self) self.layout = QHBoxLayout(self)
self.layout.setContentsMargins(0,5,0,5) self.layout.setContentsMargins(0,5,0,5)
self.frame_line = QFrame() self.frame_line = QFrame()
self.frame_line.setStyleSheet(f"background: {color};") self.frame_line.setStyleSheet(f"background: {color};")
self.frame_line.setMaximumWidth(1) self.frame_line.setMaximumWidth(1)
self.frame_line.setMinimumWidth(1) self.frame_line.setMinimumWidth(1)
self.layout.addWidget(self.frame_line) self.layout.addWidget(self.frame_line)
self.setMaximumWidth(20) self.setMaximumWidth(20)
self.setMinimumWidth(20) self.setMinimumWidth(20)

View File

@@ -1,346 +1,346 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT QT CORE # IMPORT QT CORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from qt_core import * from qt_core import *
# IMPORT FUNCTIONS # IMPORT FUNCTIONS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from gui.core.functions import * from gui.core.functions import *
# IMPORT SETTINGS # IMPORT SETTINGS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from gui.core.json_settings import Settings from gui.core.json_settings import Settings
# IMPORT DIV # IMPORT DIV
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_div import PyDiv from . py_div import PyDiv
# IMPORT BUTTON # IMPORT BUTTON
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_title_button import PyTitleButton from . py_title_button import PyTitleButton
# GLOBALS # GLOBALS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
_is_maximized = False _is_maximized = False
_old_size = QSize() _old_size = QSize()
# PY TITLE BAR # PY TITLE BAR
# Top bar with move application, maximize, restore, minimize, # Top bar with move application, maximize, restore, minimize,
# close buttons and extra buttons # close buttons and extra buttons
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
class PyTitleBar(QWidget): class PyTitleBar(QWidget):
# SIGNALS # SIGNALS
clicked = Signal(object) clicked = Signal(object)
released = Signal(object) released = Signal(object)
def __init__( def __init__(
self, self,
parent, parent,
app_parent, app_parent,
logo_image = "logo_top_100x22.svg", logo_image = "logo_top_100x22.svg",
logo_width = 100, logo_width = 100,
buttons = None, buttons = None,
dark_one = "#1b1e23", dark_one = "#1b1e23",
bg_color = "#343b48", bg_color = "#343b48",
div_color = "#3c4454", div_color = "#3c4454",
btn_bg_color = "#343b48", btn_bg_color = "#343b48",
btn_bg_color_hover = "#3c4454", btn_bg_color_hover = "#3c4454",
btn_bg_color_pressed = "#2c313c", btn_bg_color_pressed = "#2c313c",
icon_color = "#c3ccdf", icon_color = "#c3ccdf",
icon_color_hover = "#dce1ec", icon_color_hover = "#dce1ec",
icon_color_pressed = "#edf0f5", icon_color_pressed = "#edf0f5",
icon_color_active = "#f5f6f9", icon_color_active = "#f5f6f9",
context_color = "#6c99f4", context_color = "#6c99f4",
text_foreground = "#8a95aa", text_foreground = "#8a95aa",
radius = 8, radius = 8,
font_family = "Segoe UI", font_family = "Segoe UI",
title_size = 10, title_size = 10,
is_custom_title_bar = True, is_custom_title_bar = True,
): ):
super().__init__() super().__init__()
settings = Settings() settings = Settings()
self.settings = settings.items self.settings = settings.items
# PARAMETERS # PARAMETERS
self._logo_image = logo_image self._logo_image = logo_image
self._dark_one = dark_one self._dark_one = dark_one
self._bg_color = bg_color self._bg_color = bg_color
self._div_color = div_color self._div_color = div_color
self._parent = parent self._parent = parent
self._app_parent = app_parent self._app_parent = app_parent
self._btn_bg_color = btn_bg_color self._btn_bg_color = btn_bg_color
self._btn_bg_color_hover = btn_bg_color_hover self._btn_bg_color_hover = btn_bg_color_hover
self._btn_bg_color_pressed = btn_bg_color_pressed self._btn_bg_color_pressed = btn_bg_color_pressed
self._context_color = context_color self._context_color = context_color
self._icon_color = icon_color self._icon_color = icon_color
self._icon_color_hover = icon_color_hover self._icon_color_hover = icon_color_hover
self._icon_color_pressed = icon_color_pressed self._icon_color_pressed = icon_color_pressed
self._icon_color_active = icon_color_active self._icon_color_active = icon_color_active
self._font_family = font_family self._font_family = font_family
self._title_size = title_size self._title_size = title_size
self._text_foreground = text_foreground self._text_foreground = text_foreground
self._is_custom_title_bar = is_custom_title_bar self._is_custom_title_bar = is_custom_title_bar
# SETUP UI # SETUP UI
self.setup_ui() self.setup_ui()
# ADD BG COLOR # ADD BG COLOR
self.bg.setStyleSheet(f"background-color: {bg_color}; border-radius: {radius}px;") self.bg.setStyleSheet(f"background-color: {bg_color}; border-radius: {radius}px;")
# SET LOGO AND WIDTH # SET LOGO AND WIDTH
self.top_logo.setMinimumWidth(logo_width) self.top_logo.setMinimumWidth(logo_width)
self.top_logo.setMaximumWidth(logo_width) self.top_logo.setMaximumWidth(logo_width)
#self.top_logo.setPixmap(Functions.set_svg_image(logo_image)) #self.top_logo.setPixmap(Functions.set_svg_image(logo_image))
# MOVE WINDOW / MAXIMIZE / RESTORE # MOVE WINDOW / MAXIMIZE / RESTORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def moveWindow(event): def moveWindow(event):
# IF MAXIMIZED CHANGE TO NORMAL # IF MAXIMIZED CHANGE TO NORMAL
if parent.isMaximized(): if parent.isMaximized():
self.maximize_restore() self.maximize_restore()
#self.resize(_old_size) #self.resize(_old_size)
curso_x = parent.pos().x() curso_x = parent.pos().x()
curso_y = event.globalPos().y() - QCursor.pos().y() curso_y = event.globalPos().y() - QCursor.pos().y()
parent.move(curso_x, curso_y) parent.move(curso_x, curso_y)
# MOVE WINDOW # MOVE WINDOW
if event.buttons() == Qt.LeftButton: if event.buttons() == Qt.LeftButton:
parent.move(parent.pos() + event.globalPos() - parent.dragPos) parent.move(parent.pos() + event.globalPos() - parent.dragPos)
parent.dragPos = event.globalPos() parent.dragPos = event.globalPos()
event.accept() event.accept()
# MOVE APP WIDGETS # MOVE APP WIDGETS
if is_custom_title_bar: if is_custom_title_bar:
self.top_logo.mouseMoveEvent = moveWindow self.top_logo.mouseMoveEvent = moveWindow
self.div_1.mouseMoveEvent = moveWindow self.div_1.mouseMoveEvent = moveWindow
self.title_label.mouseMoveEvent = moveWindow self.title_label.mouseMoveEvent = moveWindow
self.div_2.mouseMoveEvent = moveWindow self.div_2.mouseMoveEvent = moveWindow
self.div_3.mouseMoveEvent = moveWindow self.div_3.mouseMoveEvent = moveWindow
# MAXIMIZE / RESTORE # MAXIMIZE / RESTORE
if is_custom_title_bar: if is_custom_title_bar:
self.top_logo.mouseDoubleClickEvent = self.maximize_restore self.top_logo.mouseDoubleClickEvent = self.maximize_restore
self.div_1.mouseDoubleClickEvent = self.maximize_restore self.div_1.mouseDoubleClickEvent = self.maximize_restore
self.title_label.mouseDoubleClickEvent = self.maximize_restore self.title_label.mouseDoubleClickEvent = self.maximize_restore
self.div_2.mouseDoubleClickEvent = self.maximize_restore self.div_2.mouseDoubleClickEvent = self.maximize_restore
# ADD WIDGETS TO TITLE BAR # ADD WIDGETS TO TITLE BAR
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.bg_layout.addWidget(self.top_logo) self.bg_layout.addWidget(self.top_logo)
self.bg_layout.addWidget(self.div_1) self.bg_layout.addWidget(self.div_1)
self.bg_layout.addWidget(self.title_label) self.bg_layout.addWidget(self.title_label)
self.bg_layout.addWidget(self.div_2) self.bg_layout.addWidget(self.div_2)
# ADD BUTTONS BUTTONS # ADD BUTTONS BUTTONS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# Functions # Functions
self.minimize_button.released.connect(lambda: parent.showMinimized()) self.minimize_button.released.connect(lambda: parent.showMinimized())
self.maximize_restore_button.released.connect(lambda: self.maximize_restore()) self.maximize_restore_button.released.connect(lambda: self.maximize_restore())
self.close_button.released.connect(lambda: parent.close()) self.close_button.released.connect(lambda: parent.close())
# Extra BTNs layout # Extra BTNs layout
self.bg_layout.addLayout(self.custom_buttons_layout) self.bg_layout.addLayout(self.custom_buttons_layout)
# ADD Buttons # ADD Buttons
if is_custom_title_bar: if is_custom_title_bar:
self.bg_layout.addWidget(self.minimize_button) self.bg_layout.addWidget(self.minimize_button)
self.bg_layout.addWidget(self.maximize_restore_button) self.bg_layout.addWidget(self.maximize_restore_button)
self.bg_layout.addWidget(self.close_button) self.bg_layout.addWidget(self.close_button)
# ADD BUTTONS TO TITLE BAR # ADD BUTTONS TO TITLE BAR
# Add btns and emit signals # Add btns and emit signals
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def add_menus(self, parameters): def add_menus(self, parameters):
if parameters != None and len(parameters) > 0: if parameters != None and len(parameters) > 0:
for parameter in parameters: for parameter in parameters:
_btn_icon = Functions.set_svg_icon(parameter['btn_icon']) _btn_icon = Functions.set_svg_icon(parameter['btn_icon'])
_btn_id = parameter['btn_id'] _btn_id = parameter['btn_id']
_btn_tooltip = parameter['btn_tooltip'] _btn_tooltip = parameter['btn_tooltip']
_is_active = parameter['is_active'] _is_active = parameter['is_active']
self.menu = PyTitleButton( self.menu = PyTitleButton(
self._parent, self._parent,
self._app_parent, self._app_parent,
btn_id = _btn_id, btn_id = _btn_id,
tooltip_text = _btn_tooltip, tooltip_text = _btn_tooltip,
dark_one = self._dark_one, dark_one = self._dark_one,
bg_color = self._bg_color, bg_color = self._bg_color,
bg_color_hover = self._btn_bg_color_hover, bg_color_hover = self._btn_bg_color_hover,
bg_color_pressed = self._btn_bg_color_pressed, bg_color_pressed = self._btn_bg_color_pressed,
icon_color = self._icon_color, icon_color = self._icon_color,
icon_color_hover = self._icon_color_active, icon_color_hover = self._icon_color_active,
icon_color_pressed = self._icon_color_pressed, icon_color_pressed = self._icon_color_pressed,
icon_color_active = self._icon_color_active, icon_color_active = self._icon_color_active,
context_color = self._context_color, context_color = self._context_color,
text_foreground = self._text_foreground, text_foreground = self._text_foreground,
icon_path = _btn_icon, icon_path = _btn_icon,
is_active = _is_active is_active = _is_active
) )
self.menu.clicked.connect(self.btn_clicked) self.menu.clicked.connect(self.btn_clicked)
self.menu.released.connect(self.btn_released) self.menu.released.connect(self.btn_released)
# ADD TO LAYOUT # ADD TO LAYOUT
self.custom_buttons_layout.addWidget(self.menu) self.custom_buttons_layout.addWidget(self.menu)
# ADD DIV # ADD DIV
if self._is_custom_title_bar: if self._is_custom_title_bar:
self.custom_buttons_layout.addWidget(self.div_3) self.custom_buttons_layout.addWidget(self.div_3)
# TITLE BAR MENU EMIT SIGNALS # TITLE BAR MENU EMIT SIGNALS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def btn_clicked(self): def btn_clicked(self):
self.clicked.emit(self.menu) self.clicked.emit(self.menu)
def btn_released(self): def btn_released(self):
self.released.emit(self.menu) self.released.emit(self.menu)
# SET TITLE BAR TEXT # SET TITLE BAR TEXT
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def set_title(self, title): def set_title(self, title):
self.title_label.setText(title) self.title_label.setText(title)
# MAXIMIZE / RESTORE # MAXIMIZE / RESTORE
# maximize and restore parent window # maximize and restore parent window
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def maximize_restore(self, e = None): def maximize_restore(self, e = None):
global _is_maximized global _is_maximized
global _old_size global _old_size
# CHANGE UI AND RESIZE GRIP # CHANGE UI AND RESIZE GRIP
def change_ui(): def change_ui():
if _is_maximized: if _is_maximized:
self._parent.ui.central_widget_layout.setContentsMargins(0,0,0,0) self._parent.ui.central_widget_layout.setContentsMargins(0,0,0,0)
self._parent.ui.window.set_stylesheet(border_radius = 0, border_size = 0) self._parent.ui.window.set_stylesheet(border_radius = 0, border_size = 0)
self.maximize_restore_button.set_icon( self.maximize_restore_button.set_icon(
Functions.set_svg_icon("icon_restore.svg") Functions.set_svg_icon("icon_restore.svg")
) )
else: else:
self._parent.ui.central_widget_layout.setContentsMargins(10,10,10,10) self._parent.ui.central_widget_layout.setContentsMargins(10,10,10,10)
self._parent.ui.window.set_stylesheet(border_radius = 10, border_size = 2) self._parent.ui.window.set_stylesheet(border_radius = 10, border_size = 2)
self.maximize_restore_button.set_icon( self.maximize_restore_button.set_icon(
Functions.set_svg_icon("icon_maximize.svg") Functions.set_svg_icon("icon_maximize.svg")
) )
# CHECK EVENT # CHECK EVENT
if self._parent.isMaximized(): if self._parent.isMaximized():
_is_maximized = False _is_maximized = False
self._parent.showNormal() self._parent.showNormal()
change_ui() change_ui()
else: else:
_is_maximized = True _is_maximized = True
_old_size = QSize(self._parent.width(), self._parent.height()) _old_size = QSize(self._parent.width(), self._parent.height())
self._parent.showMaximized() self._parent.showMaximized()
change_ui() change_ui()
# SETUP APP # SETUP APP
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def setup_ui(self): def setup_ui(self):
# ADD MENU LAYOUT # ADD MENU LAYOUT
self.title_bar_layout = QVBoxLayout(self) self.title_bar_layout = QVBoxLayout(self)
self.title_bar_layout.setContentsMargins(0,0,0,0) self.title_bar_layout.setContentsMargins(0,0,0,0)
# ADD BG # ADD BG
self.bg = QFrame() self.bg = QFrame()
# ADD BG LAYOUT # ADD BG LAYOUT
self.bg_layout = QHBoxLayout(self.bg) self.bg_layout = QHBoxLayout(self.bg)
self.bg_layout.setContentsMargins(10,0,5,0) self.bg_layout.setContentsMargins(10,0,5,0)
self.bg_layout.setSpacing(0) self.bg_layout.setSpacing(0)
# DIVS # DIVS
self.div_1 = PyDiv(self._div_color) self.div_1 = PyDiv(self._div_color)
self.div_2 = PyDiv(self._div_color) self.div_2 = PyDiv(self._div_color)
self.div_3 = PyDiv(self._div_color) self.div_3 = PyDiv(self._div_color)
# LEFT FRAME WITH MOVE APP # LEFT FRAME WITH MOVE APP
self.top_logo = QLabel() self.top_logo = QLabel()
self.top_logo_layout = QVBoxLayout(self.top_logo) self.top_logo_layout = QVBoxLayout(self.top_logo)
self.top_logo_layout.setContentsMargins(0,0,0,0) self.top_logo_layout.setContentsMargins(0,0,0,0)
self.logo_svg = QSvgWidget() self.logo_svg = QSvgWidget()
self.logo_svg.load(Functions.set_svg_image(self._logo_image)) self.logo_svg.load(Functions.set_svg_image(self._logo_image))
self.top_logo_layout.addWidget(self.logo_svg, Qt.AlignCenter, Qt.AlignCenter) self.top_logo_layout.addWidget(self.logo_svg, Qt.AlignCenter, Qt.AlignCenter)
# TITLE LABEL # TITLE LABEL
self.title_label = QLabel() self.title_label = QLabel()
self.title_label.setAlignment(Qt.AlignVCenter) self.title_label.setAlignment(Qt.AlignVCenter)
self.title_label.setStyleSheet(f'font: {self._title_size}pt "{self._font_family}"') self.title_label.setStyleSheet(f'font: {self._title_size}pt "{self._font_family}"')
# CUSTOM BUTTONS LAYOUT # CUSTOM BUTTONS LAYOUT
self.custom_buttons_layout = QHBoxLayout() self.custom_buttons_layout = QHBoxLayout()
self.custom_buttons_layout.setContentsMargins(0,0,0,0) self.custom_buttons_layout.setContentsMargins(0,0,0,0)
self.custom_buttons_layout.setSpacing(3) self.custom_buttons_layout.setSpacing(3)
# MINIMIZE BUTTON # MINIMIZE BUTTON
self.minimize_button = PyTitleButton( self.minimize_button = PyTitleButton(
self._parent, self._parent,
self._app_parent, self._app_parent,
tooltip_text = "Close app", tooltip_text = "Close app",
dark_one = self._dark_one, dark_one = self._dark_one,
bg_color = self._btn_bg_color, bg_color = self._btn_bg_color,
bg_color_hover = self._btn_bg_color_hover, bg_color_hover = self._btn_bg_color_hover,
bg_color_pressed = self._btn_bg_color_pressed, bg_color_pressed = self._btn_bg_color_pressed,
icon_color = self._icon_color, icon_color = self._icon_color,
icon_color_hover = self._icon_color_hover, icon_color_hover = self._icon_color_hover,
icon_color_pressed = self._icon_color_pressed, icon_color_pressed = self._icon_color_pressed,
icon_color_active = self._icon_color_active, icon_color_active = self._icon_color_active,
context_color = self._context_color, context_color = self._context_color,
text_foreground = self._text_foreground, text_foreground = self._text_foreground,
radius = 6, radius = 6,
icon_path = Functions.set_svg_icon("icon_minimize.svg") icon_path = Functions.set_svg_icon("icon_minimize.svg")
) )
# MAXIMIZE / RESTORE BUTTON # MAXIMIZE / RESTORE BUTTON
self.maximize_restore_button = PyTitleButton( self.maximize_restore_button = PyTitleButton(
self._parent, self._parent,
self._app_parent, self._app_parent,
tooltip_text = "Maximize app", tooltip_text = "Maximize app",
dark_one = self._dark_one, dark_one = self._dark_one,
bg_color = self._btn_bg_color, bg_color = self._btn_bg_color,
bg_color_hover = self._btn_bg_color_hover, bg_color_hover = self._btn_bg_color_hover,
bg_color_pressed = self._btn_bg_color_pressed, bg_color_pressed = self._btn_bg_color_pressed,
icon_color = self._icon_color, icon_color = self._icon_color,
icon_color_hover = self._icon_color_hover, icon_color_hover = self._icon_color_hover,
icon_color_pressed = self._icon_color_pressed, icon_color_pressed = self._icon_color_pressed,
icon_color_active = self._icon_color_active, icon_color_active = self._icon_color_active,
context_color = self._context_color, context_color = self._context_color,
text_foreground = self._text_foreground, text_foreground = self._text_foreground,
radius = 6, radius = 6,
icon_path = Functions.set_svg_icon("icon_maximize.svg") icon_path = Functions.set_svg_icon("icon_maximize.svg")
) )
# CLOSE BUTTON # CLOSE BUTTON
self.close_button = PyTitleButton( self.close_button = PyTitleButton(
self._parent, self._parent,
self._app_parent, self._app_parent,
tooltip_text = "Close app", tooltip_text = "Close app",
dark_one = self._dark_one, dark_one = self._dark_one,
bg_color = self._btn_bg_color, bg_color = self._btn_bg_color,
bg_color_hover = self._btn_bg_color_hover, bg_color_hover = self._btn_bg_color_hover,
bg_color_pressed = self._context_color, bg_color_pressed = self._context_color,
icon_color = self._icon_color, icon_color = self._icon_color,
icon_color_hover = self._icon_color_hover, icon_color_hover = self._icon_color_hover,
icon_color_pressed = self._icon_color_active, icon_color_pressed = self._icon_color_active,
icon_color_active = self._icon_color_active, icon_color_active = self._icon_color_active,
context_color = self._context_color, context_color = self._context_color,
text_foreground = self._text_foreground, text_foreground = self._text_foreground,
radius = 6, radius = 6,
icon_path = Functions.set_svg_icon("icon_close.svg") icon_path = Functions.set_svg_icon("icon_close.svg")
) )
# ADD TO LAYOUT # ADD TO LAYOUT
self.title_bar_layout.addWidget(self.bg) self.title_bar_layout.addWidget(self.bg)

View File

@@ -1,271 +1,271 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT QT CORE # IMPORT QT CORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from qt_core import * from qt_core import *
# PY TITLE BUTTON # PY TITLE BUTTON
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
class PyTitleButton(QPushButton): class PyTitleButton(QPushButton):
def __init__( def __init__(
self, self,
parent, parent,
app_parent = None, app_parent = None,
tooltip_text = "", tooltip_text = "",
btn_id = None, btn_id = None,
width = 30, width = 30,
height = 30, height = 30,
radius = 8, radius = 8,
bg_color = "#343b48", bg_color = "#343b48",
bg_color_hover = "#3c4454", bg_color_hover = "#3c4454",
bg_color_pressed = "#2c313c", bg_color_pressed = "#2c313c",
icon_color = "#c3ccdf", icon_color = "#c3ccdf",
icon_color_hover = "#dce1ec", icon_color_hover = "#dce1ec",
icon_color_pressed = "#edf0f5", icon_color_pressed = "#edf0f5",
icon_color_active = "#f5f6f9", icon_color_active = "#f5f6f9",
icon_path = "no_icon.svg", icon_path = "no_icon.svg",
dark_one = "#1b1e23", dark_one = "#1b1e23",
context_color = "#568af2", context_color = "#568af2",
text_foreground = "#8a95aa", text_foreground = "#8a95aa",
is_active = False is_active = False
): ):
super().__init__() super().__init__()
# SET DEFAULT PARAMETERS # SET DEFAULT PARAMETERS
self.setFixedSize(width, height) self.setFixedSize(width, height)
self.setCursor(Qt.PointingHandCursor) self.setCursor(Qt.PointingHandCursor)
self.setObjectName(btn_id) self.setObjectName(btn_id)
# PROPERTIES # PROPERTIES
self._bg_color = bg_color self._bg_color = bg_color
self._bg_color_hover = bg_color_hover self._bg_color_hover = bg_color_hover
self._bg_color_pressed = bg_color_pressed self._bg_color_pressed = bg_color_pressed
self._icon_color = icon_color self._icon_color = icon_color
self._icon_color_hover = icon_color_hover self._icon_color_hover = icon_color_hover
self._icon_color_pressed = icon_color_pressed self._icon_color_pressed = icon_color_pressed
self._icon_color_active = icon_color_active self._icon_color_active = icon_color_active
self._context_color = context_color self._context_color = context_color
self._top_margin = self.height() + 6 self._top_margin = self.height() + 6
self._is_active = is_active self._is_active = is_active
# Set Parameters # Set Parameters
self._set_bg_color = bg_color self._set_bg_color = bg_color
self._set_icon_path = icon_path self._set_icon_path = icon_path
self._set_icon_color = icon_color self._set_icon_color = icon_color
self._set_border_radius = radius self._set_border_radius = radius
# Parent # Parent
self._parent = parent self._parent = parent
self._app_parent = app_parent self._app_parent = app_parent
# TOOLTIP # TOOLTIP
self._tooltip_text = tooltip_text self._tooltip_text = tooltip_text
self._tooltip = _ToolTip( self._tooltip = _ToolTip(
app_parent, app_parent,
tooltip_text, tooltip_text,
dark_one, dark_one,
context_color, context_color,
text_foreground text_foreground
) )
self._tooltip.hide() self._tooltip.hide()
# SET ACTIVE MENU # SET ACTIVE MENU
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def set_active(self, is_active): def set_active(self, is_active):
self._is_active = is_active self._is_active = is_active
self.repaint() self.repaint()
# RETURN IF IS ACTIVE MENU # RETURN IF IS ACTIVE MENU
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def is_active(self): def is_active(self):
return self._is_active return self._is_active
# PAINT EVENT # PAINT EVENT
# painting the button and the icon # painting the button and the icon
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def paintEvent(self, event): def paintEvent(self, event):
# PAINTER # PAINTER
paint = QPainter() paint = QPainter()
paint.begin(self) paint.begin(self)
paint.setRenderHint(QPainter.RenderHint.Antialiasing) paint.setRenderHint(QPainter.RenderHint.Antialiasing)
if self._is_active: if self._is_active:
# BRUSH # BRUSH
brush = QBrush(QColor(self._context_color)) brush = QBrush(QColor(self._context_color))
else: else:
# BRUSH # BRUSH
brush = QBrush(QColor(self._set_bg_color)) brush = QBrush(QColor(self._set_bg_color))
# CREATE RECTANGLE # CREATE RECTANGLE
rect = QRect(0, 0, self.width(), self.height()) rect = QRect(0, 0, self.width(), self.height())
paint.setPen(Qt.NoPen) paint.setPen(Qt.NoPen)
paint.setBrush(brush) paint.setBrush(brush)
paint.drawRoundedRect( paint.drawRoundedRect(
rect, rect,
self._set_border_radius, self._set_border_radius,
self._set_border_radius self._set_border_radius
) )
# DRAW ICONS # DRAW ICONS
self.icon_paint(paint, self._set_icon_path, rect) self.icon_paint(paint, self._set_icon_path, rect)
# END PAINTER # END PAINTER
paint.end() paint.end()
# CHANGE STYLES # CHANGE STYLES
# Functions with custom styles # Functions with custom styles
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def change_style(self, event): def change_style(self, event):
if event == QEvent.Enter: if event == QEvent.Enter:
self._set_bg_color = self._bg_color_hover self._set_bg_color = self._bg_color_hover
self._set_icon_color = self._icon_color_hover self._set_icon_color = self._icon_color_hover
self.repaint() self.repaint()
elif event == QEvent.Leave: elif event == QEvent.Leave:
self._set_bg_color = self._bg_color self._set_bg_color = self._bg_color
self._set_icon_color = self._icon_color self._set_icon_color = self._icon_color
self.repaint() self.repaint()
elif event == QEvent.MouseButtonPress: elif event == QEvent.MouseButtonPress:
self._set_bg_color = self._bg_color_pressed self._set_bg_color = self._bg_color_pressed
self._set_icon_color = self._icon_color_pressed self._set_icon_color = self._icon_color_pressed
self.repaint() self.repaint()
elif event == QEvent.MouseButtonRelease: elif event == QEvent.MouseButtonRelease:
self._set_bg_color = self._bg_color_hover self._set_bg_color = self._bg_color_hover
self._set_icon_color = self._icon_color_hover self._set_icon_color = self._icon_color_hover
self.repaint() self.repaint()
# MOUSE OVER # MOUSE OVER
# Event triggered when the mouse is over the BTN # Event triggered when the mouse is over the BTN
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def enterEvent(self, event): def enterEvent(self, event):
self.change_style(QEvent.Enter) self.change_style(QEvent.Enter)
self.move_tooltip() self.move_tooltip()
self._tooltip.show() self._tooltip.show()
# MOUSE LEAVE # MOUSE LEAVE
# Event fired when the mouse leaves the BTN # Event fired when the mouse leaves the BTN
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def leaveEvent(self, event): def leaveEvent(self, event):
self.change_style(QEvent.Leave) self.change_style(QEvent.Leave)
self.move_tooltip() self.move_tooltip()
self._tooltip.hide() self._tooltip.hide()
# MOUSE PRESS # MOUSE PRESS
# Event triggered when the left button is pressed # Event triggered when the left button is pressed
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def mousePressEvent(self, event): def mousePressEvent(self, event):
if event.button() == Qt.LeftButton: if event.button() == Qt.LeftButton:
self.change_style(QEvent.MouseButtonPress) self.change_style(QEvent.MouseButtonPress)
# SET FOCUS # SET FOCUS
self.setFocus() self.setFocus()
# EMIT SIGNAL # EMIT SIGNAL
return self.clicked.emit() return self.clicked.emit()
# MOUSE RELEASED # MOUSE RELEASED
# Event triggered after the mouse button is released # Event triggered after the mouse button is released
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def mouseReleaseEvent(self, event): def mouseReleaseEvent(self, event):
if event.button() == Qt.LeftButton: if event.button() == Qt.LeftButton:
self.change_style(QEvent.MouseButtonRelease) self.change_style(QEvent.MouseButtonRelease)
# EMIT SIGNAL # EMIT SIGNAL
return self.released.emit() return self.released.emit()
# DRAW ICON WITH COLORS # DRAW ICON WITH COLORS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def icon_paint(self, qp, image, rect): def icon_paint(self, qp, image, rect):
icon = QPixmap(image) icon = QPixmap(image)
painter = QPainter(icon) painter = QPainter(icon)
painter.setCompositionMode(QPainter.CompositionMode_SourceIn) painter.setCompositionMode(QPainter.CompositionMode_SourceIn)
if self._is_active: if self._is_active:
painter.fillRect(icon.rect(), self._icon_color_active) painter.fillRect(icon.rect(), self._icon_color_active)
else: else:
painter.fillRect(icon.rect(), self._set_icon_color) painter.fillRect(icon.rect(), self._set_icon_color)
qp.drawPixmap( qp.drawPixmap(
(rect.width() - icon.width()) / 2, (rect.width() - icon.width()) / 2,
(rect.height() - icon.height()) / 2, (rect.height() - icon.height()) / 2,
icon icon
) )
painter.end() painter.end()
# SET ICON # SET ICON
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def set_icon(self, icon_path): def set_icon(self, icon_path):
self._set_icon_path = icon_path self._set_icon_path = icon_path
self.repaint() self.repaint()
# MOVE TOOLTIP # MOVE TOOLTIP
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def move_tooltip(self): def move_tooltip(self):
# GET MAIN WINDOW PARENT # GET MAIN WINDOW PARENT
gp = self.mapToGlobal(QPoint(0, 0)) gp = self.mapToGlobal(QPoint(0, 0))
# SET WIDGET TO GET POSTION # SET WIDGET TO GET POSTION
# Return absolute position of widget inside app # Return absolute position of widget inside app
pos = self._parent.mapFromGlobal(gp) pos = self._parent.mapFromGlobal(gp)
# FORMAT POSITION # FORMAT POSITION
# Adjust tooltip position with offset # Adjust tooltip position with offset
pos_x = (pos.x() - self._tooltip.width()) + self.width() + 5 pos_x = (pos.x() - self._tooltip.width()) + self.width() + 5
pos_y = pos.y() + self._top_margin pos_y = pos.y() + self._top_margin
# SET POSITION TO WIDGET # SET POSITION TO WIDGET
# Move tooltip position # Move tooltip position
self._tooltip.move(pos_x, pos_y) self._tooltip.move(pos_x, pos_y)
# TOOLTIP # TOOLTIP
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
class _ToolTip(QLabel): class _ToolTip(QLabel):
# TOOLTIP / LABEL StyleSheet # TOOLTIP / LABEL StyleSheet
style_tooltip = """ style_tooltip = """
QLabel {{ QLabel {{
background-color: {_dark_one}; background-color: {_dark_one};
color: {_text_foreground}; color: {_text_foreground};
padding-left: 10px; padding-left: 10px;
padding-right: 10px; padding-right: 10px;
border-radius: 17px; border-radius: 17px;
border: 0px solid transparent; border: 0px solid transparent;
border-right: 3px solid {_context_color}; border-right: 3px solid {_context_color};
font: 800 9pt "Segoe UI"; font: 800 9pt "Segoe UI";
}} }}
""" """
def __init__( def __init__(
self, self,
parent, parent,
tooltip, tooltip,
dark_one, dark_one,
context_color, context_color,
text_foreground text_foreground
): ):
QLabel.__init__(self) QLabel.__init__(self)
# LABEL SETUP # LABEL SETUP
style = self.style_tooltip.format( style = self.style_tooltip.format(
_dark_one = dark_one, _dark_one = dark_one,
_context_color = context_color, _context_color = context_color,
_text_foreground = text_foreground _text_foreground = text_foreground
) )
self.setObjectName(u"label_tooltip") self.setObjectName(u"label_tooltip")
self.setStyleSheet(style) self.setStyleSheet(style)
self.setMinimumHeight(34) self.setMinimumHeight(34)
self.setParent(parent) self.setParent(parent)
self.setText(tooltip) self.setText(tooltip)
self.adjustSize() self.adjustSize()
# SET DROP SHADOW # SET DROP SHADOW
self.shadow = QGraphicsDropShadowEffect(self) self.shadow = QGraphicsDropShadowEffect(self)
self.shadow.setBlurRadius(30) self.shadow.setBlurRadius(30)
self.shadow.setXOffset(0) self.shadow.setXOffset(0)
self.shadow.setYOffset(0) self.shadow.setYOffset(0)
self.shadow.setColor(QColor(0, 0, 0, 80)) self.shadow.setColor(QColor(0, 0, 0, 80))
self.setGraphicsEffect(self.shadow) self.setGraphicsEffect(self.shadow)

View File

@@ -1,19 +1,19 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# PY PUSH BUTTON # PY PUSH BUTTON
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_toggle import PyToggle from . py_toggle import PyToggle

View File

@@ -1,88 +1,88 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT QT CORE # IMPORT QT CORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from qt_core import * from qt_core import *
class PyToggle(QCheckBox): class PyToggle(QCheckBox):
def __init__( def __init__(
self, self,
width = 50, width = 50,
bg_color = "#777", bg_color = "#777",
circle_color = "#DDD", circle_color = "#DDD",
active_color = "#00BCFF", active_color = "#00BCFF",
animation_curve = QEasingCurve.OutBounce animation_curve = QEasingCurve.OutBounce
): ):
QCheckBox.__init__(self) QCheckBox.__init__(self)
self.setFixedSize(width, 28) self.setFixedSize(width, 28)
self.setCursor(Qt.PointingHandCursor) self.setCursor(Qt.PointingHandCursor)
# COLORS # COLORS
self._bg_color = bg_color self._bg_color = bg_color
self._circle_color = circle_color self._circle_color = circle_color
self._active_color = active_color self._active_color = active_color
self._position = 3 self._position = 3
self.animation = QPropertyAnimation(self, b"position") self.animation = QPropertyAnimation(self, b"position")
self.animation.setEasingCurve(animation_curve) self.animation.setEasingCurve(animation_curve)
self.animation.setDuration(500) self.animation.setDuration(500)
self.stateChanged.connect(self.setup_animation) self.stateChanged.connect(self.setup_animation)
@Property(float) @Property(float)
def position(self): def position(self):
return self._position return self._position
@position.setter @position.setter
def position(self, pos): def position(self, pos):
self._position = pos self._position = pos
self.update() self.update()
# START STOP ANIMATION # START STOP ANIMATION
def setup_animation(self, value): def setup_animation(self, value):
self.animation.stop() self.animation.stop()
if value: if value:
self.animation.setEndValue(self.width() - 26) self.animation.setEndValue(self.width() - 26)
else: else:
self.animation.setEndValue(4) self.animation.setEndValue(4)
self.animation.start() self.animation.start()
def hitButton(self, pos: QPoint): def hitButton(self, pos: QPoint):
return self.contentsRect().contains(pos) return self.contentsRect().contains(pos)
def paintEvent(self, e): def paintEvent(self, e):
p = QPainter(self) p = QPainter(self)
p.setRenderHint(QPainter.Antialiasing) p.setRenderHint(QPainter.Antialiasing)
p.setFont(QFont("Segoe UI", 9)) p.setFont(QFont("Segoe UI", 9))
# SET PEN # SET PEN
p.setPen(Qt.NoPen) p.setPen(Qt.NoPen)
# DRAW RECT # DRAW RECT
rect = QRect(0, 0, self.width(), self.height()) rect = QRect(0, 0, self.width(), self.height())
if not self.isChecked(): if not self.isChecked():
p.setBrush(QColor(self._bg_color)) p.setBrush(QColor(self._bg_color))
p.drawRoundedRect(0,0,rect.width(), 28, 14, 14) p.drawRoundedRect(0,0,rect.width(), 28, 14, 14)
p.setBrush(QColor(self._circle_color)) p.setBrush(QColor(self._circle_color))
p.drawEllipse(self._position, 3, 22, 22) p.drawEllipse(self._position, 3, 22, 22)
else: else:
p.setBrush(QColor(self._active_color)) p.setBrush(QColor(self._active_color))
p.drawRoundedRect(0,0,rect.width(), 28, 14, 14) p.drawRoundedRect(0,0,rect.width(), 28, 14, 14)
p.setBrush(QColor(self._circle_color)) p.setBrush(QColor(self._circle_color))
p.drawEllipse(self._position, 3, 22, 22) p.drawEllipse(self._position, 3, 22, 22)
p.end() p.end()

View File

@@ -1,19 +1,19 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT WIDGETS # IMPORT WIDGETS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . py_window import PyWindow from . py_window import PyWindow

View File

@@ -1,142 +1,142 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT PACKAGES AND MODULES # IMPORT PACKAGES AND MODULES
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT QT CORE # IMPORT QT CORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from qt_core import * from qt_core import *
# IMPORT SETTINGS # IMPORT SETTINGS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from gui.core.json_settings import Settings from gui.core.json_settings import Settings
# IMPORT STYLES # IMPORT STYLES
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from . styles import Styles from . styles import Styles
# PY WINDOW # PY WINDOW
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
class PyWindow(QFrame): class PyWindow(QFrame):
def __init__( def __init__(
self, self,
parent, parent,
layout = Qt.Vertical, layout = Qt.Vertical,
margin = 0, margin = 0,
spacing = 2, spacing = 2,
bg_color = "#2c313c", bg_color = "#2c313c",
text_color = "#fff", text_color = "#fff",
text_font = "9pt 'Segoe UI'", text_font = "9pt 'Segoe UI'",
border_radius = 10, border_radius = 10,
border_size = 2, border_size = 2,
border_color = "#343b48", border_color = "#343b48",
enable_shadow = True enable_shadow = True
): ):
super().__init__() super().__init__()
# LOAD SETTINGS # LOAD SETTINGS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
settings = Settings() settings = Settings()
self.settings = settings.items self.settings = settings.items
# PROPERTIES # PROPERTIES
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.parent = parent self.parent = parent
self.layout = layout self.layout = layout
self.margin = margin self.margin = margin
self.bg_color = bg_color self.bg_color = bg_color
self.text_color = text_color self.text_color = text_color
self.text_font = text_font self.text_font = text_font
self.border_radius = border_radius self.border_radius = border_radius
self.border_size = border_size self.border_size = border_size
self.border_color = border_color self.border_color = border_color
self.enable_shadow = enable_shadow self.enable_shadow = enable_shadow
# OBJECT NAME # OBJECT NAME
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.setObjectName("pod_bg_app") self.setObjectName("pod_bg_app")
# APPLY STYLESHEET # APPLY STYLESHEET
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.set_stylesheet() self.set_stylesheet()
# ADD LAYOUT # ADD LAYOUT
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
if layout == Qt.Vertical: if layout == Qt.Vertical:
# VERTICAL LAYOUT # VERTICAL LAYOUT
self.layout = QHBoxLayout(self) self.layout = QHBoxLayout(self)
else: else:
# HORIZONTAL LAYOUT # HORIZONTAL LAYOUT
self.layout = QHBoxLayout(self) self.layout = QHBoxLayout(self)
self.layout.setContentsMargins(margin, margin, margin, margin) self.layout.setContentsMargins(margin, margin, margin, margin)
self.layout.setSpacing(spacing) self.layout.setSpacing(spacing)
# ADD DROP SHADOW # ADD DROP SHADOW
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
if self.settings["custom_title_bar"]: if self.settings["custom_title_bar"]:
if enable_shadow: if enable_shadow:
self.shadow = QGraphicsDropShadowEffect() self.shadow = QGraphicsDropShadowEffect()
self.shadow.setBlurRadius(20) self.shadow.setBlurRadius(20)
self.shadow.setXOffset(0) self.shadow.setXOffset(0)
self.shadow.setYOffset(0) self.shadow.setYOffset(0)
self.shadow.setColor(QColor(0, 0, 0, 160)) self.shadow.setColor(QColor(0, 0, 0, 160))
self.setGraphicsEffect(self.shadow) self.setGraphicsEffect(self.shadow)
# APPLY AND UPDATE STYLESHEET # APPLY AND UPDATE STYLESHEET
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def set_stylesheet( def set_stylesheet(
self, self,
bg_color = None, bg_color = None,
border_radius = None, border_radius = None,
border_size = None, border_size = None,
border_color = None, border_color = None,
text_color = None, text_color = None,
text_font = None text_font = None
): ):
# CHECK BG COLOR # CHECK BG COLOR
if bg_color != None: internal_bg_color = bg_color if bg_color != None: internal_bg_color = bg_color
else: internal_bg_color = self.bg_color else: internal_bg_color = self.bg_color
# CHECK BORDER RADIUS # CHECK BORDER RADIUS
if border_radius != None: internal_border_radius = border_radius if border_radius != None: internal_border_radius = border_radius
else: internal_border_radius = self.border_radius else: internal_border_radius = self.border_radius
# CHECK BORDER SIZE # CHECK BORDER SIZE
if border_size != None: internal_border_size = border_size if border_size != None: internal_border_size = border_size
else: internal_border_size = self.border_size else: internal_border_size = self.border_size
# CHECK BORDER COLOR # CHECK BORDER COLOR
if text_color != None: internal_text_color = text_color if text_color != None: internal_text_color = text_color
else: internal_text_color = self.text_color else: internal_text_color = self.text_color
# CHECK TEXT COLOR # CHECK TEXT COLOR
if border_color != None: internal_border_color = border_color if border_color != None: internal_border_color = border_color
else: internal_border_color = self.border_color else: internal_border_color = self.border_color
# CHECK TEXT COLOR # CHECK TEXT COLOR
if text_font != None: internal_text_font = text_font if text_font != None: internal_text_font = text_font
else: internal_text_font = self.text_font else: internal_text_font = self.text_font
self.setStyleSheet(Styles.bg_style.format( self.setStyleSheet(Styles.bg_style.format(
_bg_color = internal_bg_color, _bg_color = internal_bg_color,
_border_radius = internal_border_radius, _border_radius = internal_border_radius,
_border_size = internal_border_size, _border_size = internal_border_size,
_border_color = internal_border_color, _border_color = internal_border_color,
_text_color = internal_text_color, _text_color = internal_text_color,
_text_font = internal_text_font _text_font = internal_text_font
)) ))

View File

@@ -1,28 +1,28 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
class Styles(object): class Styles(object):
bg_style = """ bg_style = """
#pod_bg_app {{ #pod_bg_app {{
background-color: {_bg_color}; background-color: {_bg_color};
border-radius: {_border_radius}; border-radius: {_border_radius};
border: {_border_size}px solid {_border_color}; border: {_border_size}px solid {_border_color};
}} }}
QFrame {{ QFrame {{
color: {_text_color}; color: {_text_color};
font: {_text_font}; font: {_text_font};
}} }}
""" """

442
main.py
View File

@@ -1,222 +1,222 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# IMPORT PACKAGES AND MODULES # IMPORT PACKAGES AND MODULES
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from gui.uis.windows.main_window.functions_main_window import * from gui.uis.windows.main_window.functions_main_window import *
import sys import sys
import os import os
# IMPORT QT CORE # IMPORT QT CORE
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from qt_core import * from qt_core import *
# IMPORT SETTINGS # IMPORT SETTINGS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from gui.core.json_settings import Settings from gui.core.json_settings import Settings
# IMPORT PY ONE DARK WINDOWS # IMPORT PY ONE DARK WINDOWS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# MAIN WINDOW # MAIN WINDOW
from gui.uis.windows.main_window import * from gui.uis.windows.main_window import *
# IMPORT PY ONE DARK WIDGETS # IMPORT PY ONE DARK WIDGETS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from gui.widgets import * from gui.widgets import *
# ADJUST QT FONT DPI FOR HIGHT SCALE AN 4K MONITOR # ADJUST QT FONT DPI FOR HIGHT SCALE AN 4K MONITOR
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
os.environ["QT_FONT_DPI"] = "96" os.environ["QT_FONT_DPI"] = "96"
# IF IS 4K MONITOR ENABLE 'os.environ["QT_SCALE_FACTOR"] = "2"' # IF IS 4K MONITOR ENABLE 'os.environ["QT_SCALE_FACTOR"] = "2"'
# MAIN WINDOW # MAIN WINDOW
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
class MainWindow(QMainWindow): class MainWindow(QMainWindow):
def __init__(self): def __init__(self):
super().__init__() super().__init__()
# SETUP MAIN WINDOw # SETUP MAIN WINDOw
# Load widgets from "gui\uis\main_window\ui_main.py" # Load widgets from "gui\uis\main_window\ui_main.py"
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.ui = UI_MainWindow() self.ui = UI_MainWindow()
self.ui.setup_ui(self) self.ui.setup_ui(self)
# LOAD SETTINGS # LOAD SETTINGS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
settings = Settings() settings = Settings()
self.settings = settings.items self.settings = settings.items
# SETUP MAIN WINDOW # SETUP MAIN WINDOW
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.hide_grips = True # Show/Hide resize grips self.hide_grips = True # Show/Hide resize grips
SetupMainWindow.setup_gui(self) SetupMainWindow.setup_gui(self)
# SHOW MAIN WINDOW # SHOW MAIN WINDOW
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
self.show() self.show()
# LEFT MENU BTN IS CLICKED # LEFT MENU BTN IS CLICKED
# Run function when btn is clicked # Run function when btn is clicked
# Check funtion by object name / btn_id # Check funtion by object name / btn_id
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def btn_clicked(self): def btn_clicked(self):
# GET BT CLICKED # GET BT CLICKED
btn = SetupMainWindow.setup_btns(self) btn = SetupMainWindow.setup_btns(self)
# Remove Selection If Clicked By "btn_close_left_column" # Remove Selection If Clicked By "btn_close_left_column"
if btn.objectName() != "btn_settings": if btn.objectName() != "btn_settings":
self.ui.left_menu.deselect_all_tab() self.ui.left_menu.deselect_all_tab()
# Get Title Bar Btn And Reset Active # Get Title Bar Btn And Reset Active
top_settings = MainFunctions.get_title_bar_btn(self, "btn_top_settings") top_settings = MainFunctions.get_title_bar_btn(self, "btn_top_settings")
top_settings.set_active(False) top_settings.set_active(False)
# LEFT MENU # LEFT MENU
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# HOME BTN # HOME BTN
if btn.objectName() == "btn_home": if btn.objectName() == "btn_home":
# Select Menu # Select Menu
self.ui.left_menu.select_only_one(btn.objectName()) self.ui.left_menu.select_only_one(btn.objectName())
# Load Page 1 # Load Page 1
MainFunctions.set_page(self, self.ui.load_pages.page_1) MainFunctions.set_page(self, self.ui.load_pages.page_1)
# WIDGETS BTN # WIDGETS BTN
if btn.objectName() == "btn_widgets": if btn.objectName() == "btn_widgets":
# Select Menu # Select Menu
self.ui.left_menu.select_only_one(btn.objectName()) self.ui.left_menu.select_only_one(btn.objectName())
# Load Page 2 # Load Page 2
MainFunctions.set_page(self, self.ui.load_pages.page_2) MainFunctions.set_page(self, self.ui.load_pages.page_2)
# LOAD USER PAGE # LOAD USER PAGE
if btn.objectName() == "btn_add_user": if btn.objectName() == "btn_add_user":
# Select Menu # Select Menu
self.ui.left_menu.select_only_one(btn.objectName()) self.ui.left_menu.select_only_one(btn.objectName())
# Load Page 3 # Load Page 3
MainFunctions.set_page(self, self.ui.load_pages.page_3) MainFunctions.set_page(self, self.ui.load_pages.page_3)
# BOTTOM INFORMATION # BOTTOM INFORMATION
if btn.objectName() == "btn_info": if btn.objectName() == "btn_info":
# CHECK IF LEFT COLUMN IS VISIBLE # CHECK IF LEFT COLUMN IS VISIBLE
if not MainFunctions.left_column_is_visible(self): if not MainFunctions.left_column_is_visible(self):
self.ui.left_menu.select_only_one_tab(btn.objectName()) self.ui.left_menu.select_only_one_tab(btn.objectName())
# Show / Hide # Show / Hide
MainFunctions.toggle_left_column(self) MainFunctions.toggle_left_column(self)
self.ui.left_menu.select_only_one_tab(btn.objectName()) self.ui.left_menu.select_only_one_tab(btn.objectName())
else: else:
if btn.objectName() == "btn_close_left_column": if btn.objectName() == "btn_close_left_column":
self.ui.left_menu.deselect_all_tab() self.ui.left_menu.deselect_all_tab()
# Show / Hide # Show / Hide
MainFunctions.toggle_left_column(self) MainFunctions.toggle_left_column(self)
self.ui.left_menu.select_only_one_tab(btn.objectName()) self.ui.left_menu.select_only_one_tab(btn.objectName())
# Change Left Column Menu # Change Left Column Menu
if btn.objectName() != "btn_close_left_column": if btn.objectName() != "btn_close_left_column":
MainFunctions.set_left_column_menu( MainFunctions.set_left_column_menu(
self, self,
menu = self.ui.left_column.menus.menu_2, menu = self.ui.left_column.menus.menu_2,
title = "Info tab", title = "Info tab",
icon_path = Functions.set_svg_icon("icon_info.svg") icon_path = Functions.set_svg_icon("icon_info.svg")
) )
# SETTINGS LEFT # SETTINGS LEFT
if btn.objectName() == "btn_settings" or btn.objectName() == "btn_close_left_column": if btn.objectName() == "btn_settings" or btn.objectName() == "btn_close_left_column":
# CHECK IF LEFT COLUMN IS VISIBLE # CHECK IF LEFT COLUMN IS VISIBLE
if not MainFunctions.left_column_is_visible(self): if not MainFunctions.left_column_is_visible(self):
# Show / Hide # Show / Hide
MainFunctions.toggle_left_column(self) MainFunctions.toggle_left_column(self)
self.ui.left_menu.select_only_one_tab(btn.objectName()) self.ui.left_menu.select_only_one_tab(btn.objectName())
else: else:
if btn.objectName() == "btn_close_left_column": if btn.objectName() == "btn_close_left_column":
self.ui.left_menu.deselect_all_tab() self.ui.left_menu.deselect_all_tab()
# Show / Hide # Show / Hide
MainFunctions.toggle_left_column(self) MainFunctions.toggle_left_column(self)
self.ui.left_menu.select_only_one_tab(btn.objectName()) self.ui.left_menu.select_only_one_tab(btn.objectName())
# Change Left Column Menu # Change Left Column Menu
if btn.objectName() != "btn_close_left_column": if btn.objectName() != "btn_close_left_column":
MainFunctions.set_left_column_menu( MainFunctions.set_left_column_menu(
self, self,
menu = self.ui.left_column.menus.menu_1, menu = self.ui.left_column.menus.menu_1,
title = "Settings Left Column", title = "Settings Left Column",
icon_path = Functions.set_svg_icon("icon_settings.svg") icon_path = Functions.set_svg_icon("icon_settings.svg")
) )
# TITLE BAR MENU # TITLE BAR MENU
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# SETTINGS TITLE BAR # SETTINGS TITLE BAR
if btn.objectName() == "btn_top_settings": if btn.objectName() == "btn_top_settings":
# Toogle Active # Toogle Active
if not MainFunctions.right_column_is_visible(self): if not MainFunctions.right_column_is_visible(self):
btn.set_active(True) btn.set_active(True)
# Show / Hide # Show / Hide
MainFunctions.toggle_right_column(self) MainFunctions.toggle_right_column(self)
else: else:
btn.set_active(False) btn.set_active(False)
# Show / Hide # Show / Hide
MainFunctions.toggle_right_column(self) MainFunctions.toggle_right_column(self)
# Get Left Menu Btn # Get Left Menu Btn
top_settings = MainFunctions.get_left_menu_btn(self, "btn_settings") top_settings = MainFunctions.get_left_menu_btn(self, "btn_settings")
top_settings.set_active_tab(False) top_settings.set_active_tab(False)
# DEBUG # DEBUG
print(f"Button {btn.objectName()}, clicked!") print(f"Button {btn.objectName()}, clicked!")
# LEFT MENU BTN IS RELEASED # LEFT MENU BTN IS RELEASED
# Run function when btn is released # Run function when btn is released
# Check funtion by object name / btn_id # Check funtion by object name / btn_id
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def btn_released(self): def btn_released(self):
# GET BT CLICKED # GET BT CLICKED
btn = SetupMainWindow.setup_btns(self) btn = SetupMainWindow.setup_btns(self)
# DEBUG # DEBUG
print(f"Button {btn.objectName()}, released!") print(f"Button {btn.objectName()}, released!")
# RESIZE EVENT # RESIZE EVENT
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def resizeEvent(self, event): def resizeEvent(self, event):
SetupMainWindow.resize_grips(self) SetupMainWindow.resize_grips(self)
# MOUSE CLICK EVENTS # MOUSE CLICK EVENTS
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
def mousePressEvent(self, event): def mousePressEvent(self, event):
# SET DRAG POS WINDOW # SET DRAG POS WINDOW
self.dragPos = event.globalPos() self.dragPos = event.globalPos()
# SETTINGS WHEN TO START # SETTINGS WHEN TO START
# Set the initial class and also additional parameters of the "QApplication" class # Set the initial class and also additional parameters of the "QApplication" class
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
if __name__ == "__main__": if __name__ == "__main__":
# APPLICATION # APPLICATION
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
app = QApplication(sys.argv) app = QApplication(sys.argv)
app.setWindowIcon(QIcon("icon.ico")) app.setWindowIcon(QIcon("icon.ico"))
window = MainWindow() window = MainWindow()
# EXEC APP # EXEC APP
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
sys.exit(app.exec_()) sys.exit(app.exec_())

View File

@@ -1,28 +1,28 @@
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# #
# BY: WANDERSON M.PIMENTA # BY: WANDERSON M.PIMENTA
# PROJECT MADE WITH: Qt Designer and PySide6 # PROJECT MADE WITH: Qt Designer and PySide6
# V: 1.0.0 # V: 1.0.0
# #
# This project can be used freely for all uses, as long as they maintain the # 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 # respective credits only in the Python scripts, any information in the visual
# interface (GUI) can be modified without any implication. # interface (GUI) can be modified without any implication.
# #
# There are limitations on Qt licenses if you want to use your products # There are limitations on Qt licenses if you want to use your products
# commercially, I recommend reading them on the official website: # commercially, I recommend reading them on the official website:
# https://doc.qt.io/qtforpython/licenses.html # https://doc.qt.io/qtforpython/licenses.html
# #
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
# QT CORE # QT CORE
# Change for PySide Or PyQt # Change for PySide Or PyQt
# ///////////////////////// WARNING: //////////////////////////// # ///////////////////////// WARNING: ////////////////////////////
# Remember that changing to PyQt too many modules will have # Remember that changing to PyQt too many modules will have
# problems because some classes have different names like: # problems because some classes have different names like:
# Property (pyqtProperty), Slot (pyqtSlot), Signal (pyqtSignal) # Property (pyqtProperty), Slot (pyqtSlot), Signal (pyqtSignal)
# among others. # among others.
# /////////////////////////////////////////////////////////////// # ///////////////////////////////////////////////////////////////
from PySide6.QtCore import * from PySide6.QtCore import *
from PySide6.QtGui import * from PySide6.QtGui import *
from PySide6.QtWidgets import * from PySide6.QtWidgets import *
from PySide6.QtSvgWidgets import * from PySide6.QtSvgWidgets import *

View File

@@ -1,35 +1,35 @@
{ {
"app_name": "PyOneDark - Modern GUI", "app_name": "PyOneDark - Modern GUI",
"version" : "v1.0.0", "version" : "v1.0.0",
"copyright" : "By: Wanderson M. Pimenta", "copyright" : "By: Wanderson M. Pimenta",
"year" : 2021, "year" : 2021,
"theme_name" : "default", "theme_name" : "default",
"custom_title_bar": true, "custom_title_bar": true,
"startup_size": [ "startup_size": [
1400, 1400,
720 720
], ],
"minimum_size": [ "minimum_size": [
960, 960,
540 540
], ],
"lef_menu_size" : { "lef_menu_size" : {
"minimum" : 50, "minimum" : 50,
"maximum" : 240 "maximum" : 240
}, },
"left_menu_content_margins" : 3, "left_menu_content_margins" : 3,
"left_column_size" : { "left_column_size" : {
"minimum" : 0, "minimum" : 0,
"maximum" : 240 "maximum" : 240
}, },
"right_column_size" : { "right_column_size" : {
"minimum" : 0, "minimum" : 0,
"maximum" : 240 "maximum" : 240
}, },
"time_animation" : 500, "time_animation" : 500,
"font" : { "font" : {
"family" : "Segoe UI", "family" : "Segoe UI",
"title_size" : 10, "title_size" : 10,
"text_size" : 9 "text_size" : 9
} }
} }