mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-13 12:22:05 +08:00
添加商店内弹出窗消息
使用SpkUiMessage::SendStoreNotification激活,必须在SpkStore构造函数加载完全局SpkPopup类之后才可 使用。
This commit is contained in:
@@ -62,7 +62,7 @@ namespace SpkUi
|
||||
mLastCheckedBtn = nullptr;
|
||||
}
|
||||
else
|
||||
// QUESTIONABLE:
|
||||
// NOTE:
|
||||
// Apparently for checkable buttons, Qt flip their checked property AFTER
|
||||
// this slot function. So to prevent a checkable button being unchecked,
|
||||
// we set it to unchecked here. Qt will flip it back to checked later.
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <QCheckBox>
|
||||
#include <QGroupBox>
|
||||
#include <QTextEdit>
|
||||
#include <QLineEdit>
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QSlider>
|
||||
@@ -38,8 +39,12 @@ namespace SpkUi
|
||||
QSlider *SlideV;
|
||||
SpkLoading *Loading;
|
||||
|
||||
QLineEdit *PopupText;
|
||||
QPushButton *ShowPopup;
|
||||
|
||||
public slots:
|
||||
void SetStylesheet();
|
||||
void FetchStylesheet();
|
||||
void ShowPopupSlot();
|
||||
};
|
||||
}
|
||||
|
||||
30
inc/spkpopup.h
Normal file
30
inc/spkpopup.h
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QLabel>
|
||||
#include <QWidget>
|
||||
#include <QHBoxLayout>
|
||||
#include <QPropertyAnimation>
|
||||
#include <QSequentialAnimationGroup>
|
||||
|
||||
class SpkMainWindow;
|
||||
|
||||
namespace SpkUi
|
||||
{
|
||||
class SpkPopup : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SpkPopup(QWidget *parent, int aMillis = 3000);
|
||||
|
||||
public slots:
|
||||
void Show(QString aText);
|
||||
|
||||
private:
|
||||
QPoint MoveOffset;
|
||||
QLabel *mText;
|
||||
QHBoxLayout *mBox;
|
||||
QPropertyAnimation *mAnimFadeIn, *mAnimFadeOut;
|
||||
QSequentialAnimationGroup *mAnim;
|
||||
};
|
||||
}
|
||||
@@ -16,6 +16,8 @@ namespace SpkUi
|
||||
enum SpkUiStyle { Light, Dark };
|
||||
enum SpkButtonStyle { Normal = 0, Recommend, Warn };
|
||||
|
||||
class SpkPopup;
|
||||
|
||||
constexpr int StackTraceArraySize = 64;
|
||||
constexpr const char * const StoreIconName = "spark-store";
|
||||
|
||||
@@ -40,6 +42,8 @@ namespace SpkUi
|
||||
extern QStyle *OldSystemStyle;
|
||||
extern QList<QColor> CurrentColorSet;
|
||||
|
||||
extern SpkPopup *Popup;
|
||||
|
||||
namespace States
|
||||
{
|
||||
extern bool IsDDE, IsUsingDtkPlugin;
|
||||
|
||||
Reference in New Issue
Block a user