Fix button highlighting in multiple dialogs

* Changed style so that only default buttons have full background highlight. This prevents confusion as to which button in various dialogs is the default/desired choice.

* Move password generator popup into static function outside of PasswordEdit so other parts of the program can easily access it.

* QDialog forces 'autoDefault' property on all buttons causing them to obtain background highlight when they are focused. Moved Password Generator outside of a QDialog and forced 'autoDefault' to false on Browser Access Dialog.

* Fixed button ordering in Totp Setup Dialog

* About dialog close button is now the default button
This commit is contained in:
Jonathan White
2020-03-22 19:40:19 -04:00
committed by Janek Bevendorff
parent fbd78037ff
commit 243f68e0e8
9 changed files with 52 additions and 29 deletions

View File

@@ -57,6 +57,7 @@ void BrowserAccessControlDialog::setItems(const QList<Entry*>& items, const QStr
m_ui->itemsTable->setItem(row, 0, item);
auto disableButton = new QPushButton(tr("Disable for this site"));
disableButton->setAutoDefault(false);
connect(disableButton, &QAbstractButton::pressed, [&, item] {
emit disableAccess(item);
m_ui->itemsTable->removeRow(item->row());

View File

@@ -88,6 +88,12 @@
<property name="text">
<string>Allow Selected</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@@ -96,7 +102,7 @@
<string>Deny All</string>
</property>
<property name="autoDefault">
<bool>false</bool>
<bool>true</bool>
</property>
</widget>
</item>

View File

@@ -823,11 +823,6 @@ QList<Entry*> BrowserService::confirmEntries(QList<Entry*>& pwEntriesToConfirm,
accessControlDialog.setItems(pwEntriesToConfirm, !submitHost.isEmpty() ? submitHost : url, httpAuth);
raiseWindow();
accessControlDialog.show();
accessControlDialog.activateWindow();
accessControlDialog.raise();
QList<Entry*> allowedEntries;
if (accessControlDialog.exec() == QDialog::Accepted) {
const auto selectedEntries = accessControlDialog.getSelectedEntries();