From a5f3d032c8b65eaaa3569c2df52923082c036228 Mon Sep 17 00:00:00 2001 From: Raul Metsma Date: Mon, 25 Nov 2024 11:11:16 +0200 Subject: [PATCH] Update AddressItem UI Signed-off-by: Raul Metsma --- client/images/icon_download.svg | 13 +- client/images/icon_download_hover.svg | 12 -- client/images/icon_download_pressed.svg | 12 -- client/images/icon_remove.svg | 14 +-- client/images/icon_remove_hover.svg | 13 -- client/images/icon_remove_pressed.svg | 13 -- client/images/images.qrc | 4 - client/translations/en.ts | 10 -- client/translations/et.ts | 10 -- client/translations/ru.ts | 10 -- client/widgets/AddressItem.cpp | 5 +- client/widgets/AddressItem.h | 1 - client/widgets/AddressItem.ui | 158 +++++++++++------------- client/widgets/FileItem.cpp | 8 +- client/widgets/FileItem.ui | 61 +++++---- client/widgets/FileList.cpp | 8 +- client/widgets/ItemList.ui | 46 +++---- client/widgets/LabelButton.cpp | 6 - client/widgets/LabelButton.h | 2 - client/widgets/SignatureItem.cpp | 5 +- client/widgets/SignatureItem.ui | 38 +++--- 21 files changed, 160 insertions(+), 289 deletions(-) delete mode 100644 client/images/icon_download_hover.svg delete mode 100644 client/images/icon_download_pressed.svg delete mode 100644 client/images/icon_remove_hover.svg delete mode 100644 client/images/icon_remove_pressed.svg diff --git a/client/images/icon_download.svg b/client/images/icon_download.svg index 62afabf30..9239dcf42 100644 --- a/client/images/icon_download.svg +++ b/client/images/icon_download.svg @@ -1,12 +1,3 @@ - - - - icon_download - - - - - - - + + \ No newline at end of file diff --git a/client/images/icon_download_hover.svg b/client/images/icon_download_hover.svg deleted file mode 100644 index 48a32280d..000000000 --- a/client/images/icon_download_hover.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - icon_download hover - - - - - - - - \ No newline at end of file diff --git a/client/images/icon_download_pressed.svg b/client/images/icon_download_pressed.svg deleted file mode 100644 index cc7397c60..000000000 --- a/client/images/icon_download_pressed.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - icon_download hover - - - - - - - - \ No newline at end of file diff --git a/client/images/icon_remove.svg b/client/images/icon_remove.svg index b9bf28bcc..818ad53d4 100644 --- a/client/images/icon_remove.svg +++ b/client/images/icon_remove.svg @@ -1,13 +1,3 @@ - - - - icon_remove - - - - - - - - + + \ No newline at end of file diff --git a/client/images/icon_remove_hover.svg b/client/images/icon_remove_hover.svg deleted file mode 100644 index 460c54b8a..000000000 --- a/client/images/icon_remove_hover.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - icon_remove hover - - - - - - - - - \ No newline at end of file diff --git a/client/images/icon_remove_pressed.svg b/client/images/icon_remove_pressed.svg deleted file mode 100644 index 3acabc02a..000000000 --- a/client/images/icon_remove_pressed.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - icon_remove hover - - - - - - - - - \ No newline at end of file diff --git a/client/images/images.qrc b/client/images/images.qrc index 74dbadf06..8355e5942 100644 --- a/client/images/images.qrc +++ b/client/images/images.qrc @@ -29,9 +29,7 @@ icon_checkbox_check_disabled.svg icon_checkbox_check_hover.svg icon_digitempel.svg - icon_download_hover.svg icon_download.svg - icon_download_pressed.svg icon_Edit_hover.svg icon_Edit_pressed.svg icon_Edit.svg @@ -55,9 +53,7 @@ icon_radio_check_active.svg icon_radio_check_disabled.svg icon_radio_check_hover.svg - icon_remove_hover.svg icon_remove.svg - icon_remove_pressed.svg icon_Seaded.svg icon_Seaded_hover.svg intro_crypto-select_en.png diff --git a/client/translations/en.ts b/client/translations/en.ts index aa26b4f41..366e46bc7 100644 --- a/client/translations/en.ts +++ b/client/translations/en.ts @@ -99,14 +99,6 @@ AddressItem - - ADD - ADD - - - ADDED - ADDED - (Yourself) (Yourself) @@ -129,12 +121,10 @@ Added - accessible Added Add - accessible Add diff --git a/client/translations/et.ts b/client/translations/et.ts index 0ffb8974b..06f7af1cf 100644 --- a/client/translations/et.ts +++ b/client/translations/et.ts @@ -99,14 +99,6 @@ AddressItem - - ADD - LISA - - - ADDED - LISATUD - (Yourself) (Sina ise) @@ -129,12 +121,10 @@ Added - accessible Lisatud Add - accessible Lisa diff --git a/client/translations/ru.ts b/client/translations/ru.ts index 068d2b5e7..e73ddc48f 100644 --- a/client/translations/ru.ts +++ b/client/translations/ru.ts @@ -99,14 +99,6 @@ AddressItem - - ADD - ДОБАВИТЬ - - - ADDED - Добавлен - (Yourself) (Вы сами) @@ -129,12 +121,10 @@ Added - accessible Добавлен Add - accessible Добавить diff --git a/client/widgets/AddressItem.cpp b/client/widgets/AddressItem.cpp index 48794f136..2d06df9a0 100644 --- a/client/widgets/AddressItem.cpp +++ b/client/widgets/AddressItem.cpp @@ -51,11 +51,8 @@ AddressItem::AddressItem(CKey k, QWidget *parent, bool showIcon) ui->idType->setFont(Styles::font(Styles::Regular, 11)); ui->idType->installEventFilter(this); - ui->remove->setIcons(QStringLiteral("/images/icon_remove.svg"), QStringLiteral("/images/icon_remove_hover.svg"), - QStringLiteral("/images/icon_remove_pressed.svg"), 17, 17); - ui->remove->init(LabelButton::White); connect(ui->add, &QToolButton::clicked, this, [this]{ emit add(this);}); - connect(ui->remove, &LabelButton::clicked, this, [this]{ emit remove(this);}); + connect(ui->remove, &QToolButton::clicked, this, [this]{ emit remove(this);}); ui->add->setFont(Styles::font(Styles::Condensed, 12)); ui->added->setFont(ui->add->font()); diff --git a/client/widgets/AddressItem.h b/client/widgets/AddressItem.h index 54d3788db..9f04c09f4 100644 --- a/client/widgets/AddressItem.h +++ b/client/widgets/AddressItem.h @@ -30,7 +30,6 @@ class AddressItem final : public Item public: enum ShowToolButton { - None, Remove, Add, Added, diff --git a/client/widgets/AddressItem.ui b/client/widgets/AddressItem.ui index 9f641e565..e32d134a0 100644 --- a/client/widgets/AddressItem.ui +++ b/client/widgets/AddressItem.ui @@ -6,38 +6,41 @@ 0 0 - 633 - 44 + 619 + 52 - - - 0 - 44 - - - - - 14 - false - false - false - - PointingHandCursor - #AddressItem { -border: solid rgba(217, 217, 216, 0.45); -border-width: 0px 0px 1px 0px; + QWidget { +font-family: Roboto, Helvetica; +font-size: 12px; +} +#AddressItem { +border-bottom: 1px solid rgba(217, 217, 216, 0.45); background-color: #FFFFFF; -color: #000000; } #AddressItem:disabled { -background-color: #F0F0F0; +background-color: #F0F0F2; +} +#name { +color: #07142A; +font-size: 14px; +font-weight: 700; +} +#idType { +color: #07142A; +} +#expire { +color: #07142A; +background: #F3F5F7; +padding: 2px 8px; +border-radius: 8px; } QToolButton { +font-weight: 700; border-radius: 2px; border: none; color: #006EB5; @@ -56,22 +59,22 @@ color: #727679; - 0 + 8 - 5 + 8 - 0 + 8 - 7 + 8 8 - 0 + 2 @@ -87,26 +90,12 @@ color: #727679; 32 - - border: none; - - + - - - Roboto - 14 - false - false - - - Qt::TabFocus - - - border: none; + Qt::FocusPolicy::TabFocus MARI MAASIKAS MUSTIKAS 48405050123 (Sina ise) @@ -118,47 +107,42 @@ color: #727679; - - - Roboto - 11 - false - false - - - Qt::TabFocus - - - color: #727679;border: none; + Qt::FocusPolicy::TabFocus ID-card - - - + + + + Expire + + + + + + + Qt::Orientation::Horizontal + + - 19 - 19 + 40 + 20 + + + + - 19 - 19 + 24 + 24 - - - Roboto - 14 - false - false - - PointingHandCursor @@ -166,14 +150,21 @@ color: #727679; Remove - border: none; background-color: none; + border: none; background: none; - - + + + :/images/icon_remove.svg:/images/icon_remove.svg + + + + 20 + 20 + - + false @@ -190,15 +181,12 @@ color: #727679; 25 - - Added - - ADDED + Added - + @@ -215,22 +203,14 @@ color: #727679; PointingHandCursor - - Add - - ADD + Add - - LabelButton - QToolButton -
widgets/LabelButton.h
-
QSvgWidget QWidget @@ -238,6 +218,8 @@ color: #727679; 1
- + + + diff --git a/client/widgets/FileItem.cpp b/client/widgets/FileItem.cpp index 0b1a5473d..8864ab362 100644 --- a/client/widgets/FileItem.cpp +++ b/client/widgets/FileItem.cpp @@ -30,16 +30,12 @@ FileItem::FileItem(QString file, ContainerState state, QWidget *parent) { ui->setupUi(this); ui->fileName->setFont(Styles::font(Styles::Regular, 14)); - ui->download->setIcons(QStringLiteral("/images/icon_download.svg"), QStringLiteral("/images/icon_download_hover.svg"), QStringLiteral("/images/icon_download_pressed.svg"), 17, 17); - ui->download->init(LabelButton::White); - ui->remove->setIcons(QStringLiteral("/images/icon_remove.svg"), QStringLiteral("/images/icon_remove_hover.svg"), QStringLiteral("/images/icon_remove_pressed.svg"), 17, 17); - ui->remove->init(LabelButton::White); stateChange(state); connect(ui->fileName, &QToolButton::clicked, this, [this]{ emit open(this); setUnderline(false); }); - connect(ui->download, &LabelButton::clicked, this, [this]{ emit download(this); setUnderline(false); }); - connect(ui->remove, &LabelButton::clicked, this, [this]{ emit remove(this);}); + connect(ui->download, &QToolButton::clicked, this, [this]{ emit download(this); setUnderline(false); }); + connect(ui->remove, &QToolButton::clicked, this, [this]{ emit remove(this);}); setFileName(); } diff --git a/client/widgets/FileItem.ui b/client/widgets/FileItem.ui index c1bac4d24..a6393d9ac 100644 --- a/client/widgets/FileItem.ui +++ b/client/widgets/FileItem.ui @@ -67,17 +67,11 @@ text-align: left; - - - - 19 - 19 - - + - 19 - 19 + 24 + 24 @@ -86,20 +80,27 @@ text-align: left; Remove file - - - - - + + border: none + + + + :/images/icon_remove.svg:/images/icon_remove.svg + + - 19 - 19 + 20 + 20 + + + + - 19 - 19 + 24 + 24 @@ -108,17 +109,25 @@ text-align: left; Download file + + border: none + + + + :/images/icon_download.svg:/images/icon_download.svg + + + + 20 + 20 + + - - - LabelButton - QToolButton -
widgets/LabelButton.h
-
-
- + + + diff --git a/client/widgets/FileList.cpp b/client/widgets/FileList.cpp index d1068ca55..1d6bc0adf 100644 --- a/client/widgets/FileList.cpp +++ b/client/widgets/FileList.cpp @@ -22,7 +22,6 @@ #include "dialogs/FileDialog.h" #include "dialogs/WarningDialog.h" -#include "effects/ButtonHoverFilter.h" #include "widgets/FileItem.h" #include @@ -39,13 +38,8 @@ using namespace ria::qdigidoc4; FileList::FileList(QWidget *parent) : ItemList(parent) { - ui->download->setIcons(QStringLiteral("/images/icon_download.svg"), QStringLiteral("/images/icon_download_hover.svg"), - QStringLiteral("/images/icon_download_pressed.svg"), 17, 17); - ui->download->init(LabelButton::White); - ui->download->installEventFilter( - new ButtonHoverFilter(QStringLiteral(":/images/icon_download.svg"), QStringLiteral(":/images/icon_download_hover.svg"), this)); connect(ui->add, &LabelButton::clicked, this, &FileList::selectFile); - connect(ui->download, &LabelButton::clicked, this, &FileList::saveAll); + connect(ui->download, &QToolButton::clicked, this, &FileList::saveAll); } void FileList::addFile( const QString& file ) diff --git a/client/widgets/ItemList.ui b/client/widgets/ItemList.ui index 064af4a56..d0cc5fcfb 100644 --- a/client/widgets/ItemList.ui +++ b/client/widgets/ItemList.ui @@ -34,16 +34,16 @@ QScrollBar::sub-line:vertical { } - QFrame::NoFrame + QFrame::Shape::NoFrame - Qt::ScrollBarAlwaysOff + Qt::ScrollBarPolicy::ScrollBarAlwaysOff true - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop @@ -62,7 +62,7 @@ border-width: 0px 0px 1px 0px; - 4 + 0 20 @@ -106,10 +106,10 @@ border-width: 0px 0px 1px 0px; - Qt::Horizontal + Qt::Orientation::Horizontal - QSizePolicy::Preferred + QSizePolicy::Policy::Preferred @@ -122,7 +122,7 @@ border-width: 0px 0px 1px 0px; - Qt::Horizontal + Qt::Orientation::Horizontal @@ -141,7 +141,7 @@ border-width: 0px 0px 1px 0px; - Qt::TabFocus + Qt::FocusPolicy::TabFocus color: #041E42; @@ -150,7 +150,7 @@ border-width: 0px 0px 1px 0px; 0 - Qt::AlignCenter + Qt::AlignmentFlag::AlignCenter @@ -228,22 +228,16 @@ border-width: 0px 0px 1px 0px; 1 - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter - - - - 19 - 19 - - + - 19 - 19 + 24 + 24 @@ -255,6 +249,16 @@ border-width: 0px 0px 1px 0px; border: none; + + + :/images/icon_download.svg:/images/icon_download.svg + + + + 20 + 20 + + @@ -272,13 +276,13 @@ border-width: 0px 0px 1px 0px; 0 - 0 + 8 0 - 0 + 8 diff --git a/client/widgets/LabelButton.cpp b/client/widgets/LabelButton.cpp index 03fc66980..2a72cde7f 100644 --- a/client/widgets/LabelButton.cpp +++ b/client/widgets/LabelButton.cpp @@ -74,12 +74,6 @@ void LabelButton::init(Style style, const QString &label) styleTemplate.arg(DEEP_CERULEAN, WHITE, none, QString()), styleTemplate.arg(CURIOUS_BLUE, WHITE, none, QString())); break; - case White: // Add files - setStyle( - QStringLiteral("border: none; background-color: none;"), - QStringLiteral("border: none; background-color: none;"), - QStringLiteral("border: none; background-color: none;")); - break; default: break; } } diff --git a/client/widgets/LabelButton.h b/client/widgets/LabelButton.h index f89dffde8..ea6ea3068 100644 --- a/client/widgets/LabelButton.h +++ b/client/widgets/LabelButton.h @@ -33,8 +33,6 @@ class LabelButton : public QToolButton BoxedMojo, BoxedDeepCeruleanWithCuriousBlue, // Edit DeepCeruleanWithLochmara, // Add files - White, - None }; explicit LabelButton(QWidget *parent = nullptr); diff --git a/client/widgets/SignatureItem.cpp b/client/widgets/SignatureItem.cpp index d3142d2b7..540c129e6 100644 --- a/client/widgets/SignatureItem.cpp +++ b/client/widgets/SignatureItem.cpp @@ -61,11 +61,8 @@ SignatureItem::SignatureItem(DigiDocSignature s, ContainerState /*state*/, QWidg ui->idSignTime->installEventFilter(this); ui->role->setFont(Styles::font(Styles::Regular, 11)); ui->role->installEventFilter(this); - ui->remove->setIcons(QStringLiteral("/images/icon_remove.svg"), QStringLiteral("/images/icon_remove_hover.svg"), - QStringLiteral("/images/icon_remove_pressed.svg"), 17, 17); - ui->remove->init(LabelButton::White); ui->remove->setVisible(ui->signature.container()->isSupported()); - connect(ui->remove, &LabelButton::clicked, this, [this]{ + connect(ui->remove, &QToolButton::clicked, this, [this]{ const SslCertificate c = ui->signature.cert(); auto *dlg = new WarningDialog(tr("Remove signature %1?") .arg(c.toString(c.showCN() ? QStringLiteral("CN serialNumber") : QStringLiteral("GN SN serialNumber"))), this); diff --git a/client/widgets/SignatureItem.ui b/client/widgets/SignatureItem.ui index 88582b097..6dc92476c 100644 --- a/client/widgets/SignatureItem.ui +++ b/client/widgets/SignatureItem.ui @@ -67,7 +67,7 @@ background-color: #ffffff; - Qt::TabFocus + Qt::FocusPolicy::TabFocus To view signature details press enter or space @@ -92,7 +92,7 @@ background-color: #ffffff; Role / Resolution - Qt::PlainText + Qt::TextFormat::PlainText @@ -113,17 +113,11 @@ background-color: #ffffff; - - - - 19 - 19 - - + - 19 - 19 + 24 + 24 @@ -132,6 +126,19 @@ background-color: #ffffff; Remove signature + + border: none + + + + :/images/icon_remove.svg:/images/icon_remove.svg + + + + 20 + 20 + + @@ -143,12 +150,9 @@ background-color: #ffffff;
QtSvg/QSvgWidget
1 - - LabelButton - QToolButton -
widgets/LabelButton.h
-
- + + +