mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-15 21:32:05 +08:00
下载按钮未屏蔽双击事件,导致触发主窗口最大化动作,同时下载对话框显示在原始位置;拖动时触发下载对话框显示,移动时又隐藏下载对话框,造成闪烁现象;重复点击下载按钮,对话框闪烁 Log: 修改下载按钮和下载对话框焦点策略对象,保证对话框焦点状态与下载按钮同步;对话框显示操作移入下载按钮鼠标事件中处理,隐藏操作移入主窗口事件循环中判断,当主窗口/下载对话框均不是活动窗口时隐藏对话框 * 可能修复 ISSUE #I6FNOW,目前修改后,连续点击下载按钮,对话框将按顺序显示/隐藏
67 lines
1.4 KiB
C++
67 lines
1.4 KiB
C++
#ifndef MAINWINDOWDTK_H
|
|
#define MAINWINDOWDTK_H
|
|
|
|
#include "widgets/base/basewidgetopacity.h"
|
|
|
|
#include <DMainWindow>
|
|
#include <DTitlebar>
|
|
#include <DPushButton>
|
|
#include <DSearchEdit>
|
|
#include <DGuiApplicationHelper>
|
|
|
|
#include <QSystemTrayIcon>
|
|
|
|
DWIDGET_USE_NAMESPACE
|
|
|
|
namespace Ui {
|
|
class MainWindow;
|
|
}
|
|
|
|
class ProgressButton;
|
|
class DownloadListWidget;
|
|
class MainWindow : public BaseWidgetOpacity
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit MainWindow(QWidget *parent = nullptr);
|
|
~MainWindow() override;
|
|
|
|
void openUrl(const QString &url);
|
|
|
|
private:
|
|
void initUI();
|
|
void initTitleBar();
|
|
void initTitleBarMenu();
|
|
void initLeftMenu();
|
|
void initTrayIcon();
|
|
void initConnections();
|
|
void initDbus();
|
|
void initTmpDir();
|
|
void switchPage(int now);
|
|
void updateUi(int now);
|
|
|
|
public slots:
|
|
void notify(QObject *receiver, QEvent *event);
|
|
|
|
private slots:
|
|
//接受来自dbus的url
|
|
void onGetUrl(const QString &url);
|
|
void onNewProcessInstance(qint64 pid, const QStringList &arguments);
|
|
void on_pushButton_14_clicked();
|
|
|
|
private:
|
|
Ui::MainWindow *ui;
|
|
|
|
DPushButton *backButton;
|
|
DSearchEdit *searchEdit;
|
|
ProgressButton *downloadButton;
|
|
DownloadListWidget *downloadlistwidget;
|
|
|
|
QSystemTrayIcon *trayIcon = nullptr;
|
|
|
|
QList<int> pageHistory;
|
|
};
|
|
|
|
#endif // MAINWINDOWDTK_H
|