mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-27 16:32:20 -07:00
Resize when expanding section
Took 4 minutes Took 3 minutes Took 7 minutes
This commit is contained in:
parent
16f792d071
commit
08c37316ad
2 changed files with 20 additions and 0 deletions
|
|
@ -12,6 +12,7 @@
|
|||
#include <QPushButton>
|
||||
#include <QSettings>
|
||||
#include <QSpinBox>
|
||||
#include <QTimer>
|
||||
#include <QUrl>
|
||||
#include <QVBoxLayout>
|
||||
#include <libcockatrice/card/database/card_database_manager.h>
|
||||
|
|
@ -198,6 +199,22 @@ void CardDatabaseSetupPage::onToggleAdvanced(bool open)
|
|||
advancedToggleButton->setText(open ? tr("▼ Advanced: custom download source")
|
||||
: tr("▶ Advanced: custom download source"));
|
||||
advancedPanel->setVisible(open);
|
||||
|
||||
QWidget *wizardWindow = window();
|
||||
if (!wizardWindow) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (open) {
|
||||
windowSizeBeforeExpansion = wizardWindow->size();
|
||||
QTimer::singleShot(0, this, [wizardWindow] {
|
||||
wizardWindow->resize(wizardWindow->size().expandedTo(wizardWindow->sizeHint()));
|
||||
});
|
||||
} else {
|
||||
QTimer::singleShot(0, this, [this, wizardWindow] {
|
||||
wizardWindow->resize(wizardWindow->size().boundedTo(windowSizeBeforeExpansion));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void CardDatabaseSetupPage::onApplyCustomUrl()
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
#include "../first_run_wizard_page.h"
|
||||
|
||||
#include <QSize>
|
||||
|
||||
class QComboBox;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
|
|
@ -71,6 +73,7 @@ private:
|
|||
QSpinBox *checkIntervalSpinBox;
|
||||
|
||||
State state = State::NotStarted;
|
||||
QSize windowSizeBeforeExpansion;
|
||||
};
|
||||
|
||||
#endif // CARD_DATABASE_SETUP_PAGE_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue