mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-14 04:42:03 +08:00
添加应用详情页面
This commit is contained in:
55
inc/page/spkpageappdetails.h
Normal file
55
inc/page/spkpageappdetails.h
Normal file
@@ -0,0 +1,55 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QLabel>
|
||||
#include <QScrollArea>
|
||||
#include <QVBoxLayout>
|
||||
#include <QFormLayout>
|
||||
#include "page/spkpagebase.h"
|
||||
#include "spkstretchlayout.h"
|
||||
|
||||
namespace SpkUi
|
||||
{
|
||||
class SpkDetailEntry;
|
||||
|
||||
class SpkPageAppDetails : public SpkPageBase
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SpkPageAppDetails(QWidget *parent = nullptr);
|
||||
|
||||
void LoadAppResources(QString pkgName, QString icon, QStringList screenshots, QStringList tags);
|
||||
|
||||
private:
|
||||
|
||||
public slots:
|
||||
void ResourceAcquisitionFinished(int id, ResourceResult result);
|
||||
void Activated();
|
||||
|
||||
public:
|
||||
static constexpr QSize IconSize { 144, 144 };
|
||||
|
||||
QScrollArea *mMainArea;
|
||||
QWidget *mDetailWidget, *mIconTitleWidget, *mWid4MainArea;
|
||||
QLabel *mAppTitle, *mAppIcon, *mAppDescription, *mAppShortDesc, *mPkgName, *mVersion;
|
||||
SpkDetailEntry *mAuthor, *mContributor, *mSite, *mArch, *mSize;
|
||||
SpkStretchLayout *mDetailLay;
|
||||
QVBoxLayout *mMainLay, *mTitleLay, *mLay4MainArea;
|
||||
QHBoxLayout *mIconTitleLay;
|
||||
|
||||
};
|
||||
|
||||
class SpkDetailEntry : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SpkDetailEntry(QWidget *parent = nullptr);
|
||||
void SetTitle(const QString &s) { mTitle.setText(s); }
|
||||
void SetValue(const QString &s) { mField.setText(s); }
|
||||
|
||||
private:
|
||||
QLabel mTitle, mField;
|
||||
QHBoxLayout mLay;
|
||||
};
|
||||
}
|
||||
@@ -43,7 +43,7 @@ namespace SpkUi
|
||||
QString mKeyword;
|
||||
|
||||
signals:
|
||||
void ApplicationClicked(QString name, QString pkgName);
|
||||
void ApplicationClicked(int appId);
|
||||
void SwitchListPage(int categoryId, int page);
|
||||
void SwitchSearchPage(QString keyword, int page);
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include <QHBoxLayout>
|
||||
#include <QSlider>
|
||||
#include "spkappitem.h"
|
||||
#include "spkstretchlayout.h"
|
||||
#include "page/spkpageappdetails.h"
|
||||
|
||||
#include "spkloading.h"
|
||||
|
||||
@@ -40,6 +42,9 @@ namespace SpkUi
|
||||
QSlider *SlideV;
|
||||
SpkLoading *Loading;
|
||||
SpkAppItem *AppItem;
|
||||
SpkStretchLayout *DetailsLay;
|
||||
SpkDetailEntry *Detail1, *Detail2, *Detail3;
|
||||
QWidget *DetailsWidget;
|
||||
|
||||
QLineEdit *PopupText;
|
||||
QPushButton *ShowPopup,
|
||||
|
||||
Reference in New Issue
Block a user