下载页面雏形,修复SpkPopup(改用弹出),添加应用列表固定图标缓存

This commit is contained in:
RigoLigoRLC
2021-12-12 00:25:19 +08:00
parent f5a31affff
commit 179e57b9b5
19 changed files with 354 additions and 26 deletions

52
inc/spkdownloadentry.h Normal file
View File

@@ -0,0 +1,52 @@
#pragma once
#include <QWidget>
#include <QPushButton>
#include <QLabel>
#include "qt/elidedlabel.h"
#include "spkloading.h"
#include <QProgressBar>
#include <QHBoxLayout>
#include <QVBoxLayout>
class SpkDownloadEntry : public QWidget
{
Q_OBJECT
public:
explicit SpkDownloadEntry(QWidget* parent = nullptr);
~SpkDownloadEntry();
static constexpr QSize IconSize { 64, 64 };
enum DownloadEntryStatus
{
Invalid = -1,
Waiting,
Downloading,
Paused,
Failed,
ToBeInstalled,
Installing,
Installed,
InstallFailed
};
public slots:
void SetBasicInfo(QString name, QPixmap icon);
void SetStatus(DownloadEntryStatus status);
void SetProgress(int);
private:
QLabel *mIcon, *mMessage;
ElidedLabel *mAppName;
QProgressBar *mProgress;
QPushButton *mBtnDelete,
*mBtnActions; // Actions include Retry Pause Install etc, one status at a time
SpkLoading *mLoading;
QHBoxLayout *mLayMsgs, *mLayMain;
QVBoxLayout *mLayInfo;
};