From dd4ff8c711b706d1a7b221ddc22177e953cce25d Mon Sep 17 00:00:00 2001 From: Raul Metsma Date: Mon, 25 Jul 2022 08:20:16 +0300 Subject: [PATCH] Fix CardWidget click area (#1096) IB-7439 Signed-off-by: Raul Metsma --- client/widgets/CardWidget.cpp | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/client/widgets/CardWidget.cpp b/client/widgets/CardWidget.cpp index 691747f87..e89a447fc 100644 --- a/client/widgets/CardWidget.cpp +++ b/client/widgets/CardWidget.cpp @@ -99,8 +99,6 @@ bool CardWidget::event( QEvent *ev ) bool CardWidget::eventFilter(QObject *o, QEvent *e) { - if(o != ui->cardPhoto) - return StyledWidget::eventFilter(o, e); switch(e->type()) { case QEvent::MouseButtonRelease: @@ -111,11 +109,12 @@ bool CardWidget::eventFilter(QObject *o, QEvent *e) } break; case QEvent::HoverEnter: - if(!ui->cardPhoto->pixmap() && !seal) + if(o == ui->cardPhoto && !ui->cardPhoto->pixmap() && !seal) ui->load->show(); break; case QEvent::HoverLeave: - ui->load->hide(); + if(o == ui->cardPhoto) + ui->load->hide(); break; default: break; } @@ -156,17 +155,8 @@ void CardWidget::update(const TokenData &token, bool multiple) ui->cardStatus->setText(typeString); ui->cardIcon->load(QStringLiteral(":/images/icon_IDkaart_green.svg")); - - if(c.type() & SslCertificate::EResidentSubType) - { - ui->horizontalSpacer->changeSize(1, 20, QSizePolicy::Fixed); - ui->cardPhoto->hide(); - } - else - { - ui->horizontalSpacer->changeSize(10, 20, QSizePolicy::Fixed); - ui->cardPhoto->show(); - } + ui->cardPhoto->setHidden(c.type() & SslCertificate::EResidentSubType); + ui->horizontalSpacer->changeSize(ui->cardPhoto->isVisible() ? 10 : 1, 20, QSizePolicy::Fixed); clearSeal(); if(type & SslCertificate::TempelType)