mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-14 04:42:03 +08:00
New Non-DTK store client prototype
This commit is contained in:
78
inc/spkmainwindow.h
Normal file
78
inc/spkmainwindow.h
Normal file
@@ -0,0 +1,78 @@
|
||||
//
|
||||
// Created by rigoligo on 2021/5/9.
|
||||
//
|
||||
|
||||
#ifndef _SPKMAINWINDOW_H_
|
||||
#define _SPKMAINWINDOW_H_
|
||||
|
||||
#include "spkwindow.h"
|
||||
#include <QTextEdit>
|
||||
#include <QStackedWidget>
|
||||
#include <QButtonGroup>
|
||||
#include <QJsonObject>
|
||||
#include "spkpageqsstest.h"
|
||||
|
||||
namespace SpkUi
|
||||
{
|
||||
class SpkCategoryButton : public QPushButton
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SpkCategoryButton(QWidget *parent = nullptr);
|
||||
void SetIcon(QPixmap);
|
||||
void SetText(QString);
|
||||
static constexpr int Spacing = 8;
|
||||
private:
|
||||
QHBoxLayout *mLayout;
|
||||
QLabel *mIcon, *mText;
|
||||
};
|
||||
class SpkCategorySelector : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SpkCategorySelector(QWidget *parent = nullptr);
|
||||
|
||||
void AddButton(QString aBtnText, int aCategoryId = 0, QPixmap *aBtnIcon = nullptr);
|
||||
void DeleteAllButtons();
|
||||
|
||||
signals:
|
||||
void CategorySelected(int);
|
||||
|
||||
private:
|
||||
QVBoxLayout *mBtnLayout;
|
||||
QButtonGroup *mGroup;
|
||||
QList<SpkCategoryButton*> mBtnList;
|
||||
};
|
||||
|
||||
class SpkMainWidget : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SpkMainWidget(QWidget *parent = nullptr);
|
||||
|
||||
QHBoxLayout *HorizontalDivide;
|
||||
SpkCategorySelector *CategoryWidget;
|
||||
QVBoxLayout *VLayCategoryButtons,
|
||||
*VLayMain;
|
||||
SpkTitleBar *TitleBar;
|
||||
|
||||
QStackedWidget *Pager;
|
||||
|
||||
//Pages
|
||||
SpkPageQssTest *PageQssTest;
|
||||
};
|
||||
}
|
||||
|
||||
class SpkMainWindow : public SpkWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
SpkUi::SpkMainWidget *ui;
|
||||
|
||||
public:
|
||||
SpkMainWindow(QWidget *parent = nullptr);
|
||||
|
||||
void PopulateCategories(QJsonObject);
|
||||
};
|
||||
|
||||
#endif //_SPKMAINWINDOW_H_
|
||||
Reference in New Issue
Block a user