From f44d8e916beb3e1059ba31e149de0cffbcaa02fd Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sun, 30 Jan 2022 13:16:36 +0100 Subject: Remove a few now unused files --- src/ui/RaisedButton.cpp | 92 ------------------------------------------------- 1 file changed, 92 deletions(-) delete mode 100644 src/ui/RaisedButton.cpp (limited to 'src/ui/RaisedButton.cpp') diff --git a/src/ui/RaisedButton.cpp b/src/ui/RaisedButton.cpp deleted file mode 100644 index 491ab573..00000000 --- a/src/ui/RaisedButton.cpp +++ /dev/null @@ -1,92 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Nheko Contributors -// SPDX-FileCopyrightText: 2022 Nheko Contributors -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#include -#include - -#include "RaisedButton.h" - -void -RaisedButton::init() -{ - shadow_state_machine_ = new QStateMachine(this); - normal_state_ = new QState; - pressed_state_ = new QState; - effect_ = new QGraphicsDropShadowEffect; - - effect_->setBlurRadius(7); - effect_->setOffset(QPointF(0, 2)); - effect_->setColor(QColor(0, 0, 0, 75)); - - setBackgroundMode(Qt::OpaqueMode); - setMinimumHeight(42); - setGraphicsEffect(effect_); - setBaseOpacity(0.3); - - shadow_state_machine_->addState(normal_state_); - shadow_state_machine_->addState(pressed_state_); - - normal_state_->assignProperty(effect_, "offset", QPointF(0, 2)); - normal_state_->assignProperty(effect_, "blurRadius", 7); - - pressed_state_->assignProperty(effect_, "offset", QPointF(0, 5)); - pressed_state_->assignProperty(effect_, "blurRadius", 29); - - QAbstractTransition *transition; - - transition = new QEventTransition(this, QEvent::MouseButtonPress); - transition->setTargetState(pressed_state_); - normal_state_->addTransition(transition); - - transition = new QEventTransition(this, QEvent::MouseButtonDblClick); - transition->setTargetState(pressed_state_); - normal_state_->addTransition(transition); - - transition = new QEventTransition(this, QEvent::MouseButtonRelease); - transition->setTargetState(normal_state_); - pressed_state_->addTransition(transition); - - QPropertyAnimation *animation; - - animation = new QPropertyAnimation(effect_, "offset", this); - animation->setDuration(100); - shadow_state_machine_->addDefaultAnimation(animation); - - animation = new QPropertyAnimation(effect_, "blurRadius", this); - animation->setDuration(100); - shadow_state_machine_->addDefaultAnimation(animation); - - shadow_state_machine_->setInitialState(normal_state_); - shadow_state_machine_->start(); -} - -RaisedButton::RaisedButton(QWidget *parent) - : FlatButton(parent) -{ - init(); -} - -RaisedButton::RaisedButton(const QString &text, QWidget *parent) - : FlatButton(parent) -{ - init(); - setText(text); -} - -bool -RaisedButton::event(QEvent *event) -{ - if (QEvent::EnabledChange == event->type()) { - if (isEnabled()) { - shadow_state_machine_->start(); - effect_->setEnabled(true); - } else { - shadow_state_machine_->stop(); - effect_->setEnabled(false); - } - } - - return FlatButton::event(event); -} -- cgit 1.5.1