mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-14 12:52:04 +08:00
repo: 添加 BaseWidgetOpacity 基础类来实现继承者的淡出动画来代替主窗口的实现
BaseWidgetOpacity 是一个提供了淡出/淡入动画的基础类
1. closeEvent 窗口关闭时进行淡出动画
此前在 MainWindow 中实现的淡出动画将由 BaseWidgetOpacity 来实现。
此前 MainWindow 原有的 DBlurEffectWidget 父类将移交至 BaseWidgetOpacity 继承。
注意:
如果 MainWindow 在未来重写 closeEvent 事件时将可能丢失 BaseWidgetOpacity 中的淡出效果
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
#define MAINWINDOWDTK_H
|
||||
|
||||
#include <DMainWindow>
|
||||
#include <DBlurEffectWidget>
|
||||
#include <DTitlebar>
|
||||
#include <DSearchEdit>
|
||||
#include <QGraphicsDropShadowEffect>
|
||||
@@ -12,6 +11,7 @@
|
||||
#include <QDir>
|
||||
#include <QDesktopServices>
|
||||
|
||||
#include "widgets/base/basewidgetopacity.h"
|
||||
#include "widgets/downloadlistwidget.h"
|
||||
#include "widgets/common/progressbutton.h"
|
||||
#include "utils/widgetanimation.h"
|
||||
@@ -23,7 +23,7 @@ namespace Ui {
|
||||
class MainWindow;
|
||||
}
|
||||
|
||||
class MainWindow : public DBlurEffectWidget
|
||||
class MainWindow : public BaseWidgetOpacity
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -53,10 +53,6 @@ private slots:
|
||||
void onGetUrl(const QString &url);
|
||||
void on_pushButton_14_clicked();
|
||||
|
||||
// QWidget interface
|
||||
protected:
|
||||
bool closeWindowAnimation = false;
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
};
|
||||
|
||||
#endif // MAINWINDOWDTK_H
|
||||
|
||||
Reference in New Issue
Block a user