Remove offset on username field in classic theme

* Fix #5601

Fix padding offset in editable QComboBox

Accepted
This commit is contained in:
Jonathan White 2020-12-09 17:58:07 -05:00
parent 260c84ccf0
commit f9b2cf8484
3 changed files with 9 additions and 4 deletions

View File

@ -178,9 +178,6 @@ void EditEntryWidget::setupMain()
m_mainUi->expirePresets->setMenu(createPresetsMenu());
connect(m_mainUi->expirePresets->menu(), SIGNAL(triggered(QAction*)), this, SLOT(useExpiryPreset(QAction*)));
// HACK: Align username text with other line edits. Qt does not let you do this with an application stylesheet.
m_mainUi->usernameComboBox->lineEdit()->setStyleSheet("padding-left: 8px;");
}
void EditEntryWidget::setupAdvanced()

View File

@ -4775,7 +4775,11 @@ QRect BaseStyle::subElementRect(SubElement sr, const QStyleOption* opt, const QW
}
case SE_LineEditContents: {
QRect r = QCommonStyle::subElementRect(sr, opt, w);
int pad = Phantom::dpiScaled(Phantom::LineEdit_ContentsHPad);
int pad = Phantom::LineEdit_ContentsHPad;
if (w && qobject_cast<const QComboBox*>(w->parentWidget())) {
pad += 3;
}
pad = Phantom::dpiScaled(pad);
return r.adjusted(pad, 0, -pad, 0);
}
default:

View File

@ -13,3 +13,7 @@ DatabaseWidget #SearchBanner, DatabaseWidget #KeeShareBanner {
border: 1px solid rgb(190, 190, 190);
padding: 2px;
}
QLineEdit {
padding-left: 2px;
}