Skip to content

Commit

Permalink
Avoid focus border (open-eid#1037)
Browse files Browse the repository at this point in the history
IB-6909

Signed-off-by: Raul Metsma <[email protected]>
  • Loading branch information
metsma authored Mar 28, 2022
1 parent 7f11815 commit f9f6b7c
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
2 changes: 2 additions & 0 deletions client/dialogs/PinPopup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ PinPopup::PinPopup(PinFlags flags, const QString &title, TokenFlags count, QWidg
ui->setupUi(this);
setWindowFlags( Qt::Dialog | Qt::FramelessWindowHint );
setFixedSize( size() );
for(QLineEdit *w: findChildren<QLineEdit*>())
w->setAttribute(Qt::WA_MacShowFocusRect, false);

QFont regular = Styles::font( Styles::Regular, 14 );
QFont condensed14 = Styles::font( Styles::Condensed, 14 );
Expand Down
2 changes: 2 additions & 0 deletions client/dialogs/PinUnblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ void PinUnblock::init( WorkMode mode, QSmartCardData::PinType type, short leftAt
ui->horizontalLayout->setDirection(QBoxLayout::RightToLeft);
#endif
setWindowFlags( Qt::Dialog | Qt::FramelessWindowHint );
for(QLineEdit *w: findChildren<QLineEdit*>())
w->setAttribute(Qt::WA_MacShowFocusRect, false);

ui->unblock->setEnabled( false );
connect( ui->unblock, &QPushButton::clicked, this, &PinUnblock::accept );
Expand Down
2 changes: 1 addition & 1 deletion client/dialogs/PinUnblock.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace Ui {
class PinUnblock;
}

class PinUnblock : public QDialog
class PinUnblock final : public QDialog
{
Q_OBJECT

Expand Down
5 changes: 3 additions & 2 deletions client/dialogs/RoleAddressDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ RoleAddressDialog::RoleAddressDialog(QWidget *parent)
#if defined (Q_OS_WIN)
d->horizontalLayout->setDirection(QBoxLayout::RightToLeft);
#endif

setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint);
for(QLineEdit *w: findChildren<QLineEdit*>())
w->setAttribute(Qt::WA_MacShowFocusRect, false);

connect( d->cancel, &QPushButton::clicked, this, &RoleAddressDialog::reject );
d->cancel->setFont(condensed);
Expand Down Expand Up @@ -81,7 +82,7 @@ RoleAddressDialog::RoleAddressDialog(QWidget *parent)
if(list.size() > 10)
list.removeLast();
d->s.setValue(line->objectName(), QString()); // Uses on Windows MULTI_STRING registry
SettingsDialog::setValueEx(line->objectName(), list, QStringList());
SettingsDialog::setValueEx(line->objectName(), list);
});
completer->popup()->setStyleSheet("background-color:#FFFFFF; color: #000000;");
}
Expand Down
2 changes: 1 addition & 1 deletion client/dialogs/RoleAddressDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include <QDialog>

class RoleAddressDialog : public QDialog
class RoleAddressDialog final : public QDialog
{
Q_OBJECT
public:
Expand Down
6 changes: 6 additions & 0 deletions client/dialogs/SettingsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ SettingsDialog::SettingsDialog(QWidget *parent)
ui->setupUi(this);
setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint);
move(parent->geometry().center() - geometry().center());
for(QLineEdit *w: findChildren<QLineEdit*>())
w->setAttribute(Qt::WA_MacShowFocusRect, false);
for(QRadioButton *w: findChildren<QRadioButton*>())
w->setAttribute(Qt::WA_MacShowFocusRect, false);
for(QCheckBox *w: findChildren<QCheckBox*>())
w->setAttribute(Qt::WA_MacShowFocusRect, false);

QFont headerFont = Styles::font(Styles::Regular, 18, QFont::Bold);
QFont regularFont = Styles::font(Styles::Regular, 14);
Expand Down
5 changes: 3 additions & 2 deletions client/widgets/ItemList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ ItemList::ItemList(QWidget *parent)
ui->count->setFont(Styles::font(Styles::Condensed, 12));
ui->count->hide();
ui->infoIcon->hide();
ui->txtFind->setAttribute(Qt::WA_MacShowFocusRect, false);
tabIndex = ui->btnFind;

connect(this, &ItemList::idChanged, this, [this](const SslCertificate &cert){ this->cert = cert; });
Expand Down Expand Up @@ -265,10 +266,10 @@ void ItemList::remove(Item *item)

void ItemList::removeItem(int row)
{
if(items.size() < row)
if(items.size() < size_t(row))
return;

auto item = items[row];
auto item = items[size_t(row)];
item->close();
items.erase(items.begin()+row);
}
Expand Down

0 comments on commit f9f6b7c

Please sign in to comment.