summary refs log tree commit diff
path: root/src/ui/OverlayModal.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/OverlayModal.cc')
-rw-r--r--src/ui/OverlayModal.cc35
1 files changed, 2 insertions, 33 deletions
diff --git a/src/ui/OverlayModal.cc b/src/ui/OverlayModal.cc

index e6fb0c7e..4b0747a1 100644 --- a/src/ui/OverlayModal.cc +++ b/src/ui/OverlayModal.cc
@@ -23,7 +23,6 @@ OverlayModal::OverlayModal(QWidget *parent, QWidget *content) : OverlayWidget(parent) , content_{content} - , duration_{500} , color_{QColor(55, 55, 55)} { auto layout = new QVBoxLayout(); @@ -32,21 +31,6 @@ OverlayModal::OverlayModal(QWidget *parent, QWidget *content) setLayout(layout); - opacity_ = new QGraphicsOpacityEffect(this); - setGraphicsEffect(opacity_); - - opacity_->setOpacity(1); - animation_ = new QPropertyAnimation(opacity_, "opacity", this); - animation_->setStartValue(1); - animation_->setEndValue(0); - animation_->setDuration(duration_); - animation_->setEasingCurve(QEasingCurve::Linear); - - connect(animation_, &QPropertyAnimation::finished, [this]() { - if (animation_->direction() == QAbstractAnimation::Forward) - this->close(); - }); - content->setFocus(); } @@ -63,22 +47,7 @@ void OverlayModal::mousePressEvent(QMouseEvent *e) { if (isDismissible_ && content_ && !content_->geometry().contains(e->pos())) - fadeOut(); -} - -void -OverlayModal::fadeIn() -{ - animation_->setDirection(QAbstractAnimation::Backward); - animation_->start(); - show(); -} - -void -OverlayModal::fadeOut() -{ - animation_->setDirection(QAbstractAnimation::Forward); - animation_->start(); + hide(); } void @@ -86,6 +55,6 @@ OverlayModal::keyPressEvent(QKeyEvent *event) { if (event->key() == Qt::Key_Escape) { event->accept(); - fadeOut(); + hide(); } }