mirror of
https://github.com/Wanderson-Magalhaes/PyBlackBox_Qt_Widgets_PySide6_Or_PyQt6_v1.0.0.git
synced 2026-07-06 09:05:09 +00:00
first commit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
#
|
||||
# BY: WANDERSON M.PIMENTA
|
||||
# PROJECT MADE WITH: Qt Designer and PySide6
|
||||
# V: 1.0.0
|
||||
#
|
||||
# This project can be used freely for all uses, as long as they maintain the
|
||||
# respective credits only in the Python scripts, any information in the visual
|
||||
# interface (GUI) can be modified without any implication.
|
||||
#
|
||||
# There are limitations on Qt licenses if you want to use your products
|
||||
# commercially, I recommend reading them on the official website:
|
||||
# https://doc.qt.io/qtforpython/licenses.html
|
||||
#
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
|
||||
# IMPORT
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
# Packages
|
||||
from app.packages.pyside_or_pyqt import *
|
||||
from app.packages.widgets import *
|
||||
# Modules
|
||||
import app.modules.app_settings.settings as app_settings
|
||||
|
||||
# APP FUNCTIONS
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
class AppFunctions:
|
||||
def __init__(self):
|
||||
# GET WIDGETS FROM "ui_main.py"
|
||||
# Load widgets inside App Functions
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
self.ui = Ui_MainWindow()
|
||||
self.ui.setupUi(self)
|
||||
|
||||
def change_placeholder(self):
|
||||
self.ui.search_line_edit.setPlaceholderText("teste")
|
||||
@@ -0,0 +1,53 @@
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
#
|
||||
# BY: WANDERSON M.PIMENTA
|
||||
# PROJECT MADE WITH: Qt Designer and PySide6
|
||||
# V: 1.0.0
|
||||
#
|
||||
# This project can be used freely for all uses, as long as they maintain the
|
||||
# respective credits only in the Python scripts, any information in the visual
|
||||
# interface (GUI) can be modified without any implication.
|
||||
#
|
||||
# There are limitations on Qt licenses if you want to use your products
|
||||
# commercially, I recommend reading them on the official website:
|
||||
# https://doc.qt.io/qtforpython/licenses.html
|
||||
#
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
|
||||
import json
|
||||
import os
|
||||
|
||||
# APP SETTINGS
|
||||
class Settings(object):
|
||||
# APP PATH
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
json_file = "settings.json"
|
||||
app_path = os.path.abspath(os.getcwd())
|
||||
settings_path = os.path.normpath(os.path.join(app_path, json_file))
|
||||
if not os.path.isfile(settings_path):
|
||||
print(f"WARNING: \"settings.json\" not found! check in the folder {settings_path}")
|
||||
|
||||
def __init__(self):
|
||||
super(Settings, self).__init__()
|
||||
|
||||
# DICTIONARY WITH SETTINGS
|
||||
# Just to have objects references
|
||||
self.items = {}
|
||||
|
||||
# DESERIALIZE
|
||||
self.deserialize()
|
||||
|
||||
# SERIALIZE JSON
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
def serialize(self):
|
||||
# WRITE JSON FILE
|
||||
with open(self.settings_path, "w", encoding='utf-8') as write:
|
||||
json.dump(self.items, write, indent=4)
|
||||
|
||||
# DESERIALIZE JSON
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
def deserialize(self):
|
||||
# READ JSON FILE
|
||||
with open(self.settings_path, "r", encoding='utf-8') as reader:
|
||||
settings = json.loads(reader.read())
|
||||
self.items = settings
|
||||
@@ -0,0 +1,166 @@
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
#
|
||||
# BY: WANDERSON M.PIMENTA
|
||||
# PROJECT MADE WITH: Qt Designer and PySide6
|
||||
# V: 1.0.0
|
||||
#
|
||||
# This project can be used freely for all uses, as long as they maintain the
|
||||
# respective credits only in the Python scripts, any information in the visual
|
||||
# interface (GUI) can be modified without any implication.
|
||||
#
|
||||
# There are limitations on Qt licenses if you want to use your products
|
||||
# commercially, I recommend reading them on the official website:
|
||||
# https://doc.qt.io/qtforpython/licenses.html
|
||||
#
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
|
||||
# IMPORT
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
# Packages
|
||||
from app.packages.pyside_or_pyqt import *
|
||||
from app.packages.widgets import *
|
||||
# GUI
|
||||
from app.uis.main_window.ui_main import Ui_MainWindow # MainWindow
|
||||
from app.modules.app_settings.settings import *
|
||||
|
||||
# GLOBAL VARS
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
_is_maximized = False
|
||||
|
||||
# APP FUNCTIONS
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
class UiFunctions:
|
||||
|
||||
def __init__(self):
|
||||
super(UiFunctions, self).__init__()
|
||||
# GET WIDGETS FROM "ui_main.py"
|
||||
# Load widgets inside App Functions
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
self.ui = Ui_MainWindow()
|
||||
self.ui.setupUi(self)
|
||||
|
||||
# SET UI DEFINITIONS
|
||||
# Set ui definitions before "self.show()" in main.py
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
def maximize_restore(self):
|
||||
global _is_maximized
|
||||
|
||||
# CHANGE UI AND RESIZE GRIP
|
||||
def change_ui():
|
||||
if not _is_maximized:
|
||||
self.resize(self.width()+1, self.height()+1)
|
||||
self.ui.margins_app.setContentsMargins(10, 10, 10, 10)
|
||||
self.ui.maximize_restore_app_btn.setToolTip("Restore")
|
||||
self.ui.maximize_restore_app_btn.setStyleSheet("background-image: url(:/icons_svg/images/icons_svg/icon_maximize.svg);")
|
||||
self.ui.bg_app.setStyleSheet("#bg_app { border-radius: 10px; border: 2px solid rgb(30, 32, 33); }")
|
||||
self.left_grip.show()
|
||||
self.right_grip.show()
|
||||
self.top_grip.show()
|
||||
self.bottom_grip.show()
|
||||
|
||||
else:
|
||||
self.ui.margins_app.setContentsMargins(0, 0, 0, 0)
|
||||
self.ui.maximize_restore_app_btn.setToolTip("Restore")
|
||||
self.ui.maximize_restore_app_btn.setStyleSheet("background-image: url(:/icons_svg/images/icons_svg/icon_restore.svg);")
|
||||
self.ui.bg_app.setStyleSheet("#bg_app { border-radius: 0px; border: none; }")
|
||||
self.left_grip.hide()
|
||||
self.right_grip.hide()
|
||||
self.top_grip.hide()
|
||||
self.bottom_grip.hide()
|
||||
|
||||
# CHECK EVENT
|
||||
if self.isMaximized():
|
||||
_is_maximized = False
|
||||
self.showNormal()
|
||||
change_ui()
|
||||
else:
|
||||
_is_maximized = True
|
||||
self.showMaximized()
|
||||
change_ui()
|
||||
|
||||
# START CHAT SELECTION
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
def select_chat_message(self, widget):
|
||||
for w in self.ui.messages_frame.findChildren(QWidget):
|
||||
if w.objectName() == widget:
|
||||
w.set_active(True)
|
||||
|
||||
# RESET CHAT SELECTION
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
def deselect_chat_message(self, widget):
|
||||
for w in self.ui.messages_frame.findChildren(QWidget):
|
||||
if w.objectName() != widget:
|
||||
if hasattr(w, 'set_active'):
|
||||
w.set_active(False)
|
||||
|
||||
# SET UI DEFINITIONS
|
||||
# Set ui definitions before "self.show()" in main.py
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
def set_ui_definitions(self):
|
||||
|
||||
# GET SETTINGS FROM JSON DESERIALIZED
|
||||
settings = Settings()
|
||||
self.settings = settings.items
|
||||
|
||||
# REMOVE TITLE BAR
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
self.setWindowFlag(Qt.FramelessWindowHint)
|
||||
self.setAttribute(Qt.WA_TranslucentBackground)
|
||||
|
||||
# MOVE WINDOW / MAXIMIZE / RESTORE
|
||||
def moveWindow(event):
|
||||
# IF MAXIMIZED CHANGE TO NORMAL
|
||||
if self.isMaximized():
|
||||
UiFunctions.maximize_restore(self)
|
||||
curso_x = self.pos().x()
|
||||
curso_y = event.globalPos().y() - QCursor.pos().y()
|
||||
self.move(curso_x, curso_y)
|
||||
# MOVE WINDOW
|
||||
if event.buttons() == Qt.LeftButton:
|
||||
self.move(self.pos() + event.globalPos() - self.dragPos)
|
||||
self.dragPos = event.globalPos()
|
||||
event.accept()
|
||||
self.ui.logo_top.mouseMoveEvent = moveWindow
|
||||
self.ui.title_bar.mouseMoveEvent = moveWindow
|
||||
|
||||
# DOUBLE CLICK MAXIMIZE / RESTORE
|
||||
def maximize_restore(event):
|
||||
if event.type() == QEvent.MouseButtonDblClick:
|
||||
UiFunctions.maximize_restore(self)
|
||||
self.ui.title_bar.mouseDoubleClickEvent = maximize_restore
|
||||
|
||||
# TOP BTNS
|
||||
self.ui.minimize_app_btn.clicked.connect(lambda: self.showMinimized())
|
||||
self.ui.maximize_restore_app_btn.clicked.connect(lambda: UiFunctions.maximize_restore(self))
|
||||
self.ui.close_app_btn.clicked.connect(lambda: self.close())
|
||||
|
||||
|
||||
|
||||
# DEFAULT PARAMETERS
|
||||
self.setWindowTitle(self.settings["app_name"])
|
||||
self.resize(self.settings["startup_size"][0], self.settings["startup_size"][1])
|
||||
self.setMinimumSize(self.settings["minimum_size"][0], self.settings["minimum_size"][1])
|
||||
|
||||
# APPLY DROP SHADOW
|
||||
self.shadow = QGraphicsDropShadowEffect()
|
||||
self.shadow.setBlurRadius(25)
|
||||
self.shadow.setXOffset(0)
|
||||
self.shadow.setYOffset(0)
|
||||
self.shadow.setColor(QColor(0, 0, 0, 80))
|
||||
self.ui.stylesheet.setGraphicsEffect(self.shadow)
|
||||
|
||||
# CUSTOM GRIPS
|
||||
# Create grips to resize window
|
||||
self.left_grip = CustomGrip(self, Qt.LeftEdge, True)
|
||||
self.right_grip = CustomGrip(self, Qt.RightEdge, True)
|
||||
self.top_grip = CustomGrip(self, Qt.TopEdge, True)
|
||||
self.bottom_grip = CustomGrip(self, Qt.BottomEdge, True)
|
||||
|
||||
# RESIZE GRIPS
|
||||
# This function should be called whenever "MainWindow/main.py" has its window resized.
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
def resize_grips(self):
|
||||
self.left_grip.setGeometry(0, 10, 10, self.height())
|
||||
self.right_grip.setGeometry(self.width() - 10, 10, 10, self.height())
|
||||
self.top_grip.setGeometry(0, 0, self.width(), 10)
|
||||
self.bottom_grip.setGeometry(0, self.height() - 10, self.width(), 10)
|
||||
@@ -0,0 +1,21 @@
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
#
|
||||
# BY: WANDERSON M.PIMENTA
|
||||
# PROJECT MADE WITH: Qt Designer and PySide6
|
||||
# V: 1.0.0
|
||||
#
|
||||
# This project can be used freely for all uses, as long as they maintain the
|
||||
# respective credits only in the Python scripts, any information in the visual
|
||||
# interface (GUI) can be modified without any implication.
|
||||
#
|
||||
# There are limitations on Qt licenses if you want to use your products
|
||||
# commercially, I recommend reading them on the official website:
|
||||
# https://doc.qt.io/qtforpython/licenses.html
|
||||
#
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
|
||||
# APP WIDGETS
|
||||
from . pyside_or_pyqt import *
|
||||
|
||||
# APP WIDGETS
|
||||
from . widgets import *
|
||||
@@ -0,0 +1,18 @@
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
#
|
||||
# BY: WANDERSON M.PIMENTA
|
||||
# PROJECT MADE WITH: Qt Designer and PySide6
|
||||
# V: 1.0.0
|
||||
#
|
||||
# This project can be used freely for all uses, as long as they maintain the
|
||||
# respective credits only in the Python scripts, any information in the visual
|
||||
# interface (GUI) can be modified without any implication.
|
||||
#
|
||||
# There are limitations on Qt licenses if you want to use your products
|
||||
# commercially, I recommend reading them on the official website:
|
||||
# https://doc.qt.io/qtforpython/licenses.html
|
||||
#
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
|
||||
# APP WIDGETS
|
||||
from . pyside_or_pyqt import *
|
||||
@@ -0,0 +1,19 @@
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
#
|
||||
# BY: WANDERSON M.PIMENTA
|
||||
# PROJECT MADE WITH: Qt Designer and PySide6
|
||||
# V: 1.0.0
|
||||
#
|
||||
# This project can be used freely for all uses, as long as they maintain the
|
||||
# respective credits only in the Python scripts, any information in the visual
|
||||
# interface (GUI) can be modified without any implication.
|
||||
#
|
||||
# There are limitations on Qt licenses if you want to use your products
|
||||
# commercially, I recommend reading them on the official website:
|
||||
# https://doc.qt.io/qtforpython/licenses.html
|
||||
#
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
|
||||
from PySide6.QtCore import *
|
||||
from PySide6.QtGui import *
|
||||
from PySide6.QtWidgets import *
|
||||
@@ -0,0 +1,34 @@
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
#
|
||||
# BY: WANDERSON M.PIMENTA
|
||||
# PROJECT MADE WITH: Qt Designer and PySide6
|
||||
# V: 1.0.0
|
||||
#
|
||||
# This project can be used freely for all uses, as long as they maintain the
|
||||
# respective credits only in the Python scripts, any information in the visual
|
||||
# interface (GUI) can be modified without any implication.
|
||||
#
|
||||
# There are limitations on Qt licenses if you want to use your products
|
||||
# commercially, I recommend reading them on the official website:
|
||||
# https://doc.qt.io/qtforpython/licenses.html
|
||||
#
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
|
||||
# CUSTOM GRIP
|
||||
# Resize window using application edges
|
||||
from . custom_grips import CustomGrip
|
||||
|
||||
# LEFT MENU BUTTON
|
||||
# Custom button with tooltip
|
||||
from . left_menu_button import LeftMenuButton
|
||||
|
||||
# TOP USER BOX
|
||||
# Top user information and status
|
||||
from . top_user_box import TopUserInfo
|
||||
|
||||
# FRIEND MENU MESSAGE / MESSAGE BUTTON
|
||||
# Friends messages with name and status
|
||||
from . friend_message_button import FriendMessageButton
|
||||
|
||||
# CIRCULAR PROGRESS BAR
|
||||
from . circular_progress import CircularProgress
|
||||
@@ -0,0 +1,14 @@
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
#
|
||||
# BY: WANDERSON M.PIMENTA
|
||||
# PROJECT MADE WITH: Qt Designer and PySide6
|
||||
# V: 1.0.0
|
||||
#
|
||||
# This project can be used freely for all uses, as long as they maintain the
|
||||
# respective credits only in the Python scripts, any information in the visual
|
||||
# interface (GUI) can be modified without any implication.
|
||||
#
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
|
||||
# CIRCULAR PROGRESS BAR
|
||||
from . circular_progress import CircularProgress
|
||||
@@ -0,0 +1,106 @@
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
#
|
||||
# BY: WANDERSON M.PIMENTA
|
||||
# PROJECT MADE WITH: Qt Designer and PySide6
|
||||
# V: 1.0.0
|
||||
#
|
||||
# This project can be used freely for all uses, as long as they maintain the
|
||||
# respective credits only in the Python scripts, any information in the visual
|
||||
# interface (GUI) can be modified without any implication.
|
||||
#
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
|
||||
from PySide6.QtCore import *
|
||||
from PySide6.QtGui import *
|
||||
from PySide6.QtWidgets import *
|
||||
|
||||
class CircularProgress(QWidget):
|
||||
def __init__(self):
|
||||
QWidget.__init__(self)
|
||||
|
||||
# CUSTOM PROPERTIES
|
||||
self.value = 0
|
||||
self.width = 200
|
||||
self.height = 200
|
||||
self.progress_width = 10
|
||||
self.progress_rounded_cap = True
|
||||
self.max_value = 100
|
||||
self.progress_color = 0xff79c6
|
||||
# Text
|
||||
self.enable_text = True
|
||||
self.font_family = "Segoe UI"
|
||||
self.font_size = 12
|
||||
self.suffix = "%"
|
||||
self.text_color = 0xff79c6
|
||||
# BG
|
||||
self.enable_bg = True
|
||||
self.bg_color = 0x44475a
|
||||
|
||||
# SET DEFAULT SIZE WITHOUT LAYOUT
|
||||
self.resize(self.width, self.height)
|
||||
|
||||
# ADD DROPSHADOW
|
||||
def add_shadow(self, enable):
|
||||
if enable:
|
||||
self.shadow = QGraphicsDropShadowEffect(self)
|
||||
self.shadow.setBlurRadius(15)
|
||||
self.shadow.setXOffset(0)
|
||||
self.shadow.setYOffset(0)
|
||||
self.shadow.setColor(QColor(0, 0, 0, 80))
|
||||
self.setGraphicsEffect(self.shadow)
|
||||
|
||||
# SET VALUE
|
||||
def set_value(self, value):
|
||||
self.value = value
|
||||
self.repaint() # Render progress bar after change value
|
||||
|
||||
|
||||
# PAINT EVENT (DESIGN YOUR CIRCULAR PROGRESS HERE)
|
||||
def paintEvent(self, e):
|
||||
# SET PROGRESS PARAMETERS
|
||||
width = self.width - self.progress_width
|
||||
height = self.height - self.progress_width
|
||||
margin = self.progress_width / 2
|
||||
value = self.value * 360 / self.max_value
|
||||
|
||||
# PAINTER
|
||||
paint = QPainter()
|
||||
paint.begin(self)
|
||||
paint.setRenderHint(QPainter.Antialiasing) # remove pixelated edges
|
||||
paint.setFont(QFont(self.font_family, self.font_size))
|
||||
|
||||
# CREATE RECTANGLE
|
||||
rect = QRect(0, 0, self.width, self.height)
|
||||
paint.setPen(Qt.NoPen)
|
||||
paint.drawRect(rect)
|
||||
|
||||
# PEN
|
||||
pen = QPen()
|
||||
pen.setWidth(self.progress_width)
|
||||
# Set Round Cap
|
||||
if self.progress_rounded_cap:
|
||||
pen.setCapStyle(Qt.RoundCap)
|
||||
|
||||
# ENABLE BG
|
||||
if self.enable_bg:
|
||||
pen.setColor(QColor(self.bg_color))
|
||||
paint.setPen(pen)
|
||||
paint.drawArc(margin, margin, width, height, 0, 360 * 16)
|
||||
|
||||
# CREATE ARC / CIRCULAR PROGRESS
|
||||
pen.setColor(QColor(self.progress_color))
|
||||
paint.setPen(pen)
|
||||
paint.drawArc(margin, margin, width, height, -90 * 16, -value * 16)
|
||||
|
||||
# CREATE TEXT
|
||||
if self.enable_text:
|
||||
pen.setColor(QColor(self.text_color))
|
||||
paint.setPen(pen)
|
||||
paint.drawText(rect, Qt.AlignCenter, f"{self.value}{self.suffix}")
|
||||
|
||||
# END
|
||||
paint.end()
|
||||
|
||||
if __name__ == "__main__":
|
||||
progress = CircularProgress()
|
||||
progress.__init__()
|
||||
@@ -0,0 +1,17 @@
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
#
|
||||
# BY: WANDERSON M.PIMENTA
|
||||
# PROJECT MADE WITH: Qt Designer and PySide6
|
||||
# V: 1.0.0
|
||||
#
|
||||
# This project can be used freely for all uses, as long as they maintain the
|
||||
# respective credits only in the Python scripts, any information in the visual
|
||||
# interface (GUI) can be modified without any implication.
|
||||
#
|
||||
# There are limitations on Qt licenses if you want to use your products
|
||||
# commercially, I recommend reading them on the official website:
|
||||
# https://doc.qt.io/qtforpython/licenses.html
|
||||
#
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
|
||||
from . custom_grips import CustomGrip
|
||||
@@ -0,0 +1,238 @@
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
#
|
||||
# BY: WANDERSON M.PIMENTA
|
||||
# PROJECT MADE WITH: Qt Designer and PySide6
|
||||
# V: 1.0.0
|
||||
#
|
||||
# This project can be used freely for all uses, as long as they maintain the
|
||||
# respective credits only in the Python scripts, any information in the visual
|
||||
# interface (GUI) can be modified without any implication.
|
||||
#
|
||||
# There are limitations on Qt licenses if you want to use your products
|
||||
# commercially, I recommend reading them on the official website:
|
||||
# https://doc.qt.io/qtforpython/licenses.html
|
||||
#
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
|
||||
from PySide6.QtCore import *
|
||||
from PySide6.QtGui import *
|
||||
from PySide6.QtWidgets import *
|
||||
|
||||
class CustomGrip(QWidget):
|
||||
def __init__(self, parent, position, disable_color = False):
|
||||
|
||||
# SETUP UI
|
||||
QWidget.__init__(self)
|
||||
self.parent = parent
|
||||
self.setParent(parent)
|
||||
self.wi = Widgets()
|
||||
|
||||
# SHOW TOP GRIP
|
||||
if position == Qt.TopEdge:
|
||||
self.wi.top(self)
|
||||
self.setGeometry(0, 0, self.parent.width(), 10)
|
||||
self.setMaximumHeight(10)
|
||||
|
||||
# GRIPS
|
||||
top_left = QSizeGrip(self.wi.top_left)
|
||||
top_right = QSizeGrip(self.wi.top_right)
|
||||
|
||||
# RESIZE TOP
|
||||
def resize_top(event):
|
||||
delta = event.pos()
|
||||
height = max(self.parent.minimumHeight(), self.parent.height() - delta.y())
|
||||
geo = self.parent.geometry()
|
||||
geo.setTop(geo.bottom() - height)
|
||||
self.parent.setGeometry(geo)
|
||||
event.accept()
|
||||
self.wi.top.mouseMoveEvent = resize_top
|
||||
|
||||
# ENABLE COLOR
|
||||
if disable_color:
|
||||
self.wi.top_left.setStyleSheet("background: transparent")
|
||||
self.wi.top_right.setStyleSheet("background: transparent")
|
||||
self.wi.top.setStyleSheet("background: transparent")
|
||||
|
||||
# SHOW BOTTOM GRIP
|
||||
elif position == Qt.BottomEdge:
|
||||
self.wi.bottom(self)
|
||||
self.setGeometry(0, self.parent.height() - 10, self.parent.width(), 10)
|
||||
self.setMaximumHeight(10)
|
||||
|
||||
# GRIPS
|
||||
self.bottom_left = QSizeGrip(self.wi.bottom_left)
|
||||
self.bottom_right = QSizeGrip(self.wi.bottom_right)
|
||||
|
||||
# RESIZE BOTTOM
|
||||
def resize_bottom(event):
|
||||
delta = event.pos()
|
||||
height = max(self.parent.minimumHeight(), self.parent.height() + delta.y())
|
||||
self.parent.resize(self.parent.width(), height)
|
||||
event.accept()
|
||||
self.wi.bottom.mouseMoveEvent = resize_bottom
|
||||
|
||||
# ENABLE COLOR
|
||||
if disable_color:
|
||||
self.wi.bottom_left.setStyleSheet("background: transparent")
|
||||
self.wi.bottom_right.setStyleSheet("background: transparent")
|
||||
self.wi.bottom.setStyleSheet("background: transparent")
|
||||
|
||||
# SHOW LEFT GRIP
|
||||
elif position == Qt.LeftEdge:
|
||||
self.wi.left(self)
|
||||
self.setGeometry(0, 10, 10, self.parent.height())
|
||||
self.setMaximumWidth(10)
|
||||
|
||||
# RESIZE LEFT
|
||||
def resize_left(event):
|
||||
delta = event.pos()
|
||||
width = max(self.parent.minimumWidth(), self.parent.width() - delta.x())
|
||||
geo = self.parent.geometry()
|
||||
geo.setLeft(geo.right() - width)
|
||||
self.parent.setGeometry(geo)
|
||||
event.accept()
|
||||
self.wi.leftgrip.mouseMoveEvent = resize_left
|
||||
|
||||
# ENABLE COLOR
|
||||
if disable_color:
|
||||
self.wi.leftgrip.setStyleSheet("background: transparent")
|
||||
|
||||
# RESIZE RIGHT
|
||||
elif position == Qt.RightEdge:
|
||||
self.wi.right(self)
|
||||
self.setGeometry(self.parent.width() - 10, 10, 10, self.parent.height())
|
||||
self.setMaximumWidth(10)
|
||||
|
||||
def resize_right(event):
|
||||
delta = event.pos()
|
||||
width = max(self.parent.minimumWidth(), self.parent.width() + delta.x())
|
||||
self.parent.resize(width, self.parent.height())
|
||||
event.accept()
|
||||
self.wi.rightgrip.mouseMoveEvent = resize_right
|
||||
|
||||
# ENABLE COLOR
|
||||
if disable_color:
|
||||
self.wi.rightgrip.setStyleSheet("background: transparent")
|
||||
|
||||
|
||||
def mouseReleaseEvent(self, event):
|
||||
self.mousePos = None
|
||||
|
||||
def resizeEvent(self, event):
|
||||
if hasattr(self.wi, 'container_top'):
|
||||
self.wi.container_top.setGeometry(0, 0, self.width(), 10)
|
||||
|
||||
elif hasattr(self.wi, 'container_bottom'):
|
||||
self.wi.container_bottom.setGeometry(0, 0, self.width(), 10)
|
||||
|
||||
elif hasattr(self.wi, 'leftgrip'):
|
||||
self.wi.leftgrip.setGeometry(0, 0, 10, self.height() - 20)
|
||||
|
||||
elif hasattr(self.wi, 'rightgrip'):
|
||||
self.wi.rightgrip.setGeometry(0, 0, 10, self.height() - 20)
|
||||
|
||||
class Widgets(object):
|
||||
def top(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
self.container_top = QFrame(Form)
|
||||
self.container_top.setObjectName(u"container_top")
|
||||
self.container_top.setGeometry(QRect(0, 0, 500, 10))
|
||||
self.container_top.setMinimumSize(QSize(0, 10))
|
||||
self.container_top.setMaximumSize(QSize(16777215, 10))
|
||||
self.container_top.setFrameShape(QFrame.NoFrame)
|
||||
self.container_top.setFrameShadow(QFrame.Raised)
|
||||
self.top_layout = QHBoxLayout(self.container_top)
|
||||
self.top_layout.setSpacing(0)
|
||||
self.top_layout.setObjectName(u"top_layout")
|
||||
self.top_layout.setContentsMargins(0, 0, 0, 0)
|
||||
self.top_left = QFrame(self.container_top)
|
||||
self.top_left.setObjectName(u"top_left")
|
||||
self.top_left.setMinimumSize(QSize(10, 10))
|
||||
self.top_left.setMaximumSize(QSize(10, 10))
|
||||
self.top_left.setCursor(QCursor(Qt.SizeFDiagCursor))
|
||||
self.top_left.setStyleSheet(u"background-color: rgb(33, 37, 43);")
|
||||
self.top_left.setFrameShape(QFrame.NoFrame)
|
||||
self.top_left.setFrameShadow(QFrame.Raised)
|
||||
self.top_layout.addWidget(self.top_left)
|
||||
self.top = QFrame(self.container_top)
|
||||
self.top.setObjectName(u"top")
|
||||
self.top.setCursor(QCursor(Qt.SizeVerCursor))
|
||||
self.top.setStyleSheet(u"background-color: rgb(85, 255, 255);")
|
||||
self.top.setFrameShape(QFrame.NoFrame)
|
||||
self.top.setFrameShadow(QFrame.Raised)
|
||||
self.top_layout.addWidget(self.top)
|
||||
self.top_right = QFrame(self.container_top)
|
||||
self.top_right.setObjectName(u"top_right")
|
||||
self.top_right.setMinimumSize(QSize(10, 10))
|
||||
self.top_right.setMaximumSize(QSize(10, 10))
|
||||
self.top_right.setCursor(QCursor(Qt.SizeBDiagCursor))
|
||||
self.top_right.setStyleSheet(u"background-color: rgb(33, 37, 43);")
|
||||
self.top_right.setFrameShape(QFrame.NoFrame)
|
||||
self.top_right.setFrameShadow(QFrame.Raised)
|
||||
self.top_layout.addWidget(self.top_right)
|
||||
|
||||
def bottom(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
self.container_bottom = QFrame(Form)
|
||||
self.container_bottom.setObjectName(u"container_bottom")
|
||||
self.container_bottom.setGeometry(QRect(0, 0, 500, 10))
|
||||
self.container_bottom.setMinimumSize(QSize(0, 10))
|
||||
self.container_bottom.setMaximumSize(QSize(16777215, 10))
|
||||
self.container_bottom.setFrameShape(QFrame.NoFrame)
|
||||
self.container_bottom.setFrameShadow(QFrame.Raised)
|
||||
self.bottom_layout = QHBoxLayout(self.container_bottom)
|
||||
self.bottom_layout.setSpacing(0)
|
||||
self.bottom_layout.setObjectName(u"bottom_layout")
|
||||
self.bottom_layout.setContentsMargins(0, 0, 0, 0)
|
||||
self.bottom_left = QFrame(self.container_bottom)
|
||||
self.bottom_left.setObjectName(u"bottom_left")
|
||||
self.bottom_left.setMinimumSize(QSize(10, 10))
|
||||
self.bottom_left.setMaximumSize(QSize(10, 10))
|
||||
self.bottom_left.setCursor(QCursor(Qt.SizeBDiagCursor))
|
||||
self.bottom_left.setStyleSheet(u"background-color: rgb(33, 37, 43);")
|
||||
self.bottom_left.setFrameShape(QFrame.NoFrame)
|
||||
self.bottom_left.setFrameShadow(QFrame.Raised)
|
||||
self.bottom_layout.addWidget(self.bottom_left)
|
||||
self.bottom = QFrame(self.container_bottom)
|
||||
self.bottom.setObjectName(u"bottom")
|
||||
self.bottom.setCursor(QCursor(Qt.SizeVerCursor))
|
||||
self.bottom.setStyleSheet(u"background-color: rgb(85, 170, 0);")
|
||||
self.bottom.setFrameShape(QFrame.NoFrame)
|
||||
self.bottom.setFrameShadow(QFrame.Raised)
|
||||
self.bottom_layout.addWidget(self.bottom)
|
||||
self.bottom_right = QFrame(self.container_bottom)
|
||||
self.bottom_right.setObjectName(u"bottom_right")
|
||||
self.bottom_right.setMinimumSize(QSize(10, 10))
|
||||
self.bottom_right.setMaximumSize(QSize(10, 10))
|
||||
self.bottom_right.setCursor(QCursor(Qt.SizeFDiagCursor))
|
||||
self.bottom_right.setStyleSheet(u"background-color: rgb(33, 37, 43);")
|
||||
self.bottom_right.setFrameShape(QFrame.NoFrame)
|
||||
self.bottom_right.setFrameShadow(QFrame.Raised)
|
||||
self.bottom_layout.addWidget(self.bottom_right)
|
||||
|
||||
def left(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
self.leftgrip = QFrame(Form)
|
||||
self.leftgrip.setObjectName(u"left")
|
||||
self.leftgrip.setGeometry(QRect(0, 10, 10, 480))
|
||||
self.leftgrip.setMinimumSize(QSize(10, 0))
|
||||
self.leftgrip.setCursor(QCursor(Qt.SizeHorCursor))
|
||||
self.leftgrip.setStyleSheet(u"background-color: rgb(255, 121, 198);")
|
||||
self.leftgrip.setFrameShape(QFrame.NoFrame)
|
||||
self.leftgrip.setFrameShadow(QFrame.Raised)
|
||||
|
||||
def right(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
Form.resize(500, 500)
|
||||
self.rightgrip = QFrame(Form)
|
||||
self.rightgrip.setObjectName(u"right")
|
||||
self.rightgrip.setGeometry(QRect(0, 0, 10, 500))
|
||||
self.rightgrip.setMinimumSize(QSize(10, 0))
|
||||
self.rightgrip.setCursor(QCursor(Qt.SizeHorCursor))
|
||||
self.rightgrip.setStyleSheet(u"background-color: rgb(255, 0, 127);")
|
||||
self.rightgrip.setFrameShape(QFrame.NoFrame)
|
||||
self.rightgrip.setFrameShadow(QFrame.Raised)
|
||||
@@ -0,0 +1,19 @@
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
#
|
||||
# BY: WANDERSON M.PIMENTA
|
||||
# PROJECT MADE WITH: Qt Designer and PySide6
|
||||
# V: 1.0.0
|
||||
#
|
||||
# This project can be used freely for all uses, as long as they maintain the
|
||||
# respective credits only in the Python scripts, any information in the visual
|
||||
# interface (GUI) can be modified without any implication.
|
||||
#
|
||||
# There are limitations on Qt licenses if you want to use your products
|
||||
# commercially, I recommend reading them on the official website:
|
||||
# https://doc.qt.io/qtforpython/licenses.html
|
||||
#
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
|
||||
# FRIEND MENU MESSAGE / MESSAGE BUTTON
|
||||
# Friends messages with name and status
|
||||
from . friend_message_button import FriendMessageButton
|
||||
@@ -0,0 +1,230 @@
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
#
|
||||
# BY: WANDERSON M.PIMENTA
|
||||
# PROJECT MADE WITH: Qt Designer and PySide6
|
||||
# V: 1.0.0
|
||||
#
|
||||
# This project can be used freely for all uses, as long as they maintain the
|
||||
# respective credits only in the Python scripts, any information in the visual
|
||||
# interface (GUI) can be modified without any implication.
|
||||
#
|
||||
# There are limitations on Qt licenses if you want to use your products
|
||||
# commercially, I recommend reading them on the official website:
|
||||
# https://doc.qt.io/qtforpython/licenses.html
|
||||
#
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
|
||||
# IMPORT
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
# Packages
|
||||
from app.packages.pyside_or_pyqt import *
|
||||
# Modules
|
||||
import os
|
||||
|
||||
# FRIEND MENU MESSAGE / MESSAGE BUTTON
|
||||
# Friends messages with name and status
|
||||
class FriendMessageButton(QWidget):
|
||||
# SIGNALS
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
clicked = Signal()
|
||||
released = Signal()
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
id,
|
||||
user_image,
|
||||
user_name,
|
||||
user_descrition,
|
||||
user_status,
|
||||
unread_messages,
|
||||
is_active
|
||||
):
|
||||
QWidget.__init__(self)
|
||||
|
||||
# ICON PATH
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
image = user_image
|
||||
app_path = os.path.abspath(os.getcwd())
|
||||
image_path = os.path.join(app_path, image)
|
||||
|
||||
# CUSTOM PARAMETERS
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
self.user_image = image_path
|
||||
self.user_name = user_name
|
||||
self.user_description = user_descrition
|
||||
self.user_status = user_status
|
||||
self.unread_messages = unread_messages
|
||||
self.is_active = is_active
|
||||
self._status_color = "#46b946"
|
||||
self.bg_color_entered = "#22CCCCCC"
|
||||
self.bg_color_leave = "#00000000"
|
||||
self.bg_color_active = "#33CCCCCC"
|
||||
self._bg_color = self.bg_color_leave
|
||||
|
||||
|
||||
# SETUP
|
||||
self.setFixedSize(240, 50)
|
||||
self.setCursor(Qt.PointingHandCursor)
|
||||
self.setObjectName(str(id))
|
||||
self.setup_ui()
|
||||
|
||||
# SHOW UNREAD MESSAGES
|
||||
if self.unread_messages > 0:
|
||||
self.label_messages.show()
|
||||
self.label_messages.setText(str(self.unread_messages))
|
||||
|
||||
# CHANGE COLOR
|
||||
if self.user_status == "online":
|
||||
self._status_color = "#46b946"
|
||||
elif self.user_status == "ilde":
|
||||
self._status_color = "#ff9955"
|
||||
elif self.user_status == "busy":
|
||||
self._status_color = "#a02c2c"
|
||||
elif self.user_status == "invisible":
|
||||
self._status_color = "#808080"
|
||||
|
||||
# CHANGE OPACITY
|
||||
if self.user_status == "invisible":
|
||||
self.opacity = QGraphicsOpacityEffect()
|
||||
self.opacity.setOpacity(0.4)
|
||||
self.setGraphicsEffect(self.opacity)
|
||||
|
||||
def reset_unread_message(self):
|
||||
self.unread_messages = 0
|
||||
self.label_messages.hide()
|
||||
self.repaint()
|
||||
|
||||
# MOUSE PRESS
|
||||
# Event triggered when the left button is pressed
|
||||
def mousePressEvent(self, event):
|
||||
if event.button() == Qt.LeftButton:
|
||||
# EMIT SIGNAL
|
||||
self.clicked.emit()
|
||||
|
||||
# MOUSE RELEASE
|
||||
# Event fired when the mouse leaves the BTN
|
||||
def mouseReleaseEvent(self, event):
|
||||
if event.button() == Qt.LeftButton:
|
||||
self.released.emit()
|
||||
|
||||
# MOUSE ENTER
|
||||
# Event fired when the mouse enter
|
||||
def enterEvent(self, event):
|
||||
if not self.is_active:
|
||||
self._bg_color = self.bg_color_entered
|
||||
self.repaint()
|
||||
|
||||
# MOUSE LEAVE
|
||||
# Event fired when the mouse leave
|
||||
def leaveEvent(self, event):
|
||||
if not self.is_active:
|
||||
self._bg_color = self.bg_color_leave
|
||||
self.repaint()
|
||||
|
||||
def set_active(self, active):
|
||||
if active:
|
||||
self.is_active = active
|
||||
else:
|
||||
self.is_active = active
|
||||
self._bg_color = self.bg_color_leave
|
||||
self.repaint()
|
||||
|
||||
# SETUP WIDGETS
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
def setup_ui(self):
|
||||
# FRAME TEXT
|
||||
self.text_frame = QFrame(self)
|
||||
self.text_frame.setGeometry(60, 0, 170, 50)
|
||||
|
||||
# USER NAME
|
||||
self.label_user = QLabel(self.text_frame)
|
||||
self.label_user.setGeometry(0, 8, self.text_frame.width(), 20)
|
||||
self.label_user.setAlignment(Qt.AlignVCenter)
|
||||
self.label_user.setText(self.user_name.capitalize())
|
||||
self.label_user.setStyleSheet("color: #e7e7e7; font: 700 10pt 'Segoe UI';")
|
||||
|
||||
# USER STATUS
|
||||
self.label_description = QLabel(self.text_frame)
|
||||
self.label_description.setGeometry(0, 22, self.text_frame.width(), 18)
|
||||
self.label_description.setAlignment(Qt.AlignVCenter)
|
||||
self.label_description.setText(self.user_description)
|
||||
self.label_description.setStyleSheet("color: #A6A6A6; font: 9pt 'Segoe UI';")
|
||||
|
||||
# USER STATUS
|
||||
self.label_messages = QLabel(self)
|
||||
self.label_messages.setFixedSize(35, 20)
|
||||
self.label_messages.setAlignment(Qt.AlignCenter)
|
||||
self.label_messages.setStyleSheet("""
|
||||
background-color: #1e2021;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
color: #bdff00;
|
||||
border-radius: 10px;
|
||||
border: 3px solid #333;
|
||||
font: 9pt 'Segoe UI';
|
||||
""")
|
||||
self.label_messages.move(self.width() - 45, 16)
|
||||
self.label_messages.hide()
|
||||
|
||||
# PAINT EVENT
|
||||
# PAINT USER IMAGE EVENTS
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
def paintEvent(self, event):
|
||||
# PAINTER USER IMAGE
|
||||
painter = QPainter()
|
||||
painter.begin(self)
|
||||
painter.setRenderHint(QPainter.Antialiasing)
|
||||
painter.setPen(Qt.NoPen)
|
||||
|
||||
# RECT
|
||||
rect = QRect(10, 5, 40, 40)
|
||||
|
||||
# DRAW BG
|
||||
if self.is_active:
|
||||
painter.setBrush(QBrush(QColor(self.bg_color_active)))
|
||||
else:
|
||||
painter.setBrush(QBrush(QColor(self._bg_color)))
|
||||
painter.drawRoundedRect(5, 0, 230, 50, 25, 25)
|
||||
|
||||
# CIRCLE
|
||||
painter.setBrush(QBrush(QColor("#000000")))
|
||||
painter.drawEllipse(rect)
|
||||
|
||||
# DRAW USER IMAGE
|
||||
self.draw_user_image(painter, self.user_image, rect)
|
||||
|
||||
painter.end()
|
||||
|
||||
# DRAW USER IMAGE
|
||||
if self.user_status != "invisible":
|
||||
self.draw_status(self.user_image, rect)
|
||||
|
||||
# DRAW USER IMAGE
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
def draw_user_image(self, qp, image, rect):
|
||||
user_image = QImage(image)
|
||||
path = QPainterPath()
|
||||
path.addEllipse(rect)
|
||||
qp.setClipPath(path)
|
||||
qp.drawImage(rect, user_image)
|
||||
|
||||
# DRAW STATUS
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
def draw_status(self, status, rect):
|
||||
painter = QPainter()
|
||||
painter.begin(self)
|
||||
painter.setRenderHint(QPainter.Antialiasing)
|
||||
|
||||
# PEN
|
||||
pen = QPen()
|
||||
pen.setWidth(3)
|
||||
pen.setColor(QColor("#151617"))
|
||||
painter.setPen(pen)
|
||||
|
||||
# BRUSH/STATUS COLOR
|
||||
painter.setBrush(QBrush(QColor(self._status_color)))
|
||||
|
||||
# DRAW
|
||||
painter.drawEllipse(rect.x() + 27, rect.y() + 27, 13, 13)
|
||||
painter.end()
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
#
|
||||
# BY: WANDERSON M.PIMENTA
|
||||
# PROJECT MADE WITH: Qt Designer and PySide6
|
||||
# V: 1.0.0
|
||||
#
|
||||
# This project can be used freely for all uses, as long as they maintain the
|
||||
# respective credits only in the Python scripts, any information in the visual
|
||||
# interface (GUI) can be modified without any implication.
|
||||
#
|
||||
# There are limitations on Qt licenses if you want to use your products
|
||||
# commercially, I recommend reading them on the official website:
|
||||
# https://doc.qt.io/qtforpython/licenses.html
|
||||
#
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
|
||||
# LEFT MENU BUTTON
|
||||
# Custom button with tooltip
|
||||
from . left_menu_button import LeftMenuButton
|
||||
@@ -0,0 +1,226 @@
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
#
|
||||
# BY: WANDERSON M.PIMENTA
|
||||
# PROJECT MADE WITH: Qt Designer and PySide6
|
||||
# V: 1.0.0
|
||||
#
|
||||
# This project can be used freely for all uses, as long as they maintain the
|
||||
# respective credits only in the Python scripts, any information in the visual
|
||||
# interface (GUI) can be modified without any implication.
|
||||
#
|
||||
# There are limitations on Qt licenses if you want to use your products
|
||||
# commercially, I recommend reading them on the official website:
|
||||
# https://doc.qt.io/qtforpython/licenses.html
|
||||
#
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
|
||||
# IMPORT
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
# Packages
|
||||
from app.packages.pyside_or_pyqt import *
|
||||
# Modules
|
||||
import app.modules.ui_functions.functions as ui_functions
|
||||
from app.modules.app_settings.settings import *
|
||||
import os
|
||||
|
||||
# TOOLTIP / LABEL StyleSheet
|
||||
style_tooltip = """
|
||||
QLabel {
|
||||
background-color: #0b0b0c;
|
||||
color: rgb(230, 230, 230);
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
border-radius: 17px;
|
||||
border: 1px solid #2f3032;
|
||||
border-left: 3px solid #bdff00;
|
||||
font: 800 9pt "Segoe UI";
|
||||
}
|
||||
"""
|
||||
|
||||
# CUSTOM LEFT MENU
|
||||
class LeftMenuButton(QWidget):
|
||||
# SIGNALS
|
||||
clicked = Signal()
|
||||
released = Signal()
|
||||
|
||||
def __init__(self, parent, name, icon, tooltip):
|
||||
QWidget.__init__(self)
|
||||
# APP PATH
|
||||
app_path = os.path.abspath(os.getcwd())
|
||||
icon_path = os.path.join(app_path, icon)
|
||||
|
||||
# GET SETTINGS
|
||||
settings = Settings()
|
||||
self.settings = settings.items
|
||||
|
||||
# DEFAULT PARAMETERS
|
||||
self.width = 40
|
||||
self.height = 40
|
||||
self.pos_x = 0
|
||||
self.pos_y = 0
|
||||
self.border_radius = 10
|
||||
self.parent = parent
|
||||
self.setGeometry(0, 0, self.width, self.height)
|
||||
self.setMinimumSize(self.width, self.height)
|
||||
self.setCursor(Qt.PointingHandCursor)
|
||||
self.setObjectName(name)
|
||||
|
||||
# BG COLORS
|
||||
self.color_default = QColor(self.settings["left_menu"]["color"])
|
||||
self.color_hover = QColor(self.settings["left_menu"]["color_hover"])
|
||||
self.color_pressed = QColor(self.settings["left_menu"]["color_pressed"])
|
||||
self._set_color = self.color_default
|
||||
|
||||
# ICON
|
||||
self.icon_color = QColor(0xE6E6E6)
|
||||
self.icon_color_pressed = QColor(0x151617)
|
||||
self._set_icon_path = icon_path
|
||||
self._set_icon_color = self.icon_color
|
||||
|
||||
# TOOLTIP
|
||||
self.tooltip_text = tooltip
|
||||
self.tooltip = _ToolTip(parent, tooltip)
|
||||
self.tooltip.hide()
|
||||
|
||||
# PAINT EVENT
|
||||
# Responsible for painting the button, as well as the icon
|
||||
def paintEvent(self, event):
|
||||
# PAINTER
|
||||
paint = QPainter()
|
||||
paint.begin(self)
|
||||
paint.setRenderHint(QPainter.RenderHint.Antialiasing)
|
||||
|
||||
# BRUSH
|
||||
brush = QBrush(self._set_color)
|
||||
|
||||
# CREATE RECTANGLE
|
||||
rect = QRect(0, 0, self.width, self.height)
|
||||
paint.setPen(Qt.NoPen)
|
||||
paint.setBrush(brush)
|
||||
paint.drawRoundedRect(rect, self.border_radius, self.border_radius)
|
||||
|
||||
# DRAW ICONS
|
||||
self.icon_paint(paint, self._set_icon_path, rect)
|
||||
|
||||
# END PAINTER
|
||||
paint.end()
|
||||
|
||||
# DRAW ICON WITH COLORS
|
||||
def icon_paint(self, qp, image, rect):
|
||||
icon = QPixmap(image)
|
||||
painter = QPainter(icon)
|
||||
painter.setCompositionMode(QPainter.CompositionMode_SourceIn)
|
||||
painter.fillRect(icon.rect(), self._set_icon_color)
|
||||
qp.drawPixmap(
|
||||
(rect.width() - icon.width()) / 2,
|
||||
(rect.height() - icon.height()) / 2,
|
||||
icon
|
||||
)
|
||||
painter.end()
|
||||
|
||||
# REPAINT BTN
|
||||
# Reaload/Repaint BTN
|
||||
def repaint_btn(self, event):
|
||||
if event == QEvent.Enter:
|
||||
self.repaint()
|
||||
if event == QEvent.Leave:
|
||||
self.repaint()
|
||||
if event == QEvent.MouseButtonPress:
|
||||
self.repaint()
|
||||
if event == QEvent.MouseButtonRelease:
|
||||
self.repaint()
|
||||
|
||||
# CHANGE STYLES
|
||||
# Functions with custom styles
|
||||
def change_style(self, event):
|
||||
if event == QEvent.Enter:
|
||||
self._set_color = self.color_hover
|
||||
self.repaint_btn(event)
|
||||
elif event == QEvent.Leave:
|
||||
self._set_color = self.color_default
|
||||
self.repaint_btn(event)
|
||||
elif event == QEvent.MouseButtonPress:
|
||||
self._set_color = self.color_pressed
|
||||
self._set_icon_color = self.icon_color_pressed
|
||||
self.repaint_btn(event)
|
||||
elif event == QEvent.MouseButtonRelease:
|
||||
self._set_color = self.color_hover
|
||||
self._set_icon_color = self.icon_color
|
||||
self.repaint_btn(event)
|
||||
|
||||
# MOVE TOOLTIP
|
||||
def move_tooltip(self):
|
||||
# GET MAIN WINDOW PARENT
|
||||
gp = self.mapToGlobal(QPoint(0, 0))
|
||||
|
||||
# SET WIDGET TO GET POSTION
|
||||
# Return absolute position of widget inside app
|
||||
pos = self.parent.mapFromGlobal(gp)
|
||||
|
||||
# FORMAT POSITION
|
||||
# Adjust tooltip position with offset
|
||||
pos_x = pos.x() + self.width + 12
|
||||
pos_y = pos.y() + (self.width - self.tooltip.height()) // 2
|
||||
|
||||
# SET POSITION TO WIDGET
|
||||
# Move tooltip position
|
||||
self.tooltip.move(pos_x, pos_y)
|
||||
|
||||
# MOUSE OVER
|
||||
# Event triggered when the mouse is over the BTN
|
||||
def enterEvent(self, event):
|
||||
self.change_style(QEvent.Enter)
|
||||
self.move_tooltip()
|
||||
self.tooltip.show()
|
||||
|
||||
# MOUSE LEAVE
|
||||
# Event fired when the mouse leaves the BTN
|
||||
def leaveEvent(self, event):
|
||||
self.change_style(QEvent.Leave)
|
||||
self.move_tooltip()
|
||||
self.tooltip.hide()
|
||||
|
||||
# MOUSE PRESS
|
||||
# Event triggered when the left button is pressed
|
||||
def mousePressEvent(self, event):
|
||||
if event.button() == Qt.LeftButton:
|
||||
self.change_style(QEvent.MouseButtonPress)
|
||||
# EMIT SIGNAL
|
||||
self.clicked.emit()
|
||||
# SET FOCUS
|
||||
self.setFocus()
|
||||
|
||||
# MOUSE RELEASED
|
||||
# Event triggered after the mouse button is released
|
||||
def mouseReleaseEvent(self, event):
|
||||
if event.button() == Qt.LeftButton:
|
||||
self.change_style(QEvent.MouseButtonRelease)
|
||||
# EMIT SIGNAL
|
||||
self.released.emit()
|
||||
|
||||
class _ToolTip(QLabel):
|
||||
def __init__(self, parent, tooltip):
|
||||
QLabel.__init__(self)
|
||||
|
||||
# LABEL SETUP
|
||||
self.setObjectName(u"label_tooltip")
|
||||
self.setStyleSheet(style_tooltip)
|
||||
self.setMinimumHeight(36)
|
||||
self.setParent(parent)
|
||||
self.setText(tooltip)
|
||||
self.adjustSize()
|
||||
|
||||
# SET DROP SHADOW
|
||||
self.shadow = QGraphicsDropShadowEffect(self)
|
||||
self.shadow.setBlurRadius(15)
|
||||
self.shadow.setXOffset(0)
|
||||
self.shadow.setYOffset(0)
|
||||
self.shadow.setColor(QColor(0, 0, 0, 160))
|
||||
self.setGraphicsEffect(self.shadow)
|
||||
|
||||
# SET OPACITY
|
||||
self.opacity = QGraphicsOpacityEffect(self)
|
||||
self.opacity.setOpacity(0.85)
|
||||
self.setGraphicsEffect(self.opacity)
|
||||
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>220</width>
|
||||
<height>30</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>220</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="label_layout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QLabel {
|
||||
background-color: rgb(12, 12, 13);
|
||||
color: rgb(230, 230, 230);
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
border-radius: 8px;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>ToolTip</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,20 @@
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
#
|
||||
# BY: WANDERSON M.PIMENTA
|
||||
# PROJECT MADE WITH: Qt Designer and PySide6
|
||||
# V: 1.0.0
|
||||
#
|
||||
# This project can be used freely for all uses, as long as they maintain the
|
||||
# respective credits only in the Python scripts, any information in the visual
|
||||
# interface (GUI) can be modified without any implication.
|
||||
#
|
||||
# There are limitations on Qt licenses if you want to use your products
|
||||
# commercially, I recommend reading them on the official website:
|
||||
# https://doc.qt.io/qtforpython/licenses.html
|
||||
#
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
|
||||
# TOP USER BOX
|
||||
# Top user information and status
|
||||
from . top_user_box import TopUserInfo
|
||||
|
||||
@@ -0,0 +1,362 @@
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
#
|
||||
# BY: WANDERSON M.PIMENTA
|
||||
# PROJECT MADE WITH: Qt Designer and PySide6
|
||||
# V: 1.0.0
|
||||
#
|
||||
# This project can be used freely for all uses, as long as they maintain the
|
||||
# respective credits only in the Python scripts, any information in the visual
|
||||
# interface (GUI) can be modified without any implication.
|
||||
#
|
||||
# There are limitations on Qt licenses if you want to use your products
|
||||
# commercially, I recommend reading them on the official website:
|
||||
# https://doc.qt.io/qtforpython/licenses.html
|
||||
#
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
|
||||
# IMPORT
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
# Packages
|
||||
from app.packages.pyside_or_pyqt import *
|
||||
# Modules
|
||||
import os
|
||||
|
||||
# TOP USER BOX
|
||||
# Top box with name, description and status
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
class TopUserInfo(QWidget):
|
||||
status = Signal(str)
|
||||
def __init__(self, parent, left, top, my_name, my_description):
|
||||
QWidget.__init__(self)
|
||||
|
||||
# ICON PATH
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
image = "images/users/me.png"
|
||||
icon_settings = "images/icons_svg/icon_settings.svg"
|
||||
app_path = os.path.abspath(os.getcwd())
|
||||
image_path = os.path.join(app_path, image)
|
||||
icon_settings_path = os.path.join(app_path, icon_settings)
|
||||
|
||||
# INITIAL SETUP
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
self.setGeometry(0, 0, 240, 60)
|
||||
self.setObjectName("top_text_box")
|
||||
self.setStyleSheet("#top_text_box { background-color: #F00000 }")
|
||||
|
||||
# CUSTOM PARAMETERS
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
self.user_name = my_name
|
||||
self.user_description = my_description
|
||||
self.user_status = "online"
|
||||
self.user_image = image_path
|
||||
self.icon_settings = icon_settings
|
||||
self._status_color = "#46b946"
|
||||
|
||||
# DRAW BASE FRAME
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
self.setup_ui()
|
||||
|
||||
# IMAGE FRAME EVENTS
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
self.user_overlay.mousePressEvent = self.mouse_press
|
||||
self.user_overlay.enterEvent = self.mouse_enter
|
||||
self.user_overlay.leaveEvent = self.mouse_leave
|
||||
|
||||
# SETUP STATUS BOX
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
self.status_box = _ChangeStatus(parent)
|
||||
self.status_box.move(left, top)
|
||||
self.status_box.focusOutEvent = self.lost_focus_status_box
|
||||
self.status_box.line_edit.focusOutEvent = self.lost_focus_line_edit
|
||||
self.status_box.line_edit.keyReleaseEvent = self.change_description
|
||||
self.status_box.hide()
|
||||
self.status_box.status.connect(self.change_status)
|
||||
|
||||
# CHANGE USER STATUS
|
||||
# Change when is connected with status signal
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
def change_status(self, status):
|
||||
# CHANGE STATUS
|
||||
if status == "online":
|
||||
self._status_color = "#46b946"
|
||||
self.repaint()
|
||||
elif status == "idle":
|
||||
self._status_color = "#ff9955"
|
||||
self.repaint()
|
||||
elif status == "busy":
|
||||
self._status_color = "#a02c2c"
|
||||
self.repaint()
|
||||
elif status == "invisible":
|
||||
self._status_color = "#808080"
|
||||
self.repaint()
|
||||
# EMIT SIGNAL
|
||||
self.status.emit(status)
|
||||
|
||||
# CHANGE TEXT DESCRIPTION
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
def change_description(self, event):
|
||||
if event.key() == Qt.Key_Return or event.key() == Qt.Key_Enter:
|
||||
self.label_description.setText(self.status_box.line_edit.text())
|
||||
self.status_box.line_edit.setText("")
|
||||
self.status_box.hide()
|
||||
|
||||
# SHO HIDE DIALOP POPUP
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
# HIDE LINE EDIT WHEN LOST FOCUS
|
||||
def lost_focus_status_box(self, event):
|
||||
if not self.status_box.line_edit.hasFocus():
|
||||
self.status_box.hide()
|
||||
self.status_box.line_edit.setText("")
|
||||
|
||||
# HIDE WHEN LOST FOCUS
|
||||
def lost_focus_line_edit(self, event):
|
||||
if not self.status_box.hasFocus():
|
||||
self.status_box.hide()
|
||||
self.status_box.line_edit.setText("")
|
||||
|
||||
# OPEN STATUS BOX POPUP
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
def mouse_press(self, event):
|
||||
if self.status_box.isVisible():
|
||||
self.status_box.hide()
|
||||
self.status_box.line_edit.setText("")
|
||||
else:
|
||||
self.status_box.show()
|
||||
self.status_box.line_edit.setFocus()
|
||||
|
||||
# SHOW ICON
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
def mouse_enter(self, event):
|
||||
self.user_overlay.setPixmap(self.icon_settings)
|
||||
|
||||
# HIDE ICON
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
def mouse_leave(self, event):
|
||||
self.user_overlay.setPixmap(None)
|
||||
|
||||
# SETUP WIDGETS
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
def setup_ui(self):
|
||||
# LAYOUT AND BORDER
|
||||
self.layout = QVBoxLayout(self)
|
||||
self.layout.setContentsMargins(10,10,10,0)
|
||||
self.border = QFrame(self)
|
||||
self.layout.addWidget(self.border)
|
||||
|
||||
# FRAME IMAGE
|
||||
self.user_overlay = QLabel(self.border)
|
||||
self.user_overlay.setGeometry(0, 5, 40, 40)
|
||||
self.user_overlay.setCursor(QCursor(Qt.PointingHandCursor))
|
||||
self.user_overlay.setAlignment(Qt.AlignCenter)
|
||||
opacity = QGraphicsOpacityEffect(self)
|
||||
opacity.setOpacity(0.75)
|
||||
self.user_overlay.setGraphicsEffect(opacity)
|
||||
|
||||
# FRAME TEXT
|
||||
self.text_frame = QFrame(self.border)
|
||||
self.text_frame.setGeometry(50, 0, 170, 50)
|
||||
|
||||
# USER NAME
|
||||
self.label_user = QLabel(self.text_frame)
|
||||
self.label_user.setGeometry(0, 8, self.text_frame.width(), 20)
|
||||
self.label_user.setAlignment(Qt.AlignVCenter)
|
||||
self.label_user.setText(self.user_name.capitalize())
|
||||
self.label_user.setStyleSheet("color: #bdff00; font: 700 10pt 'Segoe UI';")
|
||||
|
||||
# USER STATUS
|
||||
self.label_description = QLabel(self.text_frame)
|
||||
self.label_description.setGeometry(0, 22, self.text_frame.width(), 18)
|
||||
self.label_description.setAlignment(Qt.AlignVCenter)
|
||||
self.label_description.setText(self.user_description)
|
||||
self.label_description.setStyleSheet("color: #A6A6A6; font: 9pt 'Segoe UI';")
|
||||
|
||||
# PAINT USER IMAGE EVENTS
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
def paintEvent(self, event):
|
||||
# PAINTER USER IMAGE
|
||||
painter = QPainter()
|
||||
painter.begin(self)
|
||||
painter.setRenderHint(QPainter.Antialiasing)
|
||||
|
||||
# RECT
|
||||
rect = QRect(10, 15, 40, 40)
|
||||
|
||||
# CIRCLE
|
||||
painter.setPen(Qt.NoPen)
|
||||
painter.setBrush(QBrush(QColor("#000000")))
|
||||
painter.drawEllipse(rect)
|
||||
|
||||
# DRAW USER IMAGE
|
||||
self.draw_user_image(painter, self.user_image, rect)
|
||||
|
||||
# PAINT END
|
||||
painter.end()
|
||||
|
||||
# DRAW USER IMAGE
|
||||
self.draw_status(self.user_image, rect)
|
||||
|
||||
# DRAW USER IMAGE
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
def draw_user_image(self, qp, image, rect):
|
||||
user_image = QImage(image)
|
||||
path = QPainterPath()
|
||||
path.addEllipse(rect)
|
||||
qp.setClipPath(path)
|
||||
qp.drawImage(rect, user_image)
|
||||
|
||||
# DRAW STATUS
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
def draw_status(self, status, rect):
|
||||
painter = QPainter()
|
||||
painter.begin(self)
|
||||
painter.setRenderHint(QPainter.Antialiasing)
|
||||
|
||||
# PEN
|
||||
pen = QPen()
|
||||
pen.setWidth(3)
|
||||
pen.setColor(QColor("#151617"))
|
||||
painter.setPen(pen)
|
||||
|
||||
# BRUSH/STATUS COLOR
|
||||
painter.setBrush(QBrush(QColor(self._status_color)))
|
||||
|
||||
# DRAW
|
||||
painter.drawEllipse(rect.x() + 27, rect.y() + 27, 13, 13)
|
||||
painter.end()
|
||||
|
||||
# SET STYLE TO POPUP
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
style = """
|
||||
/* QFrame */
|
||||
QFrame {
|
||||
background: #333436; border-radius: 10px;
|
||||
}
|
||||
/* Search Message */
|
||||
.QLineEdit {
|
||||
border: 2px solid rgb(47, 48, 50);
|
||||
border-radius: 15px;
|
||||
background-color: rgb(47, 48, 50);
|
||||
color: rgb(121, 121, 121);
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
.QLineEdit:hover {
|
||||
color: rgb(230, 230, 230);
|
||||
border: 2px solid rgb(62, 63, 66);
|
||||
}
|
||||
.QLineEdit:focus {
|
||||
color: rgb(230, 230, 230);
|
||||
border: 2px solid rgb(53, 54, 56);
|
||||
background-color: rgb(14, 14, 15);
|
||||
}
|
||||
/* QPushButton */
|
||||
.QPushButton{
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
border-radius: 10px;
|
||||
background-repeat: no-repeat;
|
||||
background-position: left center;
|
||||
text-align: left;
|
||||
color: #999999;
|
||||
padding-left: 38px;
|
||||
}
|
||||
.QPushButton:hover{
|
||||
background-color: #151617;
|
||||
color: #CCCCCC;
|
||||
}
|
||||
|
||||
"""
|
||||
# CHAN STATUS POPUP
|
||||
# # ///////////////////////////////////////////////////////////////
|
||||
class _ChangeStatus(QFrame):
|
||||
status = Signal(str)
|
||||
def __init__(self, parent):
|
||||
QFrame.__init__(self)
|
||||
|
||||
# SETUP
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
self.setFixedSize(230, 205)
|
||||
self.setStyleSheet(style)
|
||||
self.setParent(parent)
|
||||
|
||||
# LAYOUT AND BORDER
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
self.layout = QVBoxLayout(self)
|
||||
self.layout.setContentsMargins(10,10,10,10)
|
||||
self.border = QFrame(self)
|
||||
self.layout.addWidget(self.border)
|
||||
|
||||
# LINEEDIT AND BTNS BOX
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
self.layout_content = QVBoxLayout(self.border)
|
||||
self.layout_content.setContentsMargins(0,0,0,0)
|
||||
self.layout_content.setSpacing(1)
|
||||
|
||||
# CHANGE DESCRIPTION
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
self.line_edit = QLineEdit()
|
||||
self.line_edit.setMinimumHeight(30)
|
||||
self.line_edit.setPlaceholderText("Write what you are doing...")
|
||||
|
||||
# TOP LABEL
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
self.label = QLabel("Change status:")
|
||||
self.label.setStyleSheet("padding-top: 5px; padding-bottom: 5px; color: rgb(121, 121, 121);")
|
||||
|
||||
# BTN ONLINE
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
self.btn_online = QPushButton()
|
||||
self.btn_online.setText("Online")
|
||||
self.btn_online.setMinimumHeight(30)
|
||||
self.btn_online.setStyleSheet("background-image: url(:/icons_svg/images/icons_svg/icon_online.svg)")
|
||||
self.btn_online.clicked.connect(lambda: self.send_signal("online"))
|
||||
self.btn_online.setCursor(Qt.PointingHandCursor)
|
||||
|
||||
# BTNL ILDE
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
self.btn_idle = QPushButton()
|
||||
self.btn_idle.setText("Idle")
|
||||
self.btn_idle.setMinimumHeight(30)
|
||||
self.btn_idle.setStyleSheet("background-image: url(:/icons_svg/images/icons_svg/icon_idle.svg)")
|
||||
self.btn_idle.clicked.connect(lambda: self.send_signal("idle"))
|
||||
self.btn_idle.setCursor(Qt.PointingHandCursor)
|
||||
|
||||
# BTN BUSE
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
self.btn_busy = QPushButton()
|
||||
self.btn_busy.setText("Do not disturb")
|
||||
self.btn_busy.setMinimumHeight(30)
|
||||
self.btn_busy.setStyleSheet("background-image: url(:/icons_svg/images/icons_svg/icon_busy.svg)")
|
||||
self.btn_busy.clicked.connect(lambda: self.send_signal("busy"))
|
||||
self.btn_busy.setCursor(Qt.PointingHandCursor)
|
||||
|
||||
# BTN INVISIBLE
|
||||
self.btn_invisible = QPushButton()
|
||||
self.btn_invisible.setText("Invisible")
|
||||
self.btn_invisible.setMinimumHeight(30)
|
||||
self.btn_invisible.setStyleSheet("background-image: url(:/icons_svg/images/icons_svg/icon_invisible.svg)")
|
||||
self.btn_invisible.clicked.connect(lambda: self.send_signal("invisible"))
|
||||
self.btn_invisible.setCursor(Qt.PointingHandCursor)
|
||||
|
||||
# ADD WIDGETS TO LAYOUT
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
self.layout_content.addWidget(self.line_edit)
|
||||
self.layout_content.addWidget(self.label)
|
||||
self.layout_content.addWidget(self.btn_online)
|
||||
self.layout_content.addWidget(self.btn_idle)
|
||||
self.layout_content.addWidget(self.btn_busy)
|
||||
self.layout_content.addWidget(self.btn_invisible)
|
||||
|
||||
# SET DROP SHADOW
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
self.shadow = QGraphicsDropShadowEffect(self)
|
||||
self.shadow.setBlurRadius(15)
|
||||
self.shadow.setXOffset(0)
|
||||
self.shadow.setYOffset(0)
|
||||
self.shadow.setColor(QColor(0, 0, 0, 160))
|
||||
self.setGraphicsEffect(self.shadow)
|
||||
|
||||
# SEND SIGNAL TO TOP USER WIDGET
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
def send_signal(self, status):
|
||||
self.status.emit(status)
|
||||
@@ -0,0 +1,110 @@
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
#
|
||||
# BY: WANDERSON M.PIMENTA
|
||||
# PROJECT MADE WITH: Qt Designer and PySide6
|
||||
# V: 1.0.0
|
||||
#
|
||||
# This project can be used freely for all uses, as long as they maintain the
|
||||
# respective credits only in the Python scripts, any information in the visual
|
||||
# interface (GUI) can be modified without any implication.
|
||||
#
|
||||
# There are limitations on Qt licenses if you want to use your products
|
||||
# commercially, I recommend reading them on the official website:
|
||||
# https://doc.qt.io/qtforpython/licenses.html
|
||||
#
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
|
||||
# DEFAULT PACKAGES
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
import os
|
||||
|
||||
# IMPORT / GUI, SETTINGS AND WIDGETS
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
# Packages
|
||||
from datetime import datetime
|
||||
from app.packages.pyside_or_pyqt import * # Qt
|
||||
|
||||
# GLOBALS
|
||||
send_by = None
|
||||
|
||||
# MAIN WINDOW
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
class Message(QWidget):
|
||||
def __init__(self, message, me_send):
|
||||
QWidget.__init__(self)
|
||||
global send_by
|
||||
send_by = me_send
|
||||
|
||||
self.setMinimumHeight(20)
|
||||
self.setup_ui()
|
||||
self.setFixedHeight(self.layout.sizeHint().height())
|
||||
|
||||
# SET MESSAGE
|
||||
self.message.setText(message)
|
||||
|
||||
# SET DATE TIME
|
||||
date_time = datetime.now()
|
||||
date_time_format = date_time.strftime("%m/%d/%Y %H:%M")
|
||||
self.data_message.setText(str(date_time_format))
|
||||
|
||||
def setup_ui(self):
|
||||
# LAYOUT
|
||||
self.layout = QHBoxLayout(self)
|
||||
self.layout.setContentsMargins(0,0,0,0)
|
||||
|
||||
# FRAME BG
|
||||
self.bg = QFrame()
|
||||
if send_by:
|
||||
self.bg.setStyleSheet("#bg {background-color: #0e0e0f; border-radius: 10px; margin-left: 150px; } #bg:hover { background-color: #252628; }")
|
||||
else:
|
||||
self.bg.setStyleSheet("#bg {background-color: #28282b; border-radius: 10px; margin-right: 150px; } #bg:hover { background-color: #252628; }")
|
||||
self.bg.setObjectName("bg")
|
||||
|
||||
# FRAME BG
|
||||
self.btn = QPushButton()
|
||||
self.btn.setMinimumSize(40, 40)
|
||||
self.btn.setMaximumSize(40, 40)
|
||||
self.btn.setStyleSheet("""
|
||||
QPushButton {
|
||||
background-color: transparent;
|
||||
border-radius: 20px;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-image: url(:/icons_svg/images/icons_svg/icon_more_options.svg);
|
||||
}
|
||||
QPushButton:hover {
|
||||
background-color: rgb(61, 62, 65);
|
||||
}
|
||||
QPushButton:pressed {
|
||||
background-color: rgb(16, 17, 18);
|
||||
}
|
||||
""")
|
||||
|
||||
if send_by:
|
||||
self.layout.addWidget(self.bg)
|
||||
self.layout.addWidget(self.btn)
|
||||
else:
|
||||
self.layout.addWidget(self.btn)
|
||||
self.layout.addWidget(self.bg)
|
||||
|
||||
# LAYOUT INSIDE
|
||||
self.layout_inside = QVBoxLayout(self.bg)
|
||||
self.layout.setContentsMargins(10,10,10,10)
|
||||
|
||||
# LABEL MESSAGE
|
||||
self.message = QLabel()
|
||||
self.message.setText("message test")
|
||||
self.message.setStyleSheet("font: 500 11pt 'Segoe UI'")
|
||||
self.message.setTextInteractionFlags(Qt.TextSelectableByMouse|Qt.TextSelectableByKeyboard)
|
||||
|
||||
# LABEL MESSAGE
|
||||
self.data_message = QLabel()
|
||||
self.data_message.setText("date")
|
||||
self.data_message.setStyleSheet("font: 8pt 'Segoe UI'; color: #4c5154")
|
||||
if send_by:
|
||||
self.data_message.setAlignment(Qt.AlignRight)
|
||||
else:
|
||||
self.data_message.setAlignment(Qt.AlignLeft)
|
||||
|
||||
self.layout_inside.addWidget(self.message)
|
||||
self.layout_inside.addWidget(self.data_message)
|
||||
@@ -0,0 +1,109 @@
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
#
|
||||
# BY: WANDERSON M.PIMENTA
|
||||
# PROJECT MADE WITH: Qt Designer and PySide6
|
||||
# V: 1.0.0
|
||||
#
|
||||
# This project can be used freely for all uses, as long as they maintain the
|
||||
# respective credits only in the Python scripts, any information in the visual
|
||||
# interface (GUI) can be modified without any implication.
|
||||
#
|
||||
# There are limitations on Qt licenses if you want to use your products
|
||||
# commercially, I recommend reading them on the official website:
|
||||
# https://doc.qt.io/qtforpython/licenses.html
|
||||
#
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
|
||||
# DEFAULT PACKAGES
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
import os
|
||||
import random
|
||||
|
||||
# IMPORT / GUI, SETTINGS AND WIDGETS
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
# Packages
|
||||
from app.packages.pyside_or_pyqt import * # Qt
|
||||
from app.packages.widgets import * # Widgets
|
||||
# GUI
|
||||
from app.uis.chat.ui_page_messages import Ui_chat_page # MainWindow
|
||||
from app.uis.chat.message import Message # MainWindow
|
||||
|
||||
|
||||
# MAIN WINDOW
|
||||
# ///////////////////////////////////////////////////////////////
|
||||
class Chat(QWidget):
|
||||
def __init__(
|
||||
self,
|
||||
user_image,
|
||||
user_name,
|
||||
user_description,
|
||||
user_id,
|
||||
my_name,
|
||||
):
|
||||
QWidget.__init__(self)
|
||||
|
||||
self.page = Ui_chat_page()
|
||||
self.page.setupUi(self)
|
||||
|
||||
# UPDATE INFO
|
||||
self.page.user_image.setStyleSheet("#user_image { background-image: url(\"" + os.path.normpath(user_image).replace("\\", "/") + "\") }")
|
||||
self.page.user_name.setText(user_name)
|
||||
self.page.user_description.setText(user_description)
|
||||
|
||||
# CHANGE PLACEHOLDER TEXT
|
||||
format_user_name = user_name.replace(" ", "_").replace("-", "_")
|
||||
format_user_name = format_user_name.lower()
|
||||
self.page.line_edit_message.setPlaceholderText(f"Message #{str(format_user_name).lower()}")
|
||||
|
||||
# ENTER / RETURN PRESSED
|
||||
self.page.line_edit_message.keyReleaseEvent = self.enter_return_release
|
||||
|
||||
# ENTER / RETURN PRESSED
|
||||
self.page.btn_send_message.clicked.connect(self.send_message)
|
||||
|
||||
# MESSAGES
|
||||
self.messages = [
|
||||
f"Hi {my_name.capitalize()}, how are you?",
|
||||
f"Hello {my_name.capitalize()}, how are you today?",
|
||||
f"{my_name.capitalize()}, do you know if it is going to rain today?",
|
||||
f"{my_name.capitalize()}, how is your day?",
|
||||
f"{my_name.capitalize()}, do you remember that you owe me $100? Humm..."
|
||||
]
|
||||
|
||||
# SEND USER MESSAGE
|
||||
self.send_by_friend()
|
||||
|
||||
# ENTER / RETURN SEND MESSAGE
|
||||
def enter_return_release(self, event):
|
||||
if event.key() == Qt.Key_Return or event.key() == Qt.Key_Enter:
|
||||
self.send_message()
|
||||
|
||||
# SEND MESSAGE
|
||||
def send_message(self):
|
||||
if self.page.line_edit_message.text() != "":
|
||||
self.message = Message(self.page.line_edit_message.text(), True)
|
||||
self.page.chat_messages_layout.addWidget(self.message, Qt.AlignCenter, Qt.AlignBottom)
|
||||
self.page.line_edit_message.setText("")
|
||||
|
||||
# SCROLL TO END
|
||||
QTimer.singleShot(10, lambda: self.page.messages_frame.setFixedHeight(self.page.chat_messages_layout.sizeHint().height()))
|
||||
QTimer.singleShot(15, lambda: self.scroll_to_end())
|
||||
|
||||
# SEND USER MESSAGE
|
||||
QTimer.singleShot(1000, lambda: self.send_by_friend())
|
||||
|
||||
# SEND MESSAGE BY FRIEND
|
||||
def send_by_friend(self):
|
||||
self.message = Message(random.choice(self.messages), False)
|
||||
self.page.chat_messages_layout.addWidget(self.message, Qt.AlignCenter, Qt.AlignBottom)
|
||||
self.page.line_edit_message.setText("")
|
||||
|
||||
# SCROLL TO END
|
||||
QTimer.singleShot(10, lambda: self.page.messages_frame.setFixedHeight(self.page.chat_messages_layout.sizeHint().height()))
|
||||
QTimer.singleShot(15, lambda: self.scroll_to_end())
|
||||
|
||||
|
||||
def scroll_to_end(self):
|
||||
# SCROLL TO END
|
||||
self.scroll_bar = self.page.chat_messages.verticalScrollBar()
|
||||
self.scroll_bar.setValue(self.scroll_bar.maximum())
|
||||
@@ -0,0 +1,290 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file 'page_messagesEjpDxJ.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.0.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import *
|
||||
from PySide6.QtGui import *
|
||||
from PySide6.QtWidgets import *
|
||||
|
||||
class Ui_chat_page(object):
|
||||
def setupUi(self, chat_page):
|
||||
if not chat_page.objectName():
|
||||
chat_page.setObjectName(u"chat_page")
|
||||
chat_page.resize(880, 616)
|
||||
chat_page.setStyleSheet(u"QWidget { color: rgb(165, 165, 165); }\n"
|
||||
"#chat_page{\n"
|
||||
" background-color: rgb(0, 0, 0); \n"
|
||||
"}\n"
|
||||
"/* TOP */\n"
|
||||
"#top {\n"
|
||||
" background-color: rgb(30, 32, 33);\n"
|
||||
" border-radius: 10px;\n"
|
||||
"}\n"
|
||||
"#user_name { \n"
|
||||
" color: rgb(179, 179, 179);\n"
|
||||
" font: 600 12pt \"Segoe UI\";\n"
|
||||
"}\n"
|
||||
"#user_image {\n"
|
||||
" border: 1px solid rgb(30, 32, 33);\n"
|
||||
" background-color: rgb(47, 48, 50);\n"
|
||||
" border-radius: 20px;\n"
|
||||
"}\n"
|
||||
"#top QPushButton {\n"
|
||||
" background-color: rgb(47, 48, 50);\n"
|
||||
" border-radius: 20px;\n"
|
||||
" background-repeat: no-repeat;\n"
|
||||
" background-position: center;\n"
|
||||
"}\n"
|
||||
"#top QPushButton:hover {\n"
|
||||
" background-color: rgb(61, 62, 65);\n"
|
||||
"}\n"
|
||||
"#top QPushButton:pressed {\n"
|
||||
" background-color: rgb(16, 17, 18);\n"
|
||||
"}\n"
|
||||
"#btn_attachment_top { \n"
|
||||
" background-image: url(:/icons_svg/images/icons_svg/icon_attachment.svg);\n"
|
||||
"}\n"
|
||||
"#btn_more_top { \n"
|
||||
" background-image: url(:/icons_svg/images/icons_svg/icon_more_options.svg);\n"
|
||||
"}\n"
|
||||
"/* BOTTOM */\n"
|
||||
"#bottom QPushButton {\n"
|
||||
" background-color: rgb(47, 4"
|
||||
"8, 50);\n"
|
||||
" border-radius: 20px;\n"
|
||||
" background-repeat: no-repeat;\n"
|
||||
" background-position: center;\n"
|
||||
"}\n"
|
||||
"#bottom QPushButton:hover {\n"
|
||||
" background-color: rgb(61, 62, 65);\n"
|
||||
"}\n"
|
||||
"#bottom QPushButton:pressed {\n"
|
||||
" background-color: rgb(16, 17, 18);\n"
|
||||
"}\n"
|
||||
"#send_message_frame { \n"
|
||||
" background-color: rgb(47, 48, 50);\n"
|
||||
" border-radius: 20px;\n"
|
||||
"}\n"
|
||||
"#send_message_frame QPushButton {\n"
|
||||
" background-color: rgb(76, 77, 80);\n"
|
||||
" border-radius: 15px;\n"
|
||||
" background-repeat: no-repeat;\n"
|
||||
" background-position: center;\n"
|
||||
"}\n"
|
||||
"#send_message_frame QPushButton:hover {\n"
|
||||
" background-color: rgb(81, 82, 86);\n"
|
||||
"}\n"
|
||||
"#send_message_frame QPushButton:pressed {\n"
|
||||
" background-color: rgb(16, 17, 18);\n"
|
||||
"}\n"
|
||||
"#line_edit_message {\n"
|
||||
" background-color: transparent;\n"
|
||||
" selection-color: rgb(255, 255, 255);\n"
|
||||
" selection-background-color: rgb(149, 199, 0);\n"
|
||||
" border: none;\n"
|
||||
" padding-left: 15px;\n"
|
||||
" padding-right: 15px;\n"
|
||||
" background-repeat: none;\n"
|
||||
" background-position: left center;\n"
|
||||
" "
|
||||
"font: 10pt \"Segoe UI\";\n"
|
||||
" color: rgb(94, 96, 100);\n"
|
||||
"}\n"
|
||||
"#line_edit_message:focus {\n"
|
||||
" color: rgb(165, 165, 165);\n"
|
||||
"}\n"
|
||||
"#btn_emoticon{\n"
|
||||
" background-image: url(:/icons_svg/images/icons_svg/icon_emoticons.svg);\n"
|
||||
"}\n"
|
||||
"#btn_send_message{ \n"
|
||||
" background-image: url(:/icons_svg/images/icons_svg/icon_send.svg);\n"
|
||||
"}\n"
|
||||
"#btn_attachment_bottom{ \n"
|
||||
" \n"
|
||||
" background-image: url(:/icons_svg/images/icons_svg/icon_more_options.svg);\n"
|
||||
"}")
|
||||
self.verticalLayout = QVBoxLayout(chat_page)
|
||||
self.verticalLayout.setObjectName(u"verticalLayout")
|
||||
self.top = QFrame(chat_page)
|
||||
self.top.setObjectName(u"top")
|
||||
self.top.setMinimumSize(QSize(0, 60))
|
||||
self.top.setMaximumSize(QSize(16777215, 60))
|
||||
self.top.setFrameShape(QFrame.NoFrame)
|
||||
self.top.setFrameShadow(QFrame.Raised)
|
||||
self.horizontalLayout = QHBoxLayout(self.top)
|
||||
self.horizontalLayout.setObjectName(u"horizontalLayout")
|
||||
self.user_image = QLabel(self.top)
|
||||
self.user_image.setObjectName(u"user_image")
|
||||
self.user_image.setMinimumSize(QSize(40, 40))
|
||||
self.user_image.setMaximumSize(QSize(40, 40))
|
||||
self.user_image.setAlignment(Qt.AlignCenter)
|
||||
|
||||
self.horizontalLayout.addWidget(self.user_image)
|
||||
|
||||
self.user_information_frame = QFrame(self.top)
|
||||
self.user_information_frame.setObjectName(u"user_information_frame")
|
||||
self.user_information_frame.setFrameShape(QFrame.NoFrame)
|
||||
self.user_information_frame.setFrameShadow(QFrame.Raised)
|
||||
self.verticalLayout_2 = QVBoxLayout(self.user_information_frame)
|
||||
self.verticalLayout_2.setSpacing(0)
|
||||
self.verticalLayout_2.setObjectName(u"verticalLayout_2")
|
||||
self.verticalLayout_2.setContentsMargins(5, 5, 5, 5)
|
||||
self.user_name = QLabel(self.user_information_frame)
|
||||
self.user_name.setObjectName(u"user_name")
|
||||
self.user_name.setMinimumSize(QSize(0, 22))
|
||||
self.user_name.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop)
|
||||
|
||||
self.verticalLayout_2.addWidget(self.user_name)
|
||||
|
||||
self.user_description = QLabel(self.user_information_frame)
|
||||
self.user_description.setObjectName(u"user_description")
|
||||
self.user_description.setStyleSheet(u"background: transparent;")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.user_description)
|
||||
|
||||
|
||||
self.horizontalLayout.addWidget(self.user_information_frame)
|
||||
|
||||
self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
|
||||
|
||||
self.horizontalLayout.addItem(self.horizontalSpacer)
|
||||
|
||||
self.last_time_connected = QLabel(self.top)
|
||||
self.last_time_connected.setObjectName(u"last_time_connected")
|
||||
|
||||
self.horizontalLayout.addWidget(self.last_time_connected)
|
||||
|
||||
self.btn_attachment_top = QPushButton(self.top)
|
||||
self.btn_attachment_top.setObjectName(u"btn_attachment_top")
|
||||
self.btn_attachment_top.setMinimumSize(QSize(40, 40))
|
||||
self.btn_attachment_top.setMaximumSize(QSize(40, 40))
|
||||
self.btn_attachment_top.setCursor(QCursor(Qt.PointingHandCursor))
|
||||
|
||||
self.horizontalLayout.addWidget(self.btn_attachment_top)
|
||||
|
||||
self.btn_more_top = QPushButton(self.top)
|
||||
self.btn_more_top.setObjectName(u"btn_more_top")
|
||||
self.btn_more_top.setMinimumSize(QSize(40, 40))
|
||||
self.btn_more_top.setMaximumSize(QSize(40, 40))
|
||||
self.btn_more_top.setCursor(QCursor(Qt.PointingHandCursor))
|
||||
|
||||
self.horizontalLayout.addWidget(self.btn_more_top)
|
||||
|
||||
|
||||
self.verticalLayout.addWidget(self.top)
|
||||
|
||||
self.chat_messages = QScrollArea(chat_page)
|
||||
self.chat_messages.setObjectName(u"chat_messages")
|
||||
self.chat_messages.setStyleSheet(u"background: transparent")
|
||||
self.chat_messages.setFrameShape(QFrame.NoFrame)
|
||||
self.chat_messages.setFrameShadow(QFrame.Raised)
|
||||
self.chat_messages.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||
self.chat_messages.setWidgetResizable(True)
|
||||
self.chat_messages.setAlignment(Qt.AlignBottom|Qt.AlignLeading|Qt.AlignLeft)
|
||||
self.messages_widget = QWidget()
|
||||
self.messages_widget.setObjectName(u"messages_widget")
|
||||
self.messages_widget.setGeometry(QRect(0, 0, 862, 486))
|
||||
self.messages_widget.setStyleSheet(u"background: transparent")
|
||||
self.chat_layout = QVBoxLayout(self.messages_widget)
|
||||
self.chat_layout.setSpacing(0)
|
||||
self.chat_layout.setObjectName(u"chat_layout")
|
||||
self.chat_layout.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
|
||||
|
||||
self.chat_layout.addItem(self.verticalSpacer)
|
||||
|
||||
self.messages_frame = QFrame(self.messages_widget)
|
||||
self.messages_frame.setObjectName(u"messages_frame")
|
||||
self.messages_frame.setFrameShape(QFrame.NoFrame)
|
||||
self.messages_frame.setFrameShadow(QFrame.Raised)
|
||||
self.chat_messages_layout = QVBoxLayout(self.messages_frame)
|
||||
self.chat_messages_layout.setSpacing(0)
|
||||
self.chat_messages_layout.setObjectName(u"chat_messages_layout")
|
||||
self.chat_messages_layout.setContentsMargins(0, 0, 0, 0)
|
||||
|
||||
self.chat_layout.addWidget(self.messages_frame)
|
||||
|
||||
self.chat_messages.setWidget(self.messages_widget)
|
||||
|
||||
self.verticalLayout.addWidget(self.chat_messages)
|
||||
|
||||
self.bottom = QFrame(chat_page)
|
||||
self.bottom.setObjectName(u"bottom")
|
||||
self.bottom.setMinimumSize(QSize(0, 40))
|
||||
self.bottom.setMaximumSize(QSize(16777215, 40))
|
||||
self.bottom.setFrameShape(QFrame.NoFrame)
|
||||
self.bottom.setFrameShadow(QFrame.Raised)
|
||||
self.horizontalLayout_2 = QHBoxLayout(self.bottom)
|
||||
self.horizontalLayout_2.setSpacing(10)
|
||||
self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
|
||||
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.send_message_frame = QFrame(self.bottom)
|
||||
self.send_message_frame.setObjectName(u"send_message_frame")
|
||||
self.send_message_frame.setFrameShape(QFrame.StyledPanel)
|
||||
self.send_message_frame.setFrameShadow(QFrame.Raised)
|
||||
self.horizontalLayout_3 = QHBoxLayout(self.send_message_frame)
|
||||
self.horizontalLayout_3.setSpacing(0)
|
||||
self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
|
||||
self.horizontalLayout_3.setContentsMargins(5, 0, 5, 0)
|
||||
self.btn_emoticon = QPushButton(self.send_message_frame)
|
||||
self.btn_emoticon.setObjectName(u"btn_emoticon")
|
||||
self.btn_emoticon.setMinimumSize(QSize(30, 30))
|
||||
self.btn_emoticon.setMaximumSize(QSize(30, 30))
|
||||
self.btn_emoticon.setCursor(QCursor(Qt.PointingHandCursor))
|
||||
|
||||
self.horizontalLayout_3.addWidget(self.btn_emoticon)
|
||||
|
||||
self.line_edit_message = QLineEdit(self.send_message_frame)
|
||||
self.line_edit_message.setObjectName(u"line_edit_message")
|
||||
self.line_edit_message.setMinimumSize(QSize(0, 40))
|
||||
|
||||
self.horizontalLayout_3.addWidget(self.line_edit_message)
|
||||
|
||||
self.btn_send_message = QPushButton(self.send_message_frame)
|
||||
self.btn_send_message.setObjectName(u"btn_send_message")
|
||||
self.btn_send_message.setMinimumSize(QSize(30, 30))
|
||||
self.btn_send_message.setMaximumSize(QSize(30, 30))
|
||||
self.btn_send_message.setCursor(QCursor(Qt.PointingHandCursor))
|
||||
|
||||
self.horizontalLayout_3.addWidget(self.btn_send_message)
|
||||
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.send_message_frame)
|
||||
|
||||
self.btn_attachment_bottom = QPushButton(self.bottom)
|
||||
self.btn_attachment_bottom.setObjectName(u"btn_attachment_bottom")
|
||||
self.btn_attachment_bottom.setMinimumSize(QSize(40, 40))
|
||||
self.btn_attachment_bottom.setMaximumSize(QSize(40, 40))
|
||||
self.btn_attachment_bottom.setCursor(QCursor(Qt.PointingHandCursor))
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.btn_attachment_bottom)
|
||||
|
||||
|
||||
self.verticalLayout.addWidget(self.bottom)
|
||||
|
||||
|
||||
self.retranslateUi(chat_page)
|
||||
|
||||
QMetaObject.connectSlotsByName(chat_page)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, chat_page):
|
||||
chat_page.setWindowTitle(QCoreApplication.translate("chat_page", u"Form", None))
|
||||
self.user_image.setText("")
|
||||
self.user_name.setText(QCoreApplication.translate("chat_page", u"User name", None))
|
||||
self.user_description.setText(QCoreApplication.translate("chat_page", u"User description", None))
|
||||
self.last_time_connected.setText(QCoreApplication.translate("chat_page", u"connected last time 24h ago", None))
|
||||
self.btn_attachment_top.setText("")
|
||||
self.btn_more_top.setText("")
|
||||
self.btn_emoticon.setText("")
|
||||
self.line_edit_message.setPlaceholderText(QCoreApplication.translate("chat_page", u"Message #user", None))
|
||||
self.btn_send_message.setText("")
|
||||
self.btn_attachment_bottom.setText("")
|
||||
# retranslateUi
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file 'loginexbKtc.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.0.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import *
|
||||
from PySide6.QtGui import *
|
||||
from PySide6.QtWidgets import *
|
||||
|
||||
class Ui_Login(object):
|
||||
def setupUi(self, Login):
|
||||
if not Login.objectName():
|
||||
Login.setObjectName(u"Login")
|
||||
Login.resize(300, 420)
|
||||
Login.setMinimumSize(QSize(300, 420))
|
||||
Login.setMaximumSize(QSize(300, 420))
|
||||
Login.setStyleSheet(u"#bg {\n"
|
||||
" background-color: rgb(0, 0, 0);\n"
|
||||
" border-radius: 10px;\n"
|
||||
"}\n"
|
||||
"QLabel {\n"
|
||||
" color: rgb(121, 121, 121);\n"
|
||||
" padding-left: 10px;\n"
|
||||
" padding-top: 20px;\n"
|
||||
"}\n"
|
||||
".QLineEdit {\n"
|
||||
" border: 3px solid rgb(47, 48, 50);\n"
|
||||
" border-radius: 15px;\n"
|
||||
" background-color: rgb(47, 48, 50);\n"
|
||||
" color: rgb(121, 121, 121);\n"
|
||||
" padding-left: 10px;\n"
|
||||
" padding-right: 10px;\n"
|
||||
" background-repeat: none;\n"
|
||||
" background-position: left center;\n"
|
||||
"}\n"
|
||||
".QLineEdit:hover {\n"
|
||||
" color: rgb(230, 230, 230);\n"
|
||||
" border: 3px solid rgb(62, 63, 66);\n"
|
||||
"}\n"
|
||||
".QLineEdit:focus {\n"
|
||||
" color: rgb(230, 230, 230);\n"
|
||||
" border: 3px solid rgb(189, 255, 0);\n"
|
||||
" background-color: rgb(14, 14, 15);\n"
|
||||
"}")
|
||||
self.centralwidget = QWidget(Login)
|
||||
self.centralwidget.setObjectName(u"centralwidget")
|
||||
self.verticalLayout = QVBoxLayout(self.centralwidget)
|
||||
self.verticalLayout.setSpacing(0)
|
||||
self.verticalLayout.setObjectName(u"verticalLayout")
|
||||
self.verticalLayout.setContentsMargins(10, 10, 10, 10)
|
||||
self.bg = QFrame(self.centralwidget)
|
||||
self.bg.setObjectName(u"bg")
|
||||
self.bg.setFrameShape(QFrame.NoFrame)
|
||||
self.bg.setFrameShadow(QFrame.Raised)
|
||||
self.frame_widgets = QFrame(self.bg)
|
||||
self.frame_widgets.setObjectName(u"frame_widgets")
|
||||
self.frame_widgets.setGeometry(QRect(0, 70, 280, 720))
|
||||
self.frame_widgets.setMinimumSize(QSize(280, 720))
|
||||
self.frame_widgets.setFrameShape(QFrame.NoFrame)
|
||||
self.frame_widgets.setFrameShadow(QFrame.Raised)
|
||||
self.verticalLayout_2 = QVBoxLayout(self.frame_widgets)
|
||||
self.verticalLayout_2.setSpacing(5)
|
||||
self.verticalLayout_2.setObjectName(u"verticalLayout_2")
|
||||
self.verticalLayout_2.setContentsMargins(20, 10, 20, 10)
|
||||
self.preloader = QFrame(self.frame_widgets)
|
||||
self.preloader.setObjectName(u"preloader")
|
||||
self.preloader.setMinimumSize(QSize(240, 240))
|
||||
self.preloader.setMaximumSize(QSize(260, 260))
|
||||
self.preloader.setFrameShape(QFrame.NoFrame)
|
||||
self.preloader.setFrameShadow(QFrame.Raised)
|
||||
|
||||
self.verticalLayout_2.addWidget(self.preloader)
|
||||
|
||||
self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
|
||||
|
||||
self.verticalLayout_2.addItem(self.verticalSpacer)
|
||||
|
||||
self.logo = QFrame(self.frame_widgets)
|
||||
self.logo.setObjectName(u"logo")
|
||||
self.logo.setMinimumSize(QSize(0, 260))
|
||||
self.logo.setStyleSheet(u"#logo {\n"
|
||||
" border-radius: 10px;\n"
|
||||
" background-image: url(:/images_svg/images/images_svg/logo_home.svg);\n"
|
||||
" background-position: center;\n"
|
||||
" background-repeat: no-repeat;\n"
|
||||
"}")
|
||||
self.logo.setFrameShape(QFrame.NoFrame)
|
||||
self.logo.setFrameShadow(QFrame.Raised)
|
||||
|
||||
self.verticalLayout_2.addWidget(self.logo)
|
||||
|
||||
self.user_description = QLabel(self.frame_widgets)
|
||||
self.user_description.setObjectName(u"user_description")
|
||||
self.user_description.setStyleSheet(u"background: transparent;")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.user_description)
|
||||
|
||||
self.username = QLineEdit(self.frame_widgets)
|
||||
self.username.setObjectName(u"username")
|
||||
self.username.setMinimumSize(QSize(0, 30))
|
||||
self.username.setMaximumSize(QSize(16777215, 40))
|
||||
|
||||
self.verticalLayout_2.addWidget(self.username)
|
||||
|
||||
self.password = QLineEdit(self.frame_widgets)
|
||||
self.password.setObjectName(u"password")
|
||||
self.password.setMinimumSize(QSize(0, 30))
|
||||
self.password.setMaximumSize(QSize(16777215, 40))
|
||||
self.password.setEchoMode(QLineEdit.Password)
|
||||
|
||||
self.verticalLayout_2.addWidget(self.password)
|
||||
|
||||
|
||||
self.verticalLayout.addWidget(self.bg)
|
||||
|
||||
Login.setCentralWidget(self.centralwidget)
|
||||
|
||||
self.retranslateUi(Login)
|
||||
|
||||
QMetaObject.connectSlotsByName(Login)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Login):
|
||||
Login.setWindowTitle(QCoreApplication.translate("Login", u"Login. PyBlackBOX", None))
|
||||
self.user_description.setText(QCoreApplication.translate("Login", u"Login (pass: 123456):", None))
|
||||
self.username.setPlaceholderText(QCoreApplication.translate("Login", u"Username", None))
|
||||
self.password.setPlaceholderText(QCoreApplication.translate("Login", u"Password", None))
|
||||
# retranslateUi
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,619 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file 'mainMcMyCG.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.0.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import *
|
||||
from PySide6.QtGui import *
|
||||
from PySide6.QtWidgets import *
|
||||
|
||||
from . resources_rc import *
|
||||
|
||||
class Ui_MainWindow(object):
|
||||
def setupUi(self, MainWindow):
|
||||
if not MainWindow.objectName():
|
||||
MainWindow.setObjectName(u"MainWindow")
|
||||
MainWindow.resize(1200, 720)
|
||||
self.stylesheet = QWidget(MainWindow)
|
||||
self.stylesheet.setObjectName(u"stylesheet")
|
||||
self.stylesheet.setStyleSheet(u"/* DEFAULT */\n"
|
||||
"QWidget {\n"
|
||||
" font: 9pt \"Segoe UI\";\n"
|
||||
" color: rgb(230, 230, 230);\n"
|
||||
" selection-background-color: rgb(86, 115, 0);\n"
|
||||
"}\n"
|
||||
"/* Bg App */\n"
|
||||
"#bg_app { \n"
|
||||
" background-color: rgb(0, 0, 0);\n"
|
||||
" border: 2px solid rgb(30, 32, 33);\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"/* Left Menu */\n"
|
||||
"#left_menu {\n"
|
||||
" border-top-left-radius: 10px;\n"
|
||||
" border-bottom-left-radius: 10px;\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"/* Logo Top */\n"
|
||||
"#logo_top {\n"
|
||||
" background-image: url(:/images_svg/images/images_svg/logo_symbol_top.svg);\n"
|
||||
" background-position: center;\n"
|
||||
" background-repeat: no-repeat;\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"/* Buttons */\n"
|
||||
"#left_menu QPushButton {\n"
|
||||
" border: none; \n"
|
||||
" background-color: transparent;\n"
|
||||
" border-radius: 10px;\n"
|
||||
" background-repeat: none;\n"
|
||||
" background-position: center;\n"
|
||||
"}\n"
|
||||
"#left_menu QPushButton:hover {\n"
|
||||
" background-color: rgb(21, 22, 23);\n"
|
||||
"}\n"
|
||||
"#left_menu QPushButton:pressed {\n"
|
||||
" background-color: rgb(172, 229, 0);\n"
|
||||
"}\n"
|
||||
"#add_user_btn { \n"
|
||||
" background-image: url(:/icons_svg/images/icons_svg/ico"
|
||||
"n_add_user.svg);\n"
|
||||
"}\n"
|
||||
"#settings_btn { \n"
|
||||
" background-image: url(:/icons_svg/images/icons_svg/icon_settings.svg);\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"/* Left Messages */\n"
|
||||
"#left_messages {\n"
|
||||
" background-color: rgb(21, 22, 23);\n"
|
||||
" border: none;\n"
|
||||
" border-left: 3px solid rgb(30, 32, 33);\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"/* Top */\n"
|
||||
"#top_messages {\n"
|
||||
" border: none;\n"
|
||||
" border-bottom: 1px solid rgb(47, 48, 50);\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"/* Search Message */\n"
|
||||
"#search_sms_frame .QLineEdit {\n"
|
||||
" border: 2px solid rgb(47, 48, 50);\n"
|
||||
" border-radius: 15px;\n"
|
||||
" background-color: rgb(47, 48, 50);\n"
|
||||
" color: rgb(121, 121, 121);\n"
|
||||
" padding-left: 30px;\n"
|
||||
" padding-right: 10px;\n"
|
||||
" background-image: url(:/icons_svg/images/icons_svg/icon_search.svg);\n"
|
||||
" background-repeat: none;\n"
|
||||
" background-position: left center;\n"
|
||||
"}\n"
|
||||
"#search_sms_frame .QLineEdit:hover {\n"
|
||||
" color: rgb(230, 230, 230);\n"
|
||||
" border: 2px solid rgb(62, 63, 66);\n"
|
||||
"}\n"
|
||||
"#search_sms_frame .QLineEdit:focus {\n"
|
||||
" color: rgb(230, 230, 230);\n"
|
||||
" border: 2px solid rgb(53, 54"
|
||||
", 56);\n"
|
||||
" background-color: rgb(14, 14, 15);\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"/* Menus Scroll Area */\n"
|
||||
"#left_messages_scroll, #messages_scroll {\n"
|
||||
" background-color: transparent;\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"/* Bottom / Signal */\n"
|
||||
"#bottom_messages { \n"
|
||||
" background-color: rgb(30, 32, 33);\n"
|
||||
"}\n"
|
||||
"#signal_icon { \n"
|
||||
" background-image: url(:/icons_svg/images/icons_svg/icon_signal.svg);\n"
|
||||
" background-repeat: none;\n"
|
||||
" background-position: left center;\n"
|
||||
"}\n"
|
||||
"#label_top{ \n"
|
||||
" font: 800 10pt \"Segoe UI\";\n"
|
||||
" color: rgb(189, 255, 0);\n"
|
||||
"}\n"
|
||||
"#label_bottom { \n"
|
||||
" color: rgb(166, 166, 166);\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"/* Right Content */\n"
|
||||
"#right_content {\n"
|
||||
" border-top-right-radius: 10px;\n"
|
||||
" border-bottom-right-radius: 10px;\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"/* Top Bar */\n"
|
||||
"#top_bar {\n"
|
||||
" border-top-right-radius: 10px;\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"/* Title Bar */\n"
|
||||
"#title_bar {\n"
|
||||
" background-image: url(:/images_svg/images/images_svg/text_logo.svg);\n"
|
||||
" background-repeat: no-repeat;\n"
|
||||
" background-position: left center;\n"
|
||||
" border-left: 15px solid trans"
|
||||
"parent;\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"/* Top BTNs */\n"
|
||||
"#top_btns { }\n"
|
||||
"#top_btns .QPushButton { \n"
|
||||
" background-position: center;\n"
|
||||
" background-repeat: no-repeat;\n"
|
||||
" border: none;\n"
|
||||
" outline: none;\n"
|
||||
" border-radius: 8px;\n"
|
||||
" text-align: left;\n"
|
||||
"}\n"
|
||||
"#top_btns .QPushButton:hover { background-color: rgb(21, 22, 23); }\n"
|
||||
"#top_btns .QPushButton:pressed { background-color: rgb(172, 229, 0); }\n"
|
||||
"#top_btns #close_app_btn:hover { background-color: rgb(255, 0, 127); }\n"
|
||||
"#top_btns #close_app_btn:pressed { background-color: rgb(172, 229, 0); }\n"
|
||||
"\n"
|
||||
"/* Content / Pages */\n"
|
||||
"#app_pages {\n"
|
||||
" background-color: transparent;\n"
|
||||
"}\n"
|
||||
"/* /////////////////////////////////////////////////////////////////////////////////////////////////\n"
|
||||
"ScrollBars */\n"
|
||||
"QScrollBar:horizontal {\n"
|
||||
" border: none;\n"
|
||||
" background: rgb(52, 59, 72);\n"
|
||||
" height: 8px;\n"
|
||||
" margin: 0px 21px 0 21px;\n"
|
||||
" border-radius: 0px;\n"
|
||||
"}\n"
|
||||
"QScrollBar::handle:horizontal {\n"
|
||||
" background: rgb(47, 48, 50);\n"
|
||||
" min-widt"
|
||||
"h: 25px;\n"
|
||||
" border-radius: 4px\n"
|
||||
"}\n"
|
||||
"QScrollBar::add-line:horizontal {\n"
|
||||
" border: none;\n"
|
||||
" background: rgb(55, 63, 77);\n"
|
||||
" width: 20px;\n"
|
||||
" border-top-right-radius: 4px;\n"
|
||||
" border-bottom-right-radius: 4px;\n"
|
||||
" subcontrol-position: right;\n"
|
||||
" subcontrol-origin: margin;\n"
|
||||
"}\n"
|
||||
"QScrollBar::sub-line:horizontal {\n"
|
||||
" border: none;\n"
|
||||
" background: rgb(55, 63, 77);\n"
|
||||
" width: 20px;\n"
|
||||
" border-top-left-radius: 4px;\n"
|
||||
" border-bottom-left-radius: 4px;\n"
|
||||
" subcontrol-position: left;\n"
|
||||
" subcontrol-origin: margin;\n"
|
||||
"}\n"
|
||||
"QScrollBar::up-arrow:horizontal, QScrollBar::down-arrow:horizontal\n"
|
||||
"{\n"
|
||||
" background: none;\n"
|
||||
"}\n"
|
||||
"QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal\n"
|
||||
"{\n"
|
||||
" background: none;\n"
|
||||
"}\n"
|
||||
" QScrollBar:vertical {\n"
|
||||
" border: none;\n"
|
||||
" background: rgb(52, 59, 72);\n"
|
||||
" width: 8px;\n"
|
||||
" margin: 21px 0 21px 0;\n"
|
||||
" border-radius: 0px;\n"
|
||||
" }\n"
|
||||
" QScrollBar::handle:vertical { \n"
|
||||
" background: rgb(47, 48"
|
||||
", 50);\n"
|
||||
" min-height: 25px;\n"
|
||||
" border-radius: 4px\n"
|
||||
" }\n"
|
||||
" QScrollBar::add-line:vertical {\n"
|
||||
" border: none;\n"
|
||||
" background: transparent;\n"
|
||||
" height: 10px;\n"
|
||||
" border-radius: 4px;\n"
|
||||
" subcontrol-position: bottom;\n"
|
||||
" subcontrol-origin: margin;\n"
|
||||
" }\n"
|
||||
" QScrollBar::sub-line:vertical {\n"
|
||||
" border: none;\n"
|
||||
" background: transparent;\n"
|
||||
" height: 10px;\n"
|
||||
" border-radius: 4px;\n"
|
||||
" subcontrol-position: top;\n"
|
||||
" subcontrol-origin: margin;\n"
|
||||
" }\n"
|
||||
" QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical {\n"
|
||||
" background: none;\n"
|
||||
" }\n"
|
||||
"\n"
|
||||
" QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {\n"
|
||||
" background: none;\n"
|
||||
" }\n"
|
||||
"\n"
|
||||
"")
|
||||
self.margins_app = QVBoxLayout(self.stylesheet)
|
||||
self.margins_app.setSpacing(0)
|
||||
self.margins_app.setObjectName(u"margins_app")
|
||||
self.margins_app.setContentsMargins(10, 10, 10, 10)
|
||||
self.bg_app = QFrame(self.stylesheet)
|
||||
self.bg_app.setObjectName(u"bg_app")
|
||||
self.bg_app.setStyleSheet(u"#bg_app { border-radius: 10px; }")
|
||||
self.bg_app.setFrameShape(QFrame.NoFrame)
|
||||
self.bg_app.setFrameShadow(QFrame.Raised)
|
||||
self.bg_app.setLineWidth(0)
|
||||
self.base_Layout = QVBoxLayout(self.bg_app)
|
||||
self.base_Layout.setSpacing(0)
|
||||
self.base_Layout.setObjectName(u"base_Layout")
|
||||
self.base_Layout.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontal_Layout = QHBoxLayout()
|
||||
self.horizontal_Layout.setSpacing(0)
|
||||
self.horizontal_Layout.setObjectName(u"horizontal_Layout")
|
||||
self.left_menu = QFrame(self.bg_app)
|
||||
self.left_menu.setObjectName(u"left_menu")
|
||||
self.left_menu.setMinimumSize(QSize(50, 0))
|
||||
self.left_menu.setMaximumSize(QSize(50, 16777215))
|
||||
self.left_menu.setFrameShape(QFrame.NoFrame)
|
||||
self.left_menu.setFrameShadow(QFrame.Raised)
|
||||
self.left_menu.setLineWidth(0)
|
||||
self.vertical_left_menu_layout = QVBoxLayout(self.left_menu)
|
||||
self.vertical_left_menu_layout.setSpacing(0)
|
||||
self.vertical_left_menu_layout.setObjectName(u"vertical_left_menu_layout")
|
||||
self.vertical_left_menu_layout.setContentsMargins(0, 0, 0, 0)
|
||||
self.logo_top = QLabel(self.left_menu)
|
||||
self.logo_top.setObjectName(u"logo_top")
|
||||
self.logo_top.setMinimumSize(QSize(50, 50))
|
||||
self.logo_top.setMaximumSize(QSize(50, 50))
|
||||
|
||||
self.vertical_left_menu_layout.addWidget(self.logo_top)
|
||||
|
||||
self.top_menus = QFrame(self.left_menu)
|
||||
self.top_menus.setObjectName(u"top_menus")
|
||||
self.top_menus.setMinimumSize(QSize(0, 50))
|
||||
self.top_menus.setFrameShape(QFrame.NoFrame)
|
||||
self.top_menus.setFrameShadow(QFrame.Raised)
|
||||
self.top_menus_layout = QVBoxLayout(self.top_menus)
|
||||
self.top_menus_layout.setSpacing(5)
|
||||
self.top_menus_layout.setObjectName(u"top_menus_layout")
|
||||
self.top_menus_layout.setContentsMargins(5, 5, 5, 5)
|
||||
|
||||
self.vertical_left_menu_layout.addWidget(self.top_menus)
|
||||
|
||||
self.spacer_vertical_menu = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
|
||||
|
||||
self.vertical_left_menu_layout.addItem(self.spacer_vertical_menu)
|
||||
|
||||
self.bottom_menus = QFrame(self.left_menu)
|
||||
self.bottom_menus.setObjectName(u"bottom_menus")
|
||||
self.bottom_menus.setMinimumSize(QSize(0, 50))
|
||||
self.bottom_menus.setFrameShape(QFrame.NoFrame)
|
||||
self.bottom_menus.setFrameShadow(QFrame.Raised)
|
||||
self.bottom_menus_layout = QVBoxLayout(self.bottom_menus)
|
||||
self.bottom_menus_layout.setSpacing(5)
|
||||
self.bottom_menus_layout.setObjectName(u"bottom_menus_layout")
|
||||
self.bottom_menus_layout.setSizeConstraint(QLayout.SetMinAndMaxSize)
|
||||
self.bottom_menus_layout.setContentsMargins(5, 5, 5, 5)
|
||||
|
||||
self.vertical_left_menu_layout.addWidget(self.bottom_menus)
|
||||
|
||||
|
||||
self.horizontal_Layout.addWidget(self.left_menu)
|
||||
|
||||
self.left_messages = QFrame(self.bg_app)
|
||||
self.left_messages.setObjectName(u"left_messages")
|
||||
self.left_messages.setMinimumSize(QSize(243, 0))
|
||||
self.left_messages.setMaximumSize(QSize(243, 16777215))
|
||||
self.left_messages.setFrameShape(QFrame.NoFrame)
|
||||
self.left_messages.setFrameShadow(QFrame.Raised)
|
||||
self.left_messages.setLineWidth(0)
|
||||
self.left_box_layout = QVBoxLayout(self.left_messages)
|
||||
self.left_box_layout.setSpacing(0)
|
||||
self.left_box_layout.setObjectName(u"left_box_layout")
|
||||
self.left_box_layout.setContentsMargins(0, 0, 0, 0)
|
||||
self.top_messages = QFrame(self.left_messages)
|
||||
self.top_messages.setObjectName(u"top_messages")
|
||||
self.top_messages.setMinimumSize(QSize(0, 105))
|
||||
self.top_messages.setMaximumSize(QSize(16777215, 105))
|
||||
self.top_messages.setFrameShape(QFrame.NoFrame)
|
||||
self.top_messages.setFrameShadow(QFrame.Raised)
|
||||
self.top_messages_layout = QVBoxLayout(self.top_messages)
|
||||
self.top_messages_layout.setSpacing(0)
|
||||
self.top_messages_layout.setObjectName(u"top_messages_layout")
|
||||
self.top_messages_layout.setContentsMargins(0, 0, 0, 0)
|
||||
self.top_user_frame = QFrame(self.top_messages)
|
||||
self.top_user_frame.setObjectName(u"top_user_frame")
|
||||
self.top_user_frame.setMinimumSize(QSize(0, 60))
|
||||
self.top_user_frame.setMaximumSize(QSize(16777215, 60))
|
||||
self.top_user_frame.setFrameShape(QFrame.NoFrame)
|
||||
self.top_user_frame.setFrameShadow(QFrame.Raised)
|
||||
|
||||
self.top_messages_layout.addWidget(self.top_user_frame)
|
||||
|
||||
self.search_sms_frame = QFrame(self.top_messages)
|
||||
self.search_sms_frame.setObjectName(u"search_sms_frame")
|
||||
self.search_sms_frame.setMinimumSize(QSize(0, 40))
|
||||
self.search_sms_frame.setMaximumSize(QSize(16777215, 40))
|
||||
self.search_sms_frame.setFrameShape(QFrame.NoFrame)
|
||||
self.search_sms_frame.setFrameShadow(QFrame.Raised)
|
||||
self.verticalLayout_6 = QVBoxLayout(self.search_sms_frame)
|
||||
self.verticalLayout_6.setSpacing(0)
|
||||
self.verticalLayout_6.setObjectName(u"verticalLayout_6")
|
||||
self.verticalLayout_6.setContentsMargins(10, 0, 10, 0)
|
||||
self.search_line_edit = QLineEdit(self.search_sms_frame)
|
||||
self.search_line_edit.setObjectName(u"search_line_edit")
|
||||
self.search_line_edit.setMinimumSize(QSize(0, 30))
|
||||
self.search_line_edit.setMaximumSize(QSize(16777215, 40))
|
||||
|
||||
self.verticalLayout_6.addWidget(self.search_line_edit, 0, Qt.AlignVCenter)
|
||||
|
||||
|
||||
self.top_messages_layout.addWidget(self.search_sms_frame)
|
||||
|
||||
|
||||
self.left_box_layout.addWidget(self.top_messages)
|
||||
|
||||
self.left_messages_scroll = QScrollArea(self.left_messages)
|
||||
self.left_messages_scroll.setObjectName(u"left_messages_scroll")
|
||||
self.left_messages_scroll.setFrameShape(QFrame.NoFrame)
|
||||
self.left_messages_scroll.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||
self.left_messages_scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||
self.left_messages_scroll.setWidgetResizable(True)
|
||||
self.messages_scroll = QWidget()
|
||||
self.messages_scroll.setObjectName(u"messages_scroll")
|
||||
self.messages_scroll.setGeometry(QRect(0, 0, 240, 524))
|
||||
self.messages_layout_base = QVBoxLayout(self.messages_scroll)
|
||||
self.messages_layout_base.setSpacing(0)
|
||||
self.messages_layout_base.setObjectName(u"messages_layout_base")
|
||||
self.messages_layout_base.setContentsMargins(0, 5, 0, 5)
|
||||
self.messages_frame = QFrame(self.messages_scroll)
|
||||
self.messages_frame.setObjectName(u"messages_frame")
|
||||
self.messages_frame.setFrameShape(QFrame.NoFrame)
|
||||
self.messages_frame.setFrameShadow(QFrame.Raised)
|
||||
self.messages_layout = QVBoxLayout(self.messages_frame)
|
||||
self.messages_layout.setSpacing(5)
|
||||
self.messages_layout.setObjectName(u"messages_layout")
|
||||
self.messages_layout.setContentsMargins(0, 0, 0, 0)
|
||||
|
||||
self.messages_layout_base.addWidget(self.messages_frame, 0, Qt.AlignTop)
|
||||
|
||||
self.left_messages_scroll.setWidget(self.messages_scroll)
|
||||
|
||||
self.left_box_layout.addWidget(self.left_messages_scroll)
|
||||
|
||||
self.bottom_messages = QFrame(self.left_messages)
|
||||
self.bottom_messages.setObjectName(u"bottom_messages")
|
||||
self.bottom_messages.setMinimumSize(QSize(0, 65))
|
||||
self.bottom_messages.setMaximumSize(QSize(16777215, 65))
|
||||
self.bottom_messages.setFrameShape(QFrame.NoFrame)
|
||||
self.bottom_messages.setFrameShadow(QFrame.Raised)
|
||||
self.verticalLayout_5 = QVBoxLayout(self.bottom_messages)
|
||||
self.verticalLayout_5.setSpacing(0)
|
||||
self.verticalLayout_5.setObjectName(u"verticalLayout_5")
|
||||
self.verticalLayout_5.setContentsMargins(15, 0, 10, 0)
|
||||
self.signal_frame = QFrame(self.bottom_messages)
|
||||
self.signal_frame.setObjectName(u"signal_frame")
|
||||
self.signal_frame.setMinimumSize(QSize(0, 35))
|
||||
self.signal_frame.setMaximumSize(QSize(16777215, 35))
|
||||
self.signal_frame.setFrameShape(QFrame.NoFrame)
|
||||
self.signal_frame.setFrameShadow(QFrame.Raised)
|
||||
self.horizontalLayout_2 = QHBoxLayout(self.signal_frame)
|
||||
self.horizontalLayout_2.setSpacing(10)
|
||||
self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
|
||||
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.signal_icon = QFrame(self.signal_frame)
|
||||
self.signal_icon.setObjectName(u"signal_icon")
|
||||
self.signal_icon.setMaximumSize(QSize(30, 16777215))
|
||||
self.signal_icon.setFrameShape(QFrame.NoFrame)
|
||||
self.signal_icon.setFrameShadow(QFrame.Raised)
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.signal_icon)
|
||||
|
||||
self.signal_text = QFrame(self.signal_frame)
|
||||
self.signal_text.setObjectName(u"signal_text")
|
||||
self.signal_text.setFrameShape(QFrame.NoFrame)
|
||||
self.signal_text.setFrameShadow(QFrame.Raised)
|
||||
self.verticalLayout_7 = QVBoxLayout(self.signal_text)
|
||||
self.verticalLayout_7.setSpacing(0)
|
||||
self.verticalLayout_7.setObjectName(u"verticalLayout_7")
|
||||
self.verticalLayout_7.setContentsMargins(0, 2, 0, 2)
|
||||
self.label_top = QLabel(self.signal_text)
|
||||
self.label_top.setObjectName(u"label_top")
|
||||
|
||||
self.verticalLayout_7.addWidget(self.label_top)
|
||||
|
||||
self.label_bottom = QLabel(self.signal_text)
|
||||
self.label_bottom.setObjectName(u"label_bottom")
|
||||
|
||||
self.verticalLayout_7.addWidget(self.label_bottom)
|
||||
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.signal_text)
|
||||
|
||||
|
||||
self.verticalLayout_5.addWidget(self.signal_frame, 0, Qt.AlignVCenter)
|
||||
|
||||
|
||||
self.left_box_layout.addWidget(self.bottom_messages)
|
||||
|
||||
|
||||
self.horizontal_Layout.addWidget(self.left_messages)
|
||||
|
||||
self.right_content = QFrame(self.bg_app)
|
||||
self.right_content.setObjectName(u"right_content")
|
||||
font = QFont()
|
||||
font.setFamily(u"Segoe UI")
|
||||
font.setPointSize(9)
|
||||
font.setBold(False)
|
||||
font.setItalic(False)
|
||||
font.setStyleStrategy(QFont.PreferAntialias)
|
||||
self.right_content.setFont(font)
|
||||
self.right_content.setFrameShape(QFrame.NoFrame)
|
||||
self.right_content.setFrameShadow(QFrame.Raised)
|
||||
self.right_content.setLineWidth(0)
|
||||
self.verticalLayout = QVBoxLayout(self.right_content)
|
||||
self.verticalLayout.setSpacing(0)
|
||||
self.verticalLayout.setObjectName(u"verticalLayout")
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.top_bar = QFrame(self.right_content)
|
||||
self.top_bar.setObjectName(u"top_bar")
|
||||
self.top_bar.setMinimumSize(QSize(0, 45))
|
||||
self.top_bar.setMaximumSize(QSize(16777215, 45))
|
||||
self.top_bar.setFrameShape(QFrame.NoFrame)
|
||||
self.top_bar.setFrameShadow(QFrame.Raised)
|
||||
self.top_bar.setLineWidth(0)
|
||||
self.horizontalLayout = QHBoxLayout(self.top_bar)
|
||||
self.horizontalLayout.setSpacing(0)
|
||||
self.horizontalLayout.setObjectName(u"horizontalLayout")
|
||||
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.title_bar = QLabel(self.top_bar)
|
||||
self.title_bar.setObjectName(u"title_bar")
|
||||
self.title_bar.setLineWidth(0)
|
||||
|
||||
self.horizontalLayout.addWidget(self.title_bar)
|
||||
|
||||
self.top_btns = QFrame(self.top_bar)
|
||||
self.top_btns.setObjectName(u"top_btns")
|
||||
self.top_btns.setMaximumSize(QSize(100, 16777215))
|
||||
self.top_btns.setFrameShape(QFrame.NoFrame)
|
||||
self.top_btns.setFrameShadow(QFrame.Raised)
|
||||
self.top_btns.setLineWidth(0)
|
||||
self.top_btn_layout = QHBoxLayout(self.top_btns)
|
||||
self.top_btn_layout.setSpacing(4)
|
||||
self.top_btn_layout.setObjectName(u"top_btn_layout")
|
||||
self.top_btn_layout.setContentsMargins(0, 0, 0, 0)
|
||||
self.minimize_app_btn = QPushButton(self.top_btns)
|
||||
self.minimize_app_btn.setObjectName(u"minimize_app_btn")
|
||||
self.minimize_app_btn.setMinimumSize(QSize(28, 28))
|
||||
self.minimize_app_btn.setMaximumSize(QSize(28, 28))
|
||||
font1 = QFont()
|
||||
font1.setFamily(u"Segoe UI")
|
||||
font1.setPointSize(9)
|
||||
font1.setBold(False)
|
||||
font1.setItalic(False)
|
||||
font1.setStyleStrategy(QFont.NoAntialias)
|
||||
self.minimize_app_btn.setFont(font1)
|
||||
self.minimize_app_btn.setCursor(QCursor(Qt.PointingHandCursor))
|
||||
self.minimize_app_btn.setStyleSheet(u"background-image: url(:/icons_svg/images/icons_svg/icon_minimize.svg);")
|
||||
self.minimize_app_btn.setIconSize(QSize(20, 20))
|
||||
|
||||
self.top_btn_layout.addWidget(self.minimize_app_btn)
|
||||
|
||||
self.maximize_restore_app_btn = QPushButton(self.top_btns)
|
||||
self.maximize_restore_app_btn.setObjectName(u"maximize_restore_app_btn")
|
||||
self.maximize_restore_app_btn.setMinimumSize(QSize(28, 28))
|
||||
self.maximize_restore_app_btn.setMaximumSize(QSize(28, 28))
|
||||
font2 = QFont()
|
||||
font2.setFamily(u"Segoe UI")
|
||||
font2.setPointSize(9)
|
||||
font2.setBold(False)
|
||||
font2.setItalic(False)
|
||||
font2.setStyleStrategy(QFont.PreferDefault)
|
||||
self.maximize_restore_app_btn.setFont(font2)
|
||||
self.maximize_restore_app_btn.setCursor(QCursor(Qt.PointingHandCursor))
|
||||
self.maximize_restore_app_btn.setStyleSheet(u"background-image: url(:/icons_svg/images/icons_svg/icon_maximize.svg);")
|
||||
self.maximize_restore_app_btn.setIconSize(QSize(20, 20))
|
||||
|
||||
self.top_btn_layout.addWidget(self.maximize_restore_app_btn)
|
||||
|
||||
self.close_app_btn = QPushButton(self.top_btns)
|
||||
self.close_app_btn.setObjectName(u"close_app_btn")
|
||||
self.close_app_btn.setMinimumSize(QSize(28, 28))
|
||||
self.close_app_btn.setMaximumSize(QSize(28, 28))
|
||||
self.close_app_btn.setCursor(QCursor(Qt.PointingHandCursor))
|
||||
self.close_app_btn.setStyleSheet(u"background-image: url(:/icons_svg/images/icons_svg/icon_close.svg);")
|
||||
self.close_app_btn.setIconSize(QSize(20, 20))
|
||||
|
||||
self.top_btn_layout.addWidget(self.close_app_btn)
|
||||
|
||||
self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
|
||||
|
||||
self.top_btn_layout.addItem(self.horizontalSpacer)
|
||||
|
||||
|
||||
self.horizontalLayout.addWidget(self.top_btns)
|
||||
|
||||
|
||||
self.verticalLayout.addWidget(self.top_bar)
|
||||
|
||||
self.content = QFrame(self.right_content)
|
||||
self.content.setObjectName(u"content")
|
||||
self.content.setFrameShape(QFrame.NoFrame)
|
||||
self.content.setFrameShadow(QFrame.Raised)
|
||||
self.content.setLineWidth(0)
|
||||
self.verticalLayout_4 = QVBoxLayout(self.content)
|
||||
self.verticalLayout_4.setObjectName(u"verticalLayout_4")
|
||||
self.app_pages = QStackedWidget(self.content)
|
||||
self.app_pages.setObjectName(u"app_pages")
|
||||
self.app_pages.setStyleSheet(u"background-color: transparent;")
|
||||
self.home = QWidget()
|
||||
self.home.setObjectName(u"home")
|
||||
self.home.setStyleSheet(u"#home {\n"
|
||||
" background-position: center;\n"
|
||||
" background-repeat: no-repeat;\n"
|
||||
" background-image: url(:/images_svg/images/images_svg/logo_home.svg);\n"
|
||||
"}")
|
||||
self.app_pages.addWidget(self.home)
|
||||
self.chat = QWidget()
|
||||
self.chat.setObjectName(u"chat")
|
||||
self.chat_layout = QVBoxLayout(self.chat)
|
||||
self.chat_layout.setSpacing(0)
|
||||
self.chat_layout.setObjectName(u"chat_layout")
|
||||
self.chat_layout.setContentsMargins(0, 0, 0, 0)
|
||||
self.app_pages.addWidget(self.chat)
|
||||
|
||||
self.verticalLayout_4.addWidget(self.app_pages)
|
||||
|
||||
|
||||
self.verticalLayout.addWidget(self.content)
|
||||
|
||||
|
||||
self.horizontal_Layout.addWidget(self.right_content)
|
||||
|
||||
|
||||
self.base_Layout.addLayout(self.horizontal_Layout)
|
||||
|
||||
|
||||
self.margins_app.addWidget(self.bg_app)
|
||||
|
||||
MainWindow.setCentralWidget(self.stylesheet)
|
||||
|
||||
self.retranslateUi(MainWindow)
|
||||
|
||||
self.app_pages.setCurrentIndex(1)
|
||||
|
||||
|
||||
QMetaObject.connectSlotsByName(MainWindow)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, MainWindow):
|
||||
MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None))
|
||||
self.search_line_edit.setPlaceholderText(QCoreApplication.translate("MainWindow", u"Search messages", None))
|
||||
self.label_top.setText(QCoreApplication.translate("MainWindow", u"Signal 80%", None))
|
||||
self.label_bottom.setText(QCoreApplication.translate("MainWindow", u"PyBlackBOX server signal", None))
|
||||
self.title_bar.setText("")
|
||||
#if QT_CONFIG(tooltip)
|
||||
self.minimize_app_btn.setToolTip(QCoreApplication.translate("MainWindow", u"Minimize", None))
|
||||
#endif // QT_CONFIG(tooltip)
|
||||
self.minimize_app_btn.setText("")
|
||||
#if QT_CONFIG(tooltip)
|
||||
self.maximize_restore_app_btn.setToolTip(QCoreApplication.translate("MainWindow", u"Maximize", None))
|
||||
#endif // QT_CONFIG(tooltip)
|
||||
self.maximize_restore_app_btn.setText("")
|
||||
#if QT_CONFIG(tooltip)
|
||||
self.close_app_btn.setToolTip(QCoreApplication.translate("MainWindow", u"Close", None))
|
||||
#endif // QT_CONFIG(tooltip)
|
||||
self.close_app_btn.setText("")
|
||||
# retranslateUi
|
||||
|
||||
Reference in New Issue
Block a user