This commit is contained in:
VFX - Visual Effects
2021-04-10 17:50:37 -03:00
parent 3a9c6cc42c
commit 2459df76e4
3 changed files with 58 additions and 22 deletions

View File

@@ -109,19 +109,12 @@ class UIFunctions(MainWindow):
if widthRightBox != 0:
style = self.ui.settingsTopBtn.styleSheet()
self.ui.settingsTopBtn.setStyleSheet(style.replace(Settings.BTN_RIGHT_BOX_COLOR, ''))
self.ui.extraRightBox.setMinimumWidth(0)
else:
widthExtended = standard
# RESET BTN
self.ui.toggleLeftBox.setStyleSheet(style.replace(color, ''))
# ANIMATION
self.animation = QPropertyAnimation(self.ui.extraLeftBox, b"minimumWidth")
self.animation.setDuration(Settings.TIME_ANIMATION)
self.animation.setStartValue(width)
self.animation.setEndValue(widthExtended)
self.animation.setEasingCurve(QEasingCurve.InOutQuart)
self.animation.start()
UIFunctions.start_box_animation(self, width, widthRightBox, "left")
# TOGGLE RIGHT BOX
# ///////////////////////////////////////////////////////////////
@@ -145,19 +138,47 @@ class UIFunctions(MainWindow):
if widthLeftBox != 0:
style = self.ui.toggleLeftBox.styleSheet()
self.ui.toggleLeftBox.setStyleSheet(style.replace(Settings.BTN_LEFT_BOX_COLOR, ''))
self.ui.extraLeftBox.setMinimumWidth(0)
else:
widthExtended = standard
# RESET BTN
self.ui.settingsTopBtn.setStyleSheet(style.replace(color, ''))
# ANIMATION
self.animation = QPropertyAnimation(self.ui.extraRightBox, b"minimumWidth")
self.animation.setDuration(Settings.TIME_ANIMATION)
self.animation.setStartValue(width)
self.animation.setEndValue(widthExtended)
self.animation.setEasingCurve(QEasingCurve.InOutQuart)
self.animation.start()
UIFunctions.start_box_animation(self, widthLeftBox, width, "right")
def start_box_animation(self, left_box_width, right_box_width, direction):
right_width = 0
left_width = 0
# Check values
if left_box_width == 0 and direction == "left":
left_width = 240
else:
left_width = 0
# Check values
if right_box_width == 0 and direction == "right":
right_width = 240
else:
right_width = 0
# ANIMATION LEFT BOX
self.left_box = QPropertyAnimation(self.ui.extraLeftBox, b"minimumWidth")
self.left_box.setDuration(Settings.TIME_ANIMATION)
self.left_box.setStartValue(left_box_width)
self.left_box.setEndValue(left_width)
self.left_box.setEasingCurve(QEasingCurve.InOutQuart)
# ANIMATION RIGHT BOX
self.right_box = QPropertyAnimation(self.ui.extraRightBox, b"minimumWidth")
self.right_box.setDuration(Settings.TIME_ANIMATION)
self.right_box.setStartValue(right_box_width)
self.right_box.setEndValue(right_width)
self.right_box.setEasingCurve(QEasingCurve.InOutQuart)
# GROUP ANIMATION
self.group = QParallelAnimationGroup()
self.group.addAnimation(self.left_box)
self.group.addAnimation(self.right_box)
self.group.start()
# SELECT/DESELECT MENU
# ///////////////////////////////////////////////////////////////

View File

@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'mainTxlWnG.ui'
## Form generated from reading UI file 'maingnxZcz.ui'
##
## Created by: Qt User Interface Compiler version 6.0.2
##
@@ -770,14 +770,16 @@ class Ui_MainWindow(object):
self.extraTopLayout.setContentsMargins(10, -1, 10, -1)
self.extraIcon = QFrame(self.extraTopBg)
self.extraIcon.setObjectName(u"extraIcon")
self.extraIcon.setMinimumSize(QSize(20, 0))
self.extraIcon.setMaximumSize(QSize(20, 20))
self.extraIcon.setFrameShape(QFrame.StyledPanel)
self.extraIcon.setFrameShape(QFrame.NoFrame)
self.extraIcon.setFrameShadow(QFrame.Raised)
self.extraTopLayout.addWidget(self.extraIcon, 0, 0, 1, 1)
self.extraLabel = QLabel(self.extraTopBg)
self.extraLabel.setObjectName(u"extraLabel")
self.extraLabel.setMinimumSize(QSize(150, 0))
self.extraTopLayout.addWidget(self.extraLabel, 0, 1, 1, 1)
@@ -1655,5 +1657,6 @@ class Ui_MainWindow(object):
self.btn_print.setText(QCoreApplication.translate("MainWindow", u"Print", None))
self.btn_logout.setText(QCoreApplication.translate("MainWindow", u"Logout", None))
self.creditsLabel.setText(QCoreApplication.translate("MainWindow", u"By: Wanderson M. Pimenta", None))
self.version.setText(QCoreApplication.translate("MainWindow", u"v1.0.2", None))
self.version.setText(QCoreApplication.translate("MainWindow", u"v1.0.3", None))
# retranslateUi