61 lines
2.2 KiB
C++
61 lines
2.2 KiB
C++
#include "passwordmgmt.h"
|
|
#include <QVBoxLayout>
|
|
#include <QHBoxLayout>
|
|
#include <QLabel>
|
|
#include <QPushButton>
|
|
#include <QCheckBox>
|
|
#include "global.h"
|
|
|
|
PasswordMgmtPage::PasswordMgmtPage(AppContext* ctx, QWidget* parent)
|
|
: BasePage(ctx, parent)
|
|
{
|
|
QVBoxLayout* root = new QVBoxLayout(this);
|
|
root->addStretch(1);
|
|
|
|
QWidget* col = new QWidget(this);
|
|
col->setFixedWidth(700);
|
|
QVBoxLayout* lay = new QVBoxLayout(col);
|
|
lay->setSpacing(50);
|
|
lay->setAlignment(Qt::AlignHCenter);
|
|
|
|
QLabel* title = label("密码管理界面", 60, C::TEXT, true, col);
|
|
title->setAlignment(Qt::AlignCenter);
|
|
lay->addWidget(title);
|
|
|
|
// 功能选项列表
|
|
QWidget* option = new QWidget(col);
|
|
option->setProperty("card", true);
|
|
option->setStyleSheet(QString("QWidget[card=\"true\"]{background-color:%1;border:2px solid %2;border-radius:12px;}")
|
|
.arg(C::PANEL, C::BORDER));
|
|
QVBoxLayout* optLay = new QVBoxLayout(option);
|
|
m_reset = new QCheckBox("重置密码功能", option);
|
|
m_reset->setChecked(true);
|
|
m_reset->setStyleSheet(QString(
|
|
"QCheckBox{color:%1;font-size:40px;spacing:16px;}"
|
|
"QCheckBox::indicator{width:40px;height:40px;border:2px solid %2;border-radius:6px;background-color:%3;}"
|
|
"QCheckBox::indicator:checked{background-color:%4;border-color:%4;image:none;}")
|
|
.arg(C::TEXT, C::BORDER, C::BG, C::PRIMARY));
|
|
optLay->addWidget(m_reset);
|
|
lay->addWidget(option);
|
|
|
|
// 确认 / 退出
|
|
QHBoxLayout* btnRow = new QHBoxLayout();
|
|
btnRow->setSpacing(80);
|
|
btnRow->addStretch(1);
|
|
QPushButton* ok = button("确认", "", col);
|
|
ok->setFixedSize(160, 140);
|
|
ok->setStyleSheet("font-size:60px;");
|
|
connect(ok, &QPushButton::clicked, this, [this]() { emit navigate(PageReset); });
|
|
QPushButton* exit = button("退出", "", col);
|
|
exit->setFixedSize(160, 140);
|
|
exit->setStyleSheet(cancelButtonStyle(60)); // 选中时红底白字
|
|
connect(exit, &QPushButton::clicked, this, [this]() { emit navigate(PageBoot); });
|
|
btnRow->addWidget(ok);
|
|
btnRow->addWidget(exit);
|
|
btnRow->addStretch(1);
|
|
lay->addLayout(btnRow);
|
|
|
|
root->addWidget(col, 0, Qt::AlignHCenter);
|
|
root->addStretch(1);
|
|
}
|