mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-04 15:39:34 +01:00
Fix rendering & and " in preview panel
* Set plain text mode on elements that should never have styling * Revert html escaping as a prior fix
This commit is contained in:
@@ -245,7 +245,7 @@ void EntryPreviewWidget::updateEntryHeaderLine()
|
|||||||
{
|
{
|
||||||
Q_ASSERT(m_currentEntry);
|
Q_ASSERT(m_currentEntry);
|
||||||
const QString title = m_currentEntry->resolveMultiplePlaceholders(m_currentEntry->title());
|
const QString title = m_currentEntry->resolveMultiplePlaceholders(m_currentEntry->title());
|
||||||
m_ui->entryTitleLabel->setRawText(hierarchy(m_currentEntry->group(), title.toHtmlEscaped()));
|
m_ui->entryTitleLabel->setRawText(hierarchy(m_currentEntry->group(), title));
|
||||||
m_ui->entryIcon->setPixmap(Icons::entryIconPixmap(m_currentEntry, IconSize::Large));
|
m_ui->entryIcon->setPixmap(Icons::entryIconPixmap(m_currentEntry, IconSize::Large));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -302,10 +302,12 @@ void EntryPreviewWidget::setPasswordVisible(bool state)
|
|||||||
html += "<span style=\"color: " + QString(color) + ";\">" + QString(c).toHtmlEscaped() + "</span>";
|
html += "<span style=\"color: " + QString(color) + ";\">" + QString(c).toHtmlEscaped() + "</span>";
|
||||||
}
|
}
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
m_ui->entryPasswordLabel->setTextFormat(Qt::RichText);
|
||||||
m_ui->entryPasswordLabel->setText(html);
|
m_ui->entryPasswordLabel->setText(html);
|
||||||
} else {
|
} else {
|
||||||
// No color
|
// No color
|
||||||
m_ui->entryPasswordLabel->setText(password.toHtmlEscaped());
|
m_ui->entryPasswordLabel->setTextFormat(Qt::PlainText);
|
||||||
|
m_ui->entryPasswordLabel->setText(password);
|
||||||
}
|
}
|
||||||
} else if (password.isEmpty() && !config()->get(Config::Security_PasswordEmptyPlaceholder).toBool()) {
|
} else if (password.isEmpty() && !config()->get(Config::Security_PasswordEmptyPlaceholder).toBool()) {
|
||||||
m_ui->entryPasswordLabel->setText("");
|
m_ui->entryPasswordLabel->setText("");
|
||||||
|
|||||||
@@ -100,7 +100,7 @@
|
|||||||
<enum>Qt::ClickFocus</enum>
|
<enum>Qt::ClickFocus</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="textFormat">
|
<property name="textFormat">
|
||||||
<enum>Qt::AutoText</enum>
|
<enum>Qt::PlainText</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="textInteractionFlags">
|
<property name="textInteractionFlags">
|
||||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||||
@@ -279,6 +279,9 @@
|
|||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="entryPasswordLabel">
|
<widget class="QLabel" name="entryPasswordLabel">
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::ClickFocus</enum>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string notr="true">TextLabel</string>
|
<string notr="true">TextLabel</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -316,6 +319,9 @@
|
|||||||
<property name="text">
|
<property name="text">
|
||||||
<string notr="true">https://example.com</string>
|
<string notr="true">https://example.com</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::RichText</enum>
|
||||||
|
</property>
|
||||||
<property name="textInteractionFlags">
|
<property name="textInteractionFlags">
|
||||||
<set>Qt::TextBrowserInteraction</set>
|
<set>Qt::TextBrowserInteraction</set>
|
||||||
</property>
|
</property>
|
||||||
@@ -504,6 +510,9 @@
|
|||||||
<property name="text">
|
<property name="text">
|
||||||
<string notr="true">expired</string>
|
<string notr="true">expired</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::PlainText</enum>
|
||||||
|
</property>
|
||||||
<property name="textInteractionFlags">
|
<property name="textInteractionFlags">
|
||||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
Reference in New Issue
Block a user