mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-16 17:11:37 +08:00
BaseWidgetOpacity 是一个提供了淡出/淡入动画的基础类
1. closeEvent 窗口关闭时进行淡出动画
此前在 MainWindow 中实现的淡出动画将由 BaseWidgetOpacity 来实现。
此前 MainWindow 原有的 DBlurEffectWidget 父类将移交至 BaseWidgetOpacity 继承。
注意:
如果 MainWindow 在未来重写 closeEvent 事件时将可能丢失 BaseWidgetOpacity 中的淡出效果
59 lines
1.2 KiB
C++
59 lines
1.2 KiB
C++
#ifndef MAINWINDOWDTK_H
|
|
#define MAINWINDOWDTK_H
|
|
|
|
#include <DMainWindow>
|
|
#include <DTitlebar>
|
|
#include <DSearchEdit>
|
|
#include <QGraphicsDropShadowEffect>
|
|
#include <DGuiApplicationHelper>
|
|
|
|
#include <QPushButton>
|
|
#include <QDir>
|
|
#include <QDesktopServices>
|
|
|
|
#include "widgets/base/basewidgetopacity.h"
|
|
#include "widgets/downloadlistwidget.h"
|
|
#include "widgets/common/progressbutton.h"
|
|
#include "utils/widgetanimation.h"
|
|
#include "dbus/dbussparkstoreservice.h"
|
|
|
|
DWIDGET_USE_NAMESPACE
|
|
|
|
namespace Ui {
|
|
class MainWindow;
|
|
}
|
|
|
|
class MainWindow : public BaseWidgetOpacity
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit MainWindow(QWidget *parent = nullptr);
|
|
~MainWindow();
|
|
|
|
void openUrl(QUrl);
|
|
|
|
private:
|
|
void initDbus();
|
|
void initConfig();
|
|
void switchPage(int now);
|
|
void updateUi(int now);
|
|
|
|
private:
|
|
QList<int> pageHistory;
|
|
|
|
DownloadListWidget *downloadlistwidget;
|
|
ProgressButton *downloadButton;
|
|
QPushButton *backButtom;
|
|
DSearchEdit *searchEdit = new DSearchEdit;
|
|
Ui::MainWindow *ui;
|
|
|
|
private slots:
|
|
//接受来自dbus的url
|
|
void onGetUrl(const QString &url);
|
|
void on_pushButton_14_clicked();
|
|
|
|
};
|
|
|
|
#endif // MAINWINDOWDTK_H
|