diff --git a/src/gui/EntryPreviewWidget.cpp b/src/gui/EntryPreviewWidget.cpp index 5693d424f..1b5c6efcd 100644 --- a/src/gui/EntryPreviewWidget.cpp +++ b/src/gui/EntryPreviewWidget.cpp @@ -30,6 +30,8 @@ #include "keeshare/KeeShareSettings.h" #endif +#include + namespace { constexpr int GeneralTabIndex = 0; @@ -286,17 +288,20 @@ void EntryPreviewWidget::setPasswordVisible(bool state) html += "" + QString(c).toHtmlEscaped() + ""; } // clang-format on - m_ui->entryPasswordLabel->setHtml(html); + m_ui->entryPasswordLabel->setText(html); } else { // No color - m_ui->entryPasswordLabel->setPlainText(password); + m_ui->entryPasswordLabel->setText(password); } } else if (password.isEmpty() && !config()->get(Config::Security_PasswordEmptyPlaceholder).toBool()) { - m_ui->entryPasswordLabel->setPlainText(""); + m_ui->entryPasswordLabel->setText(""); } else { - m_ui->entryPasswordLabel->setPlainText(QString("\u25cf").repeated(6)); + m_ui->entryPasswordLabel->setText(QString("\u25cf").repeated(6)); } + m_ui->passwordScrollArea->setMaximumHeight(m_ui->entryPasswordLabel->sizeHint().height() + + m_ui->passwordScrollArea->horizontalScrollBar()->sizeHint().height()); + m_ui->togglePasswordButton->setIcon(icons()->onOffIcon("password-show", state)); } diff --git a/src/gui/EntryPreviewWidget.ui b/src/gui/EntryPreviewWidget.ui index c251da3f5..322b6ef74 100644 --- a/src/gui/EntryPreviewWidget.ui +++ b/src/gui/EntryPreviewWidget.ui @@ -177,7 +177,7 @@ - 2 + 0 false @@ -195,7 +195,7 @@ - + 0 @@ -214,6 +214,148 @@ 6 + + + + + + + + + + 14 + 14 + + + + true + + + + + + + QFrame::NoFrame + + + QFrame::Plain + + + Qt::ScrollBarAlwaysOff + + + QAbstractScrollArea::AdjustToContents + + + true + + + + + 0 + 0 + 157 + 63 + + + + + 6 + + + 0 + + + 0 + + + 0 + + + + + TextLabel + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + + + + + + + + 0 + 0 + + + + + 150 + 0 + + + + PointingHandCursor + + + Qt::ClickFocus + + + https://example.com + + + Qt::TextBrowserInteraction + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + + 0 + 0 + + + + + 75 + true + + + + Qt::LeftToRight + + + Username + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + @@ -259,173 +401,6 @@ - - - - - 0 - 0 - - - - - 75 - true - - - - Password - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 75 - true - - - - URL - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - Qt::ClickFocus - - - expired - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - - - - - 0 - 0 - - - - - 75 - true - - - - Expiration - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - 6 - - - - - - - - - 14 - 14 - - - - true - - - - - - - - 150 - 0 - - - - - 16777215 - 30 - - - - Qt::ClickFocus - - - QFrame::NoFrame - - - QFrame::Plain - - - 0 - - - Qt::ScrollBarAlwaysOff - - - true - - - false - - - QTextEdit::NoWrap - - - true - - - - - @@ -448,107 +423,6 @@ - - - - Qt::ClickFocus - - - Tags list - - - - - - - - 0 - 0 - - - - - 150 - 0 - - - - PointingHandCursor - - - Qt::ClickFocus - - - https://example.com - - - Qt::TextBrowserInteraction - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - - - - - 0 - 0 - - - - - 75 - true - - - - Qt::LeftToRight - - - Username - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 75 - true - - - - Notes - - - Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing - - - @@ -600,6 +474,139 @@ + + + + Qt::ClickFocus + + + Tags list + + + + + + + + 0 + 0 + + + + Qt::ClickFocus + + + expired + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + + 0 + 0 + + + + + 75 + true + + + + Password + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 75 + true + + + + Notes + + + Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing + + + + + + + + 0 + 0 + + + + + 75 + true + + + + Expiration + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 75 + true + + + + URL + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + +