调试初版
This commit is contained in:
@@ -36,7 +36,7 @@ BootPasswordPage::BootPasswordPage(AppContext* ctx, QWidget* parent)
|
||||
m_input->setEchoMode(QLineEdit::Password);
|
||||
m_input->setAlignment(Qt::AlignCenter);
|
||||
m_input->setFixedSize(450, 120);
|
||||
m_input->setStyleSheet("font-size:80px");
|
||||
m_input->setStyleSheet("font-size:50px");
|
||||
m_input->setProperty("clickable", true);
|
||||
lay->addWidget(m_input, 0, Qt::AlignHCenter);
|
||||
//lay->addSpacing(20);
|
||||
@@ -55,11 +55,11 @@ BootPasswordPage::BootPasswordPage(AppContext* ctx, QWidget* parent)
|
||||
btnRow->setSpacing(80);
|
||||
btnRow->addStretch(1);
|
||||
QPushButton* ok = button("确认", "", col);
|
||||
ok->setFixedSize(160, 140);
|
||||
ok->setFixedSize(160, 100);
|
||||
ok->setStyleSheet("font-size:60px;");
|
||||
connect(ok, &QPushButton::clicked, this, &BootPasswordPage::onConfirm);
|
||||
QPushButton* cancel = button("取消", "", col);
|
||||
cancel->setFixedSize(160, 140);
|
||||
QPushButton* cancel = button("清空", "", col);
|
||||
cancel->setFixedSize(160, 100);
|
||||
cancel->setStyleSheet(cancelButtonStyle(60)); // 选中时红底白字
|
||||
connect(cancel, &QPushButton::clicked, this, &BootPasswordPage::onCancel);
|
||||
btnRow->addWidget(ok);
|
||||
@@ -93,7 +93,8 @@ bool BootPasswordPage::eventFilter(QObject* obj, QEvent* ev)
|
||||
}
|
||||
if (ev->type() == QEvent::KeyPress) {
|
||||
QKeyEvent* ke = static_cast<QKeyEvent*>(ev);
|
||||
if (ke->key() == Qt::Key_Return || ke->key() == Qt::Key_Enter) {
|
||||
// 空格当“点击”:Tab 聚焦后按空格弹出数字键盘
|
||||
if (Keys::space(ke->key())) {
|
||||
onInputClicked();
|
||||
return true;
|
||||
}
|
||||
@@ -155,5 +156,5 @@ void BootPasswordPage::refreshInput()
|
||||
// 空态:无论是否被选中都显示提示文字(灰字);有内容:显示密码圆点
|
||||
m_input->setEchoMode(empty ? QLineEdit::Normal : QLineEdit::Password);
|
||||
m_input->setText(empty ? "点击输入密码" : m_value);
|
||||
m_input->setStyleSheet(empty ? "font-size:50px;color:#9AA7B4;" : "font-size:80px;");
|
||||
m_input->setStyleSheet(empty ? "font-size:50px;color:#9AA7B4;" : "font-size:50px;");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user