diff --git a/main.ui b/main.ui index bbade10..8d2d8a4 100644 --- a/main.ui +++ b/main.ui @@ -1177,6 +1177,12 @@ Button */ + + + 20 + 0 + + 20 @@ -1184,7 +1190,7 @@ Button */ - QFrame::StyledPanel + QFrame::NoFrame QFrame::Raised @@ -1193,6 +1199,12 @@ Button */ + + + 150 + 0 + + Left Box @@ -2998,7 +3010,7 @@ background-repeat: no-repeat; - v1.0.2 + v1.0.3 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter diff --git a/modules/ui_functions.py b/modules/ui_functions.py index 47a97af..087b7d4 100644 --- a/modules/ui_functions.py +++ b/modules/ui_functions.py @@ -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 # /////////////////////////////////////////////////////////////// diff --git a/modules/ui_main.py b/modules/ui_main.py index 61d957a..01ff72d 100644 --- a/modules/ui_main.py +++ b/modules/ui_main.py @@ -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 +