哈维柯下直接注销进入登录界面密码框布局显示有误

This commit is contained in:
liudunfa 2024-08-20 16:47:33 +08:00
parent 192cc9493a
commit 99a5c7b0ab
1 changed files with 12 additions and 1 deletions

View File

@ -105,8 +105,10 @@ void IconEdit::resizeEvent(QResizeEvent *)
// 设置输入框中文件输入区,不让输入的文字在被隐藏在按钮下
int w = m_iconButton->width() + m_modeButton->width();
if (systemLang == "ug_CN" || systemLang == "ky_KG" || systemLang == "kk_KZ") {
m_edit->setAlignment(Qt::AlignRight);
m_edit->setTextMargins(m_capsState ? w + m_capsIcon->width() + 10 : w + 6, 1, 1, 1);
} else {
m_edit->setAlignment(Qt::AlignLeft);
m_edit->setTextMargins(1, 1, m_capsState ? w + m_capsIcon->width() + 10 : w + 6, 1);
}
m_edit->setFixedSize(size());
@ -167,10 +169,15 @@ void IconEdit::refreshTranslate()
{
QLocale local;
systemLang = local.name();
int w = m_iconButton->width() + m_modeButton->width();
if (systemLang == "ug_CN" || systemLang == "ky_KG" || systemLang == "kk_KZ") {
setLayoutDirection(Qt::RightToLeft);
m_edit->setAlignment(Qt::AlignRight);
m_edit->setTextMargins(m_capsState ? w + m_capsIcon->width() + 10 : w + 6, 1, 1, 1);
} else {
setLayoutDirection(Qt::LeftToRight);
m_edit->setAlignment(Qt::AlignLeft);
m_edit->setTextMargins(1, 1, m_capsState ? w + m_capsIcon->width() + 10 : w + 6, 1);
}
}
@ -320,5 +327,9 @@ void IconEdit::onCapsChanged(bool state)
}
m_capsIcon->setVisible(m_capsState);
int w = m_iconButton->width() + m_modeButton->width();
m_edit->setTextMargins(1, 1, m_capsState ? w + m_capsIcon->width() + 10 : w + 6, 1);
if (systemLang == "ug_CN" || systemLang == "ky_KG" || systemLang == "kk_KZ") {
m_edit->setTextMargins(m_capsState ? w + m_capsIcon->width() + 10 : w + 6, 1, 1, 1);
} else {
m_edit->setTextMargins(1, 1, m_capsState ? w + m_capsIcon->width() + 10 : w + 6, 1);
}
}