matrixion/src/ui/RaisedButton.h

33 lines
662 B
C
Raw Normal View History

2021-03-05 02:35:15 +03:00
// SPDX-FileCopyrightText: 2021 Nheko Contributors
//
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
2017-04-06 02:06:42 +03:00
#include <QGraphicsDropShadowEffect>
#include <QState>
#include <QStateMachine>
#include "FlatButton.h"
class RaisedButton : public FlatButton
{
2021-09-18 01:22:33 +03:00
Q_OBJECT
2017-04-06 02:06:42 +03:00
public:
2021-09-18 01:22:33 +03:00
explicit RaisedButton(QWidget *parent = nullptr);
explicit RaisedButton(const QString &text, QWidget *parent = nullptr);
~RaisedButton() override;
2017-04-06 02:06:42 +03:00
protected:
2021-09-18 01:22:33 +03:00
bool event(QEvent *event) override;
2017-04-06 02:06:42 +03:00
private:
2021-09-18 01:22:33 +03:00
void init();
2017-04-06 02:06:42 +03:00
2021-09-18 01:22:33 +03:00
QStateMachine *shadow_state_machine_;
QState *normal_state_;
QState *pressed_state_;
QGraphicsDropShadowEffect *effect_;
2017-04-06 02:06:42 +03:00
};