进度更新

This commit is contained in:
RigoLigo
2021-07-05 23:35:50 +08:00
parent 8991043127
commit 4df8bf7d0a
24 changed files with 835 additions and 134 deletions

View File

@@ -23,7 +23,7 @@ class SpkTitleBarDefaultButton : public QPushButton
{
Q_OBJECT
public:
SpkTitleBarDefaultButton();
SpkTitleBarDefaultButton(QWidget* parent = nullptr);
enum OperationButton { Minimize = 1, MaximizeRestore = 2, Close = 4, Restore = 3 };
void SetRole(OperationButton);
constexpr static int ButtonWidth = 60;
@@ -46,23 +46,22 @@ class SpkTitleBar : public QWidget
using OperationButton = SpkTitleBarDefaultButton::OperationButton;
void SetOperationButton(OperationButton);
void SetIcon(QPixmap &p) { mIcon.setPixmap(p); };
void SetTitle(QString t) { mTitle.setText(t); };
QString GetTitle() { return mTitle.text(); };
void SetUseIcon(bool t) { mIcon.setVisible(t); };
void SetLinkedWindow(QMainWindow *w) { mLinkedWindow = w; };
void SetIcon(QPixmap &p) { mIcon->setPixmap(p); }
void SetTitle(QString t) { mTitle->setText(t); }
QString GetTitle() { return mTitle->text(); }
void SetUseIcon(bool t) { mIcon->setVisible(t); }
void SetLinkedWindow(QMainWindow *w) { mLinkedWindow = w; }
QHBoxLayout &GetLeftUserSpace() { return mUserSpaceL; };
QHBoxLayout &GetRightUserSpace() { return mUserSpaceR; };
QHBoxLayout *GetUserSpace() { return mUserSpace; }
protected:
bool event(QEvent*) override;
private:
QLabel mIcon;
QLabel mTitle;
QLabel *mIcon;
QLabel *mTitle;
QMainWindow *mLinkedWindow;
QHBoxLayout mMainLayout, mUserSpaceL, mUserSpaceR;
SpkTitleBarDefaultButton mBtnMin, mBtnMaxRestore, mBtnClose;
QHBoxLayout *mMainLayout, *mUserSpace, *mBtnGroup;
SpkTitleBarDefaultButton *mBtnMin, *mBtnMaxRestore, *mBtnClose;
private slots:
void CloseWindow();