From fdd5051dcf832e07447aef45e4c5955ce2cc42aa Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Sat, 17 Feb 2018 18:43:40 +0200 Subject: Remove QPropertyAnimation from modals to work around a regression on Qt 5.10.1 (#87) --- src/ui/OverlayModal.cc | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) (limited to 'src/ui') 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(); } } -- cgit 1.5.1