mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-04 15:39:34 +01:00
Fix pre-release issues with attachment viewer (#12244)
* Fix translation issues for "FIT" and "New Attachment" in attachment editor * Fix markdown preview persistence and enable external links in attachment editor * Update preview panel if manually moved from collapsed position * Match edit view scroll position (by percentage) when changed. This ensures the preview remains in relative sync with the edited document, for example when a large amount of HTML reduces down to a short preview document. * Fix default preview size to be half the width of the edit widget. * Set tab stop to 10 and remove base ui file --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Jonathan White <support@dmapps.us>
This commit is contained in:
@@ -50,10 +50,18 @@ void TestTextAttachmentsWidget::testTextReadWriteWidget()
|
||||
QCOMPARE(attachments.name, Test.name);
|
||||
QCOMPARE(attachments.data, Test.data);
|
||||
|
||||
// Find preview widget and verify that it is in collapsed state
|
||||
auto previewWidget = qobject_cast<TextAttachmentsPreviewWidget*>(splitter->widget(1));
|
||||
QVERIFY(previewWidget);
|
||||
attachments = previewWidget->getAttachment();
|
||||
QCOMPARE(previewWidget->width(), 0);
|
||||
|
||||
// Show the preview widget
|
||||
QTest::mouseClick(m_textWidget->findChild<QPushButton*>("previewPushButton"), Qt::LeftButton);
|
||||
QCoreApplication::processEvents();
|
||||
QVERIFY(previewWidget->width() > 0);
|
||||
|
||||
// Verify attachment data has been loaded in the preview
|
||||
attachments = previewWidget->getAttachment();
|
||||
QCOMPARE(attachments.name, Test.name);
|
||||
QCOMPARE(attachments.data, Test.data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user