Use the shared layout helper in the token tabs

Replace the hand-built zero-margin layouts with QtUtils::makeLayout, which is the helper the printing selector already uses.
This commit is contained in:
Lukas Brübach 2026-11-10 09:59:15 +01:00
parent 177536b07a
commit 5f0e955644

View file

@ -38,6 +38,7 @@
#include <libcockatrice/settings/interface_settings.h> #include <libcockatrice/settings/interface_settings.h>
#include <libcockatrice/settings/layouts_settings.h> #include <libcockatrice/settings/layouts_settings.h>
#include <libcockatrice/utility/card_ref.h> #include <libcockatrice/utility/card_ref.h>
#include <libcockatrice/utility/qt_utils.h>
#include <libcockatrice/utility/string_limits.h> #include <libcockatrice/utility/string_limits.h>
#include <qnamespace.h> #include <qnamespace.h>
@ -156,16 +157,14 @@ DlgCreateToken::DlgCreateToken(const QStringList &_predefinedTokens, QWidget *pa
auto *tokenChoosePage = new QWidget; auto *tokenChoosePage = new QWidget;
tokenChoosePage->setObjectName("tokenChoosePage"); tokenChoosePage->setObjectName("tokenChoosePage");
auto *tokenChooseLayout = new QVBoxLayout(tokenChoosePage); auto *tokenChooseLayout = QtUtils::makeLayout<QVBoxLayout>(tokenChoosePage);
tokenChooseLayout->setContentsMargins(0, 0, 0, 0);
tokenChooseLayout->addWidget(chooseTokenFromAllRadioButton); tokenChooseLayout->addWidget(chooseTokenFromAllRadioButton);
tokenChooseLayout->addWidget(chooseTokenFromDeckRadioButton); tokenChooseLayout->addWidget(chooseTokenFromDeckRadioButton);
tokenChooseLayout->addWidget(chooseTokenView); tokenChooseLayout->addWidget(chooseTokenView);
auto *printingsPage = new QWidget; auto *printingsPage = new QWidget;
printingsPage->setObjectName("tokenPrintingsPage"); printingsPage->setObjectName("tokenPrintingsPage");
auto *printingsLayout = new QVBoxLayout(printingsPage); auto *printingsLayout = QtUtils::makeLayout<QVBoxLayout>(printingsPage);
printingsLayout->setContentsMargins(0, 0, 0, 0);
printingSelector = new PrintingSelector(printingsPage, &printingSelectorHost); printingSelector = new PrintingSelector(printingsPage, &printingSelectorHost);
printingSelector->setObjectName("tokenPrintingSelector"); printingSelector->setObjectName("tokenPrintingSelector");
printingsLayout->addWidget(printingSelector); printingsLayout->addWidget(printingSelector);