summary refs log tree commit diff
path: root/src/ui/Ripple.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-01-30 13:16:36 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2022-01-30 13:16:36 +0100
commitf44d8e916beb3e1059ba31e149de0cffbcaa02fd (patch)
tree71ef187a209d4fb4bf11bd7015d75bc0bd857d8f /src/ui/Ripple.cpp
parentFix centering dialogs (diff)
downloadnheko-f44d8e916beb3e1059ba31e149de0cffbcaa02fd.tar.xz
Remove a few now unused files
Diffstat (limited to 'src/ui/Ripple.cpp')
-rw-r--r--src/ui/Ripple.cpp116
1 files changed, 0 insertions, 116 deletions
diff --git a/src/ui/Ripple.cpp b/src/ui/Ripple.cpp
deleted file mode 100644

index 84c0b394..00000000 --- a/src/ui/Ripple.cpp +++ /dev/null
@@ -1,116 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Nheko Contributors -// SPDX-FileCopyrightText: 2022 Nheko Contributors -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#include "Ripple.h" -#include "RippleOverlay.h" - -Ripple::Ripple(const QPoint &center, QObject *parent) - : QParallelAnimationGroup(parent) - , overlay_(nullptr) - , radius_anim_(animate("radius")) - , opacity_anim_(animate("opacity")) - , radius_(0) - , opacity_(0) - , center_(center) -{ - init(); -} - -Ripple::Ripple(const QPoint &center, RippleOverlay *overlay, QObject *parent) - : QParallelAnimationGroup(parent) - , overlay_(overlay) - , radius_anim_(animate("radius")) - , opacity_anim_(animate("opacity")) - , radius_(0) - , opacity_(0) - , center_(center) -{ - init(); -} - -void -Ripple::setRadius(qreal radius) -{ - Q_ASSERT(overlay_); - - if (radius_ == radius) - return; - - radius_ = radius; - overlay_->update(); - - emit radiusChanged(); -} - -void -Ripple::setOpacity(qreal opacity) -{ - Q_ASSERT(overlay_); - - if (opacity_ == opacity) - return; - - opacity_ = opacity; - overlay_->update(); - - emit opacityChanged(); -} - -void -Ripple::setColor(const QColor &color) -{ - if (brush_.color() == color) - return; - - brush_.setColor(color); - - if (overlay_) - overlay_->update(); -} - -void -Ripple::setBrush(const QBrush &brush) -{ - brush_ = brush; - - if (overlay_) - overlay_->update(); -} - -void -Ripple::destroy() -{ - Q_ASSERT(overlay_); - - overlay_->removeRipple(this); -} - -QPropertyAnimation * -Ripple::animate(const QByteArray &property, const QEasingCurve &easing, int duration) -{ - QPropertyAnimation *animation = new QPropertyAnimation; - animation->setTargetObject(this); - animation->setPropertyName(property); - animation->setEasingCurve(easing); - animation->setDuration(duration); - - addAnimation(animation); - - return animation; -} - -void -Ripple::init() -{ - setOpacityStartValue(0.5); - setOpacityEndValue(0); - setRadiusStartValue(0); - setRadiusEndValue(300); - - brush_.setColor(Qt::black); - brush_.setStyle(Qt::SolidPattern); - - connect(this, SIGNAL(finished()), this, SLOT(destroy())); -}