diff --git a/include/alarmEventRealTimeDock.h b/include/alarmEventRealTimeDock.h index 966f1f4..ff899e6 100644 --- a/include/alarmEventRealTimeDock.h +++ b/include/alarmEventRealTimeDock.h @@ -33,7 +33,8 @@ private: Ui::alarmEventRealTimeDock* ui; AlarmEventDataView* m_tableView; - QPropertyAnimation* m_animation; + QPropertyAnimation* m_animationExpand; + QPropertyAnimation* m_animationAlert; bool m_isInAnimation; QString m_curState; }; diff --git a/source/alarmEventRealTimeDock.cpp b/source/alarmEventRealTimeDock.cpp index 818815b..c490898 100644 --- a/source/alarmEventRealTimeDock.cpp +++ b/source/alarmEventRealTimeDock.cpp @@ -19,9 +19,9 @@ AlarmEventRealTimeDock::AlarmEventRealTimeDock(QWidget* parent) m_tableView = new AlarmEventDataView(RealTime, this); ui->tableLayout->addWidget(m_tableView); - m_animation = new QPropertyAnimation(this, "geometry"); - m_animation->setDuration(120); - connect(m_animation, &QPropertyAnimation::finished, this, [this]{m_isInAnimation = false;}); + m_animationExpand = new QPropertyAnimation(this, "geometry"); + m_animationExpand->setDuration(120); + connect(m_animationExpand, &QPropertyAnimation::finished, this, [this]{m_isInAnimation = false;}); ui->btnClose->setVisible(false); connect(ui->btnOpen, &QPushButton::clicked, this, &AlarmEventRealTimeDock::onBtnClicked_open); @@ -53,9 +53,9 @@ void AlarmEventRealTimeDock::expand() { QRect startRect(x(), y(), width(), height()); QRect endRect(x(), parent->height() - height() - bottomMargin, width(), height()); - m_animation->setStartValue(startRect); - m_animation->setEndValue(endRect); - m_animation->start(); + m_animationExpand->setStartValue(startRect); + m_animationExpand->setEndValue(endRect); + m_animationExpand->start(); m_curState = "expand"; m_isInAnimation = true; } @@ -70,10 +70,10 @@ void AlarmEventRealTimeDock::collapse() if(parent) { QRect startRect(x(), y(), width(), height()); - QRect endRect(x(), parent->height() - ui->tobBar->height(), width(), height()); - m_animation->setStartValue(startRect); - m_animation->setEndValue(endRect); - m_animation->start(); + QRect endRect(x(), parent->height() - ui->tobBar->height() - ui->alertWidget->height(), width(), height()); + m_animationExpand->setStartValue(startRect); + m_animationExpand->setEndValue(endRect); + m_animationExpand->start(); m_curState = "collapse"; m_isInAnimation = true; } @@ -88,7 +88,7 @@ void AlarmEventRealTimeDock::updateGeometry() int parentHeight = parent->height(); int selfWidth = parentWidth * 0.8; int x = (parentWidth - selfWidth) * 0.5; - int y = parentHeight - ui->tobBar->height(); + int y = parentHeight - ui->tobBar->height() - ui->alertWidget->height(); if(m_curState == "expand") y = parentHeight - this->height() - bottomMargin; setGeometry(x, y, selfWidth, height()); diff --git a/ui/alarmEventRealTimeDock.ui b/ui/alarmEventRealTimeDock.ui index 8699aea..6dcdba7 100644 --- a/ui/alarmEventRealTimeDock.ui +++ b/ui/alarmEventRealTimeDock.ui @@ -7,7 +7,7 @@ 0 0 1177 - 250 + 265 @@ -22,7 +22,7 @@ color: rgb(200, 200, 200); - + 0 @@ -38,6 +38,25 @@ color: rgb(200, 200, 200); 0 + + + + + 0 + 15 + + + + + 16777215 + 15 + + + + background-color: qradialgradient(spread:pad, cx:0.5, cy:0.6, radius:0.5, fx:0.5, fy:0.5, stop:0 rgba(200, 0, 0, 0), stop:1 rgba(255, 255, 255, 0)); + + +