From b54f88eddf1a9790dfc3e73c13c3b610fc3346e6 Mon Sep 17 00:00:00 2001 From: Raul Metsma Date: Fri, 23 Dec 2022 09:44:35 +0200 Subject: [PATCH] Use auto layout (#1138) IB-7581 Signed-off-by: Raul Metsma Signed-off-by: Raul Metsma --- .github/workflows/build.yml | 1 + client/dialogs/PinPopup.cpp | 16 +- client/dialogs/PinPopup.ui | 378 +++++++++++++++++------------------- 3 files changed, 181 insertions(+), 214 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4e3c3b3c6..30d8a3523 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -297,6 +297,7 @@ jobs: with: patterns: | -**/*autogen*/** + -**/common/qtsingleapplication/** -**:cpp/poorly-documented-function input: sarif-results/cpp.sarif output: sarif-results/cpp.sarif diff --git a/client/dialogs/PinPopup.cpp b/client/dialogs/PinPopup.cpp index 765242a90..3f3664a3c 100644 --- a/client/dialogs/PinPopup.cpp +++ b/client/dialogs/PinPopup.cpp @@ -23,15 +23,13 @@ #include "SslCertificate.h" #include -#include #include +#include #include #include #include #include -#include - PinPopup::PinPopup(PinFlags flags, const SslCertificate &c, TokenFlags count, QWidget *parent) : PinPopup(flags, c.toString(c.showCN() ? QStringLiteral("CN, serialNumber") : QStringLiteral("GN SN, serialNumber")), count, parent) { @@ -49,18 +47,13 @@ PinPopup::PinPopup(PinFlags flags, const QString &title, TokenFlags count, QWidg { ui->setupUi(this); setWindowFlags( Qt::Dialog | Qt::FramelessWindowHint ); - setFixedSize( size() ); for(QLineEdit *w: findChildren()) w->setAttribute(Qt::WA_MacShowFocusRect, false); - QFont regular = Styles::font( Styles::Regular, 14 ); - QFont condensed14 = Styles::font( Styles::Condensed, 14 ); - ui->labelNameId->setFont(Styles::font(Styles::Regular, 20, QFont::DemiBold)); - ui->label->setFont( regular ); - ui->ok->setFont( condensed14 ); - ui->cancel->setFont( condensed14 ); - ui->ok->setEnabled( false ); + ui->label->setFont(Styles::font(Styles::Regular, 14)); + ui->ok->setFont(Styles::font(Styles::Condensed, 14)); + ui->cancel->setFont(ui->ok->font()); connect( ui->ok, &QPushButton::clicked, this, &PinPopup::accept ); connect( ui->cancel, &QPushButton::clicked, this, &PinPopup::reject ); @@ -142,6 +135,7 @@ PinPopup::PinPopup(PinFlags flags, const QString &title, TokenFlags count, QWidg ui->label->setBuddy( ui->pin ); ui->ok->setDisabled(true); } + adjustSize(); } PinPopup::~PinPopup() diff --git a/client/dialogs/PinPopup.ui b/client/dialogs/PinPopup.ui index f4c8ec00d..c0749b155 100644 --- a/client/dialogs/PinPopup.ui +++ b/client/dialogs/PinPopup.ui @@ -2,145 +2,102 @@ PinPopup - - Qt::WindowModal - 0 0 - 507 - 232 + 495 + 220 - - - 0 - 0 - - - - - 507 - 232 - - - - - 507 - 300 - - - QDialog -{ + QDialog { border-radius: 2px; background-color: #FFFFFF; } - - - - 22 - 12 - 461 - 24 - - - - - 0 - 0 - - - - - 14 - - - - Qt::TabFocus - - - color: #041E42; border: none; - - - <b>Mari Maasikas,</b> 48405050123 - - - Qt::AlignCenter - - - - - - 25 - 49 - 456 - 51 - - - - - 0 - 0 - - - - - 456 - 35 - - - - - 456 - 60 - - - - Qt::TabFocus - - - color: #000000; + + + 20 + + + 20 + + + 10 + + + 20 + + + 30 + + + + + + 0 + 24 + + + + + 14 + + + + Qt::TabFocus + + + color: #041E42; border: none; + + + <b>Mari Maasikas,</b> 48405050123 + + + Qt::AlignCenter + + + + + + + Qt::TabFocus + + + color: #000000; line-height: 15px; border: none; - - - You need to use a personal identification certificate for the selected activity. Enter PIN1 to use the certificate - - - Qt::AlignCenter - - - true - - - pin - - - - - - 182 - 122 - 141 - 30 - - - - - 123 - 30 - - - - - 11 - - - - QLineEdit + + + You need to use a personal identification certificate for the selected activity. Enter PIN1 to use the certificate + + + Qt::AlignCenter + + + true + + + pin + + + + + + + + 141 + 30 + + + + + 11 + + + + QLineEdit { padding: 0px 10px; border: 1px solid #DEE4E9; @@ -150,42 +107,53 @@ color: #000000; line-height: 9px; text-align: center; } - - - QLineEdit::Password - - - Qt::AlignCenter - - - - - - 126 - 172 - 120 - 32 - - - - - 120 - 30 - - - - - 14 - - - - PointingHandCursor - - - Cancel - - - QPushButton { + + + QLineEdit::Password + + + Qt::AlignCenter + + + + + + + 15 + + + 100 + + + 100 + + + + + + 120 + 32 + + + + + 120 + 16777215 + + + + + 14 + + + + PointingHandCursor + + + Cancel + + + QPushButton { border-radius: 2px; border: none; color: #ffffff; @@ -197,39 +165,39 @@ QPushButton:pressed { QPushButton:hover:!pressed { background-color: #CD2541; } - - - CANCEL - - - false - - - - - false - - - - 261 - 172 - 120 - 32 - - - - - 120 - 30 - - - - - 14 - - - - QPushButton { + + + CANCEL + + + false + + + + + + + false + + + + 120 + 32 + + + + + 120 + 16777215 + + + + + 14 + + + + QPushButton { border-radius: 2px; border: none; color: #ffffff; @@ -244,14 +212,18 @@ QPushButton:hover:!pressed { QPushButton:disabled { background-color: #BEDBED; } - - - OK - - - true - - + + + OK + + + true + + + + + +