2023-02-16 13:51:55 +08:00
|
|
|
// SPDX-FileCopyrightText: 2018 - 2023 UnionTech Software Technology Co., Ltd.
|
2022-09-06 11:36:55 +08:00
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
|
2018-12-29 17:55:19 +08:00
|
|
|
#ifndef SPLITERANIMATED_H
|
|
|
|
#define SPLITERANIMATED_H
|
|
|
|
|
|
|
|
#include <constants.h>
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QVariantAnimation>
|
|
|
|
|
|
|
|
class SpliterAnimated : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit SpliterAnimated(QWidget *parent = nullptr);
|
|
|
|
|
|
|
|
void setStartValue(const QVariant &value);
|
|
|
|
void setEndValue(const QVariant &value);
|
2020-06-13 19:19:30 +08:00
|
|
|
// void startAnimation();
|
|
|
|
// void stopAnimation();
|
2018-12-29 17:55:19 +08:00
|
|
|
void setDockPosition(const Dock::Position position);
|
|
|
|
|
|
|
|
protected:
|
2020-06-13 19:19:30 +08:00
|
|
|
void paintEvent(QPaintEvent *event) override;
|
2018-12-29 17:55:19 +08:00
|
|
|
|
|
|
|
private Q_SLOTS:
|
|
|
|
void onSizeAnimationValueChanged(const QVariant &value);
|
|
|
|
|
|
|
|
private:
|
|
|
|
QVariantAnimation *m_sizeAnimation;
|
|
|
|
|
|
|
|
qreal m_opacityChangeStep;
|
|
|
|
qreal m_currentOpacity;
|
|
|
|
|
|
|
|
Dock::Position m_dockPosition;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SPLITERANIMATED_H
|