diff --git a/src/gui/dbsettings/DatabaseSettingsDialog.cpp b/src/gui/dbsettings/DatabaseSettingsDialog.cpp index 32a9b74c2..53561e663 100644 --- a/src/gui/dbsettings/DatabaseSettingsDialog.cpp +++ b/src/gui/dbsettings/DatabaseSettingsDialog.cpp @@ -38,6 +38,8 @@ #include "core/Resources.h" #include "touchid/TouchID.h" +#include + class DatabaseSettingsDialog::ExtraPage { public: @@ -81,7 +83,16 @@ DatabaseSettingsDialog::DatabaseSettingsDialog(QWidget* parent) m_ui->stackedWidget->addWidget(m_generalWidget); m_ui->stackedWidget->addWidget(m_securityTabWidget); - m_securityTabWidget->addTab(m_databaseKeyWidget, tr("Database Credentials")); + + auto* scrollArea = new QScrollArea(parent); + scrollArea->setFrameShape(QFrame::NoFrame); + scrollArea->setFrameShadow(QFrame::Plain); + scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + scrollArea->setSizeAdjustPolicy(QScrollArea::AdjustToContents); + scrollArea->setWidgetResizable(true); + scrollArea->setWidget(m_databaseKeyWidget); + m_securityTabWidget->addTab(scrollArea, tr("Database Credentials")); + m_securityTabWidget->addTab(m_encryptionWidget, tr("Encryption Settings")); #if defined(WITH_XC_KEESHARE) diff --git a/src/gui/dbsettings/DatabaseSettingsWidgetDatabaseKey.cpp b/src/gui/dbsettings/DatabaseSettingsWidgetDatabaseKey.cpp index 2d733d06d..b59f2d266 100644 --- a/src/gui/dbsettings/DatabaseSettingsWidgetDatabaseKey.cpp +++ b/src/gui/dbsettings/DatabaseSettingsWidgetDatabaseKey.cpp @@ -216,8 +216,6 @@ void DatabaseSettingsWidgetDatabaseKey::setAdditionalKeyOptionsVisible(bool show { m_additionalKeyOptionsToggle->setVisible(!show); m_additionalKeyOptions->setVisible(show); - m_additionalKeyOptions->layout()->setSizeConstraint(QLayout::SetMinimumSize); - emit sizeChanged(); } bool DatabaseSettingsWidgetDatabaseKey::addToCompositeKey(KeyComponentWidget* widget, diff --git a/src/gui/wizard/NewDatabaseWizardPage.cpp b/src/gui/wizard/NewDatabaseWizardPage.cpp index 5b64a6b3d..c0c9401c7 100644 --- a/src/gui/wizard/NewDatabaseWizardPage.cpp +++ b/src/gui/wizard/NewDatabaseWizardPage.cpp @@ -47,11 +47,7 @@ NewDatabaseWizardPage::~NewDatabaseWizardPage() void NewDatabaseWizardPage::setPageWidget(DatabaseSettingsWidget* page) { m_pageWidget = page; - if (!m_ui->pageContentLayout->isEmpty()) { - delete m_ui->pageContentLayout->takeAt(0); - } - m_ui->pageContentLayout->addWidget(m_pageWidget); - m_ui->pageContentLayout->setSizeConstraint(QLayout::SetMinimumSize); + m_ui->pageContent->setWidget(m_pageWidget); m_ui->advancedSettingsButton->setVisible(m_pageWidget->hasAdvancedMode()); } diff --git a/src/gui/wizard/NewDatabaseWizardPage.ui b/src/gui/wizard/NewDatabaseWizardPage.ui index e920b26ed..a91b653d0 100644 --- a/src/gui/wizard/NewDatabaseWizardPage.ui +++ b/src/gui/wizard/NewDatabaseWizardPage.ui @@ -2,6 +2,14 @@ NewDatabaseWizardPage + + + 0 + 0 + 578 + 410 + + 0 @@ -17,9 +25,52 @@ Here you can adjust the database encryption settings. Don't worry, you can change them later in the database settings. - + - + + + + 0 + 0 + + + + + 560 + 300 + + + + QScrollArea { background: transparent; } +QScrollArea > QWidget > QWidget { background: transparent; } +QScrollArea > QWidget > QScrollBar { background: 1; } + + + QFrame::NoFrame + + + QFrame::Plain + + + Qt::ScrollBarAlwaysOff + + + QAbstractScrollArea::AdjustToContents + + + true + + + + + 0 + 0 + 560 + 349 + + + + @@ -29,7 +80,7 @@ 20 - 15 + 6 diff --git a/src/gui/wizard/NewDatabaseWizardPageDatabaseKey.cpp b/src/gui/wizard/NewDatabaseWizardPageDatabaseKey.cpp index 3180400c0..a71b3f6c8 100644 --- a/src/gui/wizard/NewDatabaseWizardPageDatabaseKey.cpp +++ b/src/gui/wizard/NewDatabaseWizardPageDatabaseKey.cpp @@ -26,16 +26,8 @@ NewDatabaseWizardPageDatabaseKey::NewDatabaseWizardPageDatabaseKey(QWidget* pare setTitle(tr("Database Credentials")); setSubTitle(tr("A set of credentials known only to you that protects your database.")); - - connect(pageWidget(), SIGNAL(sizeChanged()), SLOT(updateWindowSize())); } NewDatabaseWizardPageDatabaseKey::~NewDatabaseWizardPageDatabaseKey() { } - -void NewDatabaseWizardPageDatabaseKey::updateWindowSize() -{ - // ugly workaround for QWizard not managing to react to size changes automatically - window()->adjustSize(); -} diff --git a/src/gui/wizard/NewDatabaseWizardPageDatabaseKey.h b/src/gui/wizard/NewDatabaseWizardPageDatabaseKey.h index e0fb5349e..7b6980f3e 100644 --- a/src/gui/wizard/NewDatabaseWizardPageDatabaseKey.h +++ b/src/gui/wizard/NewDatabaseWizardPageDatabaseKey.h @@ -28,9 +28,6 @@ public: explicit NewDatabaseWizardPageDatabaseKey(QWidget* parent = nullptr); Q_DISABLE_COPY(NewDatabaseWizardPageDatabaseKey); ~NewDatabaseWizardPageDatabaseKey() override; - -private slots: - void updateWindowSize(); }; #endif // KEEPASSXC_NEWDATABASEWIZARDPAGEDATABASEKEY_H