From 96b869b151a0dab32e346afc564d9841a2d77ab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfram=20R=C3=B6sler?= Date: Thu, 30 Apr 2020 19:35:34 +0200 Subject: [PATCH] Show larger icon in the entry preview pane Previously 16x16, now 48x48. --- src/gui/EntryPreviewWidget.cpp | 12 ++---------- src/gui/EntryPreviewWidget.h | 1 - 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/gui/EntryPreviewWidget.cpp b/src/gui/EntryPreviewWidget.cpp index f0301017c5..76bc8e752c 100644 --- a/src/gui/EntryPreviewWidget.cpp +++ b/src/gui/EntryPreviewWidget.cpp @@ -160,7 +160,7 @@ void EntryPreviewWidget::updateEntryHeaderLine() Q_ASSERT(m_currentEntry); const QString title = m_currentEntry->resolveMultiplePlaceholders(m_currentEntry->title()); m_ui->entryTitleLabel->setRawText(hierarchy(m_currentEntry->group(), title)); - m_ui->entryIcon->setPixmap(preparePixmap(m_currentEntry->iconPixmap(), 16)); + m_ui->entryIcon->setPixmap(m_currentEntry->iconPixmap(48)); } void EntryPreviewWidget::updateEntryTotp() @@ -313,7 +313,7 @@ void EntryPreviewWidget::updateGroupHeaderLine() { Q_ASSERT(m_currentGroup); m_ui->groupTitleLabel->setRawText(hierarchy(m_currentGroup, {})); - m_ui->groupIcon->setPixmap(preparePixmap(m_currentGroup->iconPixmap(), 32)); + m_ui->groupIcon->setPixmap(m_currentGroup->iconPixmap(48)); } void EntryPreviewWidget::updateGroupGeneralTab() @@ -397,14 +397,6 @@ void EntryPreviewWidget::setTabEnabled(QTabWidget* tabWidget, QWidget* widget, b tabWidget->setTabEnabled(tabIndex, enabled); } -QPixmap EntryPreviewWidget::preparePixmap(const QPixmap& pixmap, int size) -{ - if (pixmap.width() > size || pixmap.height() > size) { - return pixmap.scaled(size, size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); - } - return pixmap; -} - QString EntryPreviewWidget::hierarchy(const Group* group, const QString& title) { const QString separator("] > ["); diff --git a/src/gui/EntryPreviewWidget.h b/src/gui/EntryPreviewWidget.h index e1a7aff387..17bd62eb67 100644 --- a/src/gui/EntryPreviewWidget.h +++ b/src/gui/EntryPreviewWidget.h @@ -72,7 +72,6 @@ private slots: void removeTab(QTabWidget* tabWidget, QWidget* widget); void setTabEnabled(QTabWidget* tabWidget, QWidget* widget, bool enabled); - static QPixmap preparePixmap(const QPixmap& pixmap, int size); static QString hierarchy(const Group* group, const QString& title); const QScopedPointer m_ui;