mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
[QtUtils] Use makeLayout() for zero-margin layouts (#7620)
* [QtUtils] Add parent lookup, layout clearing, scroll area and monospace helpers * [QtUtils] Adopt shared Qt helpers across the client * [QtUtils] Add layout creation and relayout helpers * Swap parameter order (spacing before margin) and remove static from relayout() * [QtUtils] Use relayout() after rebuilding dynamic layouts * [QtUtils] Use makeLayout() for zero-margin layouts * Consolidate setSpacing() calls into makeLayout() using new parameter order --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
06b9ca368f
commit
e806085681
56 changed files with 116 additions and 175 deletions
|
|
@ -23,9 +23,7 @@
|
|||
ColorIdentityWidget::ColorIdentityWidget(QWidget *parent, const QString &_colorIdentity)
|
||||
: QWidget(parent), colorIdentity(_colorIdentity)
|
||||
{
|
||||
layout = new QHBoxLayout(this);
|
||||
layout->setSpacing(5); // Small spacing between icons
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout = QtUtils::makeLayout<QHBoxLayout>(this, 5);
|
||||
layout->setAlignment(Qt::AlignCenter); // Ensure icons are centered
|
||||
setLayout(layout);
|
||||
|
||||
|
|
|
|||
|
|
@ -11,12 +11,11 @@
|
|||
#include <QResizeEvent>
|
||||
#include <QSize>
|
||||
#include <QtGlobal>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
|
||||
ManaCostWidget::ManaCostWidget(QWidget *parent, CardInfoPtr _card) : QWidget(parent), card(_card)
|
||||
{
|
||||
layout = new QHBoxLayout(this);
|
||||
layout->setSpacing(5); // Small spacing between icons
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout = QtUtils::makeLayout<QHBoxLayout>(this, 5);
|
||||
setLayout(layout);
|
||||
|
||||
setFixedHeight(50); // Fixed height
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
#include <QString>
|
||||
#include <QVBoxLayout>
|
||||
#include <libcockatrice/card/database/card_database_manager.h>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
|
||||
class QWidget;
|
||||
|
||||
|
|
@ -30,9 +31,8 @@ CardInfoDisplayWidget::CardInfoDisplayWidget(const CardRef &cardRef, QWidget *pa
|
|||
text->setObjectName("text");
|
||||
connect(text, &CardInfoTextWidget::linkActivated, this, [this](const QString &card) { setCard({card}); });
|
||||
|
||||
auto *layout = new QVBoxLayout();
|
||||
auto *layout = QtUtils::makeLayout<QVBoxLayout>();
|
||||
layout->setObjectName("layout");
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->setSpacing(0);
|
||||
layout->addWidget(pic, 0, Qt::AlignCenter);
|
||||
layout->addWidget(text, 0, Qt::AlignCenter);
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
#include <libcockatrice/card/relation/card_relation.h>
|
||||
#include <libcockatrice/settings/cards_display_settings.h>
|
||||
#include <libcockatrice/utility/card_ref.h>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <qnamespace.h>
|
||||
|
||||
struct CardRef;
|
||||
|
|
@ -49,15 +50,13 @@ CardInfoFrameWidget::CardInfoFrameWidget(QWidget *parent)
|
|||
insertTab(ImageAndTextView, tab3, QString());
|
||||
connect(this, &CardInfoFrameWidget::currentChanged, this, &CardInfoFrameWidget::setViewMode);
|
||||
|
||||
tab1Layout = new QVBoxLayout();
|
||||
tab1Layout = QtUtils::makeLayout<QVBoxLayout>();
|
||||
tab1Layout->setObjectName("tab1Layout");
|
||||
tab1Layout->setContentsMargins(0, 0, 0, 0);
|
||||
tab1Layout->setSpacing(0);
|
||||
tab1->setLayout(tab1Layout);
|
||||
|
||||
tab2Layout = new QVBoxLayout();
|
||||
tab2Layout = QtUtils::makeLayout<QVBoxLayout>();
|
||||
tab2Layout->setObjectName("tab2Layout");
|
||||
tab2Layout->setContentsMargins(0, 0, 0, 0);
|
||||
tab2Layout->setSpacing(0);
|
||||
tab2->setLayout(tab2Layout);
|
||||
|
||||
|
|
@ -65,9 +64,8 @@ CardInfoFrameWidget::CardInfoFrameWidget(QWidget *parent)
|
|||
splitter->setObjectName("splitter");
|
||||
splitter->setOrientation(Qt::Vertical);
|
||||
|
||||
tab3Layout = new QVBoxLayout();
|
||||
tab3Layout = QtUtils::makeLayout<QVBoxLayout>();
|
||||
tab3Layout->setObjectName("tab3Layout");
|
||||
tab3Layout->setContentsMargins(0, 0, 0, 0);
|
||||
tab3Layout->setSpacing(0);
|
||||
tab3Layout->addWidget(splitter);
|
||||
tab3->setLayout(tab3Layout);
|
||||
|
|
|
|||
|
|
@ -16,14 +16,13 @@
|
|||
#include <QVBoxLayout>
|
||||
#include <QVector>
|
||||
#include <algorithm>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
|
||||
constexpr int MIN_ROW_HEIGHT = 100; // Minimum readable height per row
|
||||
|
||||
ManaCurveCategoryWidget::ManaCurveCategoryWidget(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
layout = new QVBoxLayout(this);
|
||||
layout->setSpacing(4);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout = QtUtils::makeLayout<QVBoxLayout>(this, 0, 4);
|
||||
|
||||
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
||||
}
|
||||
|
|
@ -95,9 +94,7 @@ void ManaCurveCategoryWidget::updateDisplay(int minCmc,
|
|||
|
||||
row->setFixedHeight(MIN_ROW_HEIGHT);
|
||||
|
||||
QHBoxLayout *rowLayout = new QHBoxLayout(row);
|
||||
rowLayout->setContentsMargins(0, 0, 0, 0);
|
||||
rowLayout->setSpacing(4);
|
||||
QHBoxLayout *rowLayout = QtUtils::makeLayout<QHBoxLayout>(row, 4);
|
||||
|
||||
QLabel *categoryLabel = new QLabel(cat, row);
|
||||
categoryLabel->setFixedWidth(80);
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include <QTimer>
|
||||
#include <QVBoxLayout>
|
||||
#include <QtGlobal>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <qnamespace.h>
|
||||
|
||||
ResizablePanel::ResizablePanel(const QString &_typeId, AbstractAnalyticsPanelWidget *analyticsPanel, QWidget *parent)
|
||||
|
|
@ -35,18 +36,14 @@ ResizablePanel::ResizablePanel(const QString &_typeId, AbstractAnalyticsPanelWid
|
|||
{
|
||||
setAcceptDrops(true);
|
||||
|
||||
auto *mainLayout = new QVBoxLayout(this);
|
||||
mainLayout->setContentsMargins(0, 0, 0, 0);
|
||||
mainLayout->setSpacing(0);
|
||||
auto *mainLayout = QtUtils::makeLayout<QVBoxLayout>(this, 0);
|
||||
|
||||
// Frame for selection highlight
|
||||
frame = new QFrame(this);
|
||||
frame->setFrameShape(QFrame::Box);
|
||||
frame->setLineWidth(2);
|
||||
|
||||
auto *frameLayout = new QVBoxLayout(frame);
|
||||
frameLayout->setContentsMargins(0, 0, 0, 0);
|
||||
frameLayout->setSpacing(0);
|
||||
auto *frameLayout = QtUtils::makeLayout<QVBoxLayout>(frame, 0);
|
||||
|
||||
// Add the analytics panel
|
||||
frameLayout->addWidget(analyticsPanel);
|
||||
|
|
@ -63,9 +60,7 @@ ResizablePanel::ResizablePanel(const QString &_typeId, AbstractAnalyticsPanelWid
|
|||
|
||||
// Bottom bar with drag button and resize handle
|
||||
auto *bottomBar = new QWidget(frame);
|
||||
auto *bottomLayout = new QHBoxLayout(bottomBar);
|
||||
bottomLayout->setContentsMargins(0, 0, 0, 0);
|
||||
bottomLayout->setSpacing(0);
|
||||
auto *bottomLayout = QtUtils::makeLayout<QHBoxLayout>(bottomBar, 0);
|
||||
|
||||
// Drag button on the left
|
||||
dragButton = new QPushButton("☰", bottomBar);
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include <QVBoxLayout>
|
||||
#include <QVariant>
|
||||
#include <QWidget>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <qnamespace.h>
|
||||
|
||||
DeckEditorFilterDockWidget::DeckEditorFilterDockWidget(AbstractTabDeckEditor *parent)
|
||||
|
|
@ -80,9 +81,8 @@ void DeckEditorFilterDockWidget::createFiltersDock()
|
|||
filterDelAll->setDefaultAction(aClearFilterAll);
|
||||
filterDelAll->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
|
||||
|
||||
auto *filterLayout = new QGridLayout;
|
||||
auto *filterLayout = QtUtils::makeLayout<QGridLayout>();
|
||||
filterLayout->setObjectName("filterLayout");
|
||||
filterLayout->setContentsMargins(0, 0, 0, 0);
|
||||
filterLayout->addWidget(filterBuilder, 0, 0, 1, 3);
|
||||
filterLayout->addWidget(filterView, 1, 0, 1, 3);
|
||||
filterLayout->addWidget(filterDelOne, 2, 0, 1, 1);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
#include <QStringLiteral>
|
||||
#include <QVBoxLayout>
|
||||
#include <libcockatrice/card/database/card_database_querier.h>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <qnamespace.h>
|
||||
|
||||
SharedDeckPreviewWidget::SharedDeckPreviewWidget(QWidget *parent,
|
||||
|
|
@ -62,8 +63,7 @@ SharedDeckPreviewWidget::SharedDeckPreviewWidget(QWidget *parent,
|
|||
selectionRow->addWidget(selectionCheckBox);
|
||||
selectionRow->addStretch(1);
|
||||
|
||||
auto *layout = new QVBoxLayout(this);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
auto *layout = QtUtils::makeLayout<QVBoxLayout>(this);
|
||||
layout->addLayout(selectionRow);
|
||||
layout->addWidget(bannerCardDisplayWidget, 0, Qt::AlignHCenter);
|
||||
layout->addWidget(colorIdentityWidget, 0, Qt::AlignHCenter);
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
#include <QVBoxLayout>
|
||||
#include <QWidget>
|
||||
#include <libcockatrice/settings/visual_deck_storage_settings.h>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
|
||||
DlgDefaultTagsEditor::DlgDefaultTagsEditor(QWidget *parent) : QDialog(parent)
|
||||
{
|
||||
|
|
@ -120,8 +121,7 @@ void DlgDefaultTagsEditor::addItem()
|
|||
// Add new tag
|
||||
auto *item = new QListWidgetItem(listWidget);
|
||||
QWidget *widget = new QWidget(this);
|
||||
QHBoxLayout *layout = new QHBoxLayout(widget);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
QHBoxLayout *layout = QtUtils::makeLayout<QHBoxLayout>(widget);
|
||||
|
||||
// Editable tag label
|
||||
QLineEdit *lineEdit = new QLineEdit(newTag, this);
|
||||
|
|
|
|||
|
|
@ -84,8 +84,7 @@ DlgSelectSetForCards::DlgSelectSetForCards(QWidget *parent, DeckStateManager *de
|
|||
|
||||
// Left container
|
||||
QWidget *leftContainer = new QWidget(this);
|
||||
QVBoxLayout *leftLayout = new QVBoxLayout(leftContainer);
|
||||
leftLayout->setContentsMargins(0, 0, 0, 0);
|
||||
QVBoxLayout *leftLayout = QtUtils::makeLayout<QVBoxLayout>(leftContainer);
|
||||
|
||||
uneditedCardsLabel = new QLabel(this);
|
||||
uneditedCardsArea = QtUtils::makeScrollArea(this);
|
||||
|
|
@ -100,8 +99,7 @@ DlgSelectSetForCards::DlgSelectSetForCards(QWidget *parent, DeckStateManager *de
|
|||
|
||||
// Right container
|
||||
QWidget *rightContainer = new QWidget(this);
|
||||
QVBoxLayout *rightLayout = new QVBoxLayout(rightContainer);
|
||||
rightLayout->setContentsMargins(0, 0, 0, 0);
|
||||
QVBoxLayout *rightLayout = QtUtils::makeLayout<QVBoxLayout>(rightContainer);
|
||||
|
||||
modifiedCardsLabel = new QLabel(this);
|
||||
modifiedCardsArea = QtUtils::makeScrollArea(this);
|
||||
|
|
|
|||
|
|
@ -48,8 +48,7 @@ FlowWidget::FlowWidget(QWidget *parent,
|
|||
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
|
||||
}
|
||||
|
||||
mainLayout = new QHBoxLayout(this);
|
||||
mainLayout->setContentsMargins(0, 0, 0, 0);
|
||||
mainLayout = QtUtils::makeLayout<QHBoxLayout>(this);
|
||||
setLayout(mainLayout);
|
||||
|
||||
const bool useScrollArea = (horizontalPolicy != Qt::ScrollBarAlwaysOff || verticalPolicy != Qt::ScrollBarAlwaysOff);
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
#include <QPushButton>
|
||||
#include <QStackedWidget>
|
||||
#include <QVBoxLayout>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <qnamespace.h>
|
||||
#include <utility>
|
||||
|
||||
|
|
@ -51,8 +52,7 @@ FirstRunWizard::FirstRunWizard(QWidget *parent) : QDialog(parent)
|
|||
connect(skipButton, &QPushButton::clicked, this, &FirstRunWizard::skip);
|
||||
connect(nextButton, &QPushButton::clicked, this, &FirstRunWizard::goNext);
|
||||
|
||||
auto *headerLayout = new QVBoxLayout;
|
||||
headerLayout->setContentsMargins(0, 0, 0, 0);
|
||||
auto *headerLayout = QtUtils::makeLayout<QVBoxLayout>();
|
||||
headerLayout->addWidget(bannerHost);
|
||||
headerLayout->addSpacing(12);
|
||||
headerLayout->addWidget(titleLabel);
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
#include <QString>
|
||||
#include <QUrl>
|
||||
#include <QtGlobal>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <qmath.h>
|
||||
#include <qnamespace.h>
|
||||
#include <qnumeric.h>
|
||||
|
|
@ -151,8 +152,7 @@ BannerHost::BannerHost(QWidget *parent) : QWidget(parent)
|
|||
{
|
||||
setFixedHeight(150);
|
||||
|
||||
stack = new QStackedLayout(this);
|
||||
stack->setContentsMargins(0, 0, 0, 0);
|
||||
stack = QtUtils::makeLayout<QStackedLayout>(this);
|
||||
|
||||
fallback = new GradientFallbackWidget(this);
|
||||
stack->addWidget(fallback);
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
#include <QVariant>
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <qnamespace.h>
|
||||
|
||||
class QModelIndex;
|
||||
|
|
@ -42,9 +43,7 @@ CardAmountWidget::CardAmountWidget(QWidget *parent,
|
|||
: QWidget(parent), deckStateManager(deckStateManager), cardSizeSlider(cardSizeSlider), rootCard(rootCard),
|
||||
zoneName(zoneName), hovered(false)
|
||||
{
|
||||
layout = new QHBoxLayout(this);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->setSpacing(10);
|
||||
layout = QtUtils::makeLayout<QHBoxLayout>(this, 10);
|
||||
this->setLayout(layout);
|
||||
this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
||||
layout->setAlignment(Qt::AlignHCenter);
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#include <QVBoxLayout>
|
||||
#include <libcockatrice/settings/cards_display_settings.h>
|
||||
#include <libcockatrice/utility/macros.h>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <qnamespace.h>
|
||||
|
||||
/**
|
||||
|
|
@ -84,9 +85,7 @@ PrintingSelector::PrintingSelector(QWidget *parent, AbstractTabDeckEditor *_deck
|
|||
displayOptionsWidget->addSettingsWidget(cardSizeWidget);
|
||||
|
||||
sortAndOptionsContainer = new QWidget(this);
|
||||
sortAndOptionsLayout = new QHBoxLayout(sortAndOptionsContainer);
|
||||
sortAndOptionsLayout->setSpacing(3);
|
||||
sortAndOptionsLayout->setContentsMargins(0, 0, 0, 0);
|
||||
sortAndOptionsLayout = QtUtils::makeLayout<QHBoxLayout>(sortAndOptionsContainer, 0, 3);
|
||||
sortAndOptionsContainer->setLayout(sortAndOptionsLayout);
|
||||
|
||||
searchBar = new PrintingSelectorCardSearchWidget(this);
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
#include <libcockatrice/card/database/card_database_manager.h>
|
||||
#include <libcockatrice/card/relation/card_relation.h>
|
||||
#include <libcockatrice/settings/card_override_settings.h>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <qnamespace.h>
|
||||
|
||||
class DeckStateManager;
|
||||
|
|
@ -108,9 +109,7 @@ PrintingSelectorCardOverlayWidget::PrintingSelectorCardOverlayWidget(QWidget *pa
|
|||
: QWidget(parent), deckEditor(_deckEditor), rootCard(_rootCard)
|
||||
{
|
||||
// Set up the main layout
|
||||
auto *mainLayout = new QVBoxLayout(this);
|
||||
mainLayout->setContentsMargins(0, 0, 0, 0);
|
||||
mainLayout->setSpacing(0);
|
||||
auto *mainLayout = QtUtils::makeLayout<QVBoxLayout>(this, 0);
|
||||
setLayout(mainLayout);
|
||||
|
||||
// Add CardInfoPictureWidget
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
#include <QRect>
|
||||
#include <QSizePolicy>
|
||||
#include <QVBoxLayout>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <qnamespace.h>
|
||||
|
||||
/**
|
||||
|
|
@ -19,8 +20,7 @@ SetNameAndCollectorsNumberDisplayWidget::SetNameAndCollectorsNumberDisplayWidget
|
|||
: QWidget(parent)
|
||||
{
|
||||
// Set up the layout for the widget
|
||||
layout = new QVBoxLayout(this);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout = QtUtils::makeLayout<QVBoxLayout>(this);
|
||||
layout->setSpacing(1);
|
||||
setLayout(layout);
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
#include <QSizePolicy>
|
||||
#include <QStringLiteral>
|
||||
#include <QToolButton>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <qnamespace.h>
|
||||
|
||||
SettingsButtonWidget::SettingsButtonWidget(QWidget *parent)
|
||||
|
|
@ -26,9 +27,8 @@ SettingsButtonWidget::SettingsButtonWidget(QWidget *parent)
|
|||
connect(button, &QToolButton::clicked, this, &SettingsButtonWidget::togglePopup);
|
||||
connect(popup, &SettingsPopupWidget::aboutToClose, this, &SettingsButtonWidget::onPopupClosed);
|
||||
|
||||
layout = new QHBoxLayout(this);
|
||||
layout = QtUtils::makeLayout<QHBoxLayout>(this);
|
||||
layout->addWidget(button);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
setLayout(layout);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#include <QtGlobal>
|
||||
#include <libcockatrice/settings/interface_settings.h>
|
||||
#include <libcockatrice/settings/personal_settings.h>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
|
||||
ReplayQuickSettingsWidget::ReplayQuickSettingsWidget(QWidget *parent) : SettingsButtonWidget(parent)
|
||||
{
|
||||
|
|
@ -28,8 +29,7 @@ ReplayQuickSettingsWidget::ReplayQuickSettingsWidget(QWidget *parent) : Settings
|
|||
|
||||
// putting it all together
|
||||
auto *widget = new QWidget;
|
||||
auto *grid = new QGridLayout(widget);
|
||||
grid->setContentsMargins(0, 0, 0, 0);
|
||||
auto *grid = QtUtils::makeLayout<QGridLayout>(widget);
|
||||
grid->addWidget(&fastForwardSpeedLabel, 0, 0, 1, 1);
|
||||
grid->addWidget(&fastForwardSpeedBox, 0, 1, 1, 1);
|
||||
grid->addWidget(&skipEmptyCheckBox, 1, 0, 1, 2);
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#include <QString>
|
||||
#include <QVariant>
|
||||
#include <QtGlobal>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
|
||||
class TabSupervisor;
|
||||
template <class Key, class T> class QMap;
|
||||
|
|
@ -24,8 +25,7 @@ GameSelectorQuickFilterToolBar::GameSelectorQuickFilterToolBar(QWidget *parent,
|
|||
const QMap<int, QString> &allGameTypes)
|
||||
: QWidget(parent), tabSupervisor(_tabSupervisor), model(_model)
|
||||
{
|
||||
mainLayout = new QHBoxLayout(this);
|
||||
mainLayout->setContentsMargins(0, 0, 0, 0);
|
||||
mainLayout = QtUtils::makeLayout<QHBoxLayout>(this);
|
||||
mainLayout->setSpacing(5);
|
||||
|
||||
const GameFilterConfigs &filters = model->getFilters();
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#include <libcockatrice/protocol/pb/session_commands.pb.h>
|
||||
#include <libcockatrice/protocol/pending_command.h>
|
||||
#include <libcockatrice/utility/passwordhasher.h>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <string>
|
||||
#include <sys/types.h>
|
||||
|
||||
|
|
@ -53,8 +54,7 @@ UserInfoBox::UserInfoBox(AbstractClient *_client, bool _editable, QWidget *paren
|
|||
avatarPic.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
avatarPic.setAlignment(Qt::AlignCenter);
|
||||
|
||||
auto *avatarLayout = new QHBoxLayout;
|
||||
avatarLayout->setContentsMargins(0, 0, 0, 0);
|
||||
auto *avatarLayout = QtUtils::makeLayout<QHBoxLayout>();
|
||||
avatarLayout->addStretch(1);
|
||||
avatarLayout->addWidget(&avatarPic, 3);
|
||||
avatarLayout->addStretch(1);
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@
|
|||
#include <libcockatrice/protocol/pb/response_get_games_of_user.pb.h>
|
||||
#include <libcockatrice/protocol/pending_command.h>
|
||||
#include <libcockatrice/utility/card_ref.h>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <qnumeric.h>
|
||||
#include <string>
|
||||
|
||||
|
|
@ -402,9 +403,7 @@ UserInfoPopup::UserInfoPopup(TabSupervisor *_ts,
|
|||
|
||||
void UserInfoPopup::buildUi()
|
||||
{
|
||||
auto *root = new QVBoxLayout(this);
|
||||
root->setContentsMargins(0, 0, 0, 0);
|
||||
root->setSpacing(0);
|
||||
auto *root = QtUtils::makeLayout<QVBoxLayout>(this, 0);
|
||||
|
||||
// Header
|
||||
header = new UserInfoHeaderWidget(this);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#include <QStringLiteral>
|
||||
#include <QVBoxLayout>
|
||||
#include <libcockatrice/settings/interface_settings.h>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
|
||||
namespace
|
||||
{
|
||||
|
|
@ -31,9 +32,7 @@ QString sectionKey(UserListWidget::Section section)
|
|||
UserListPanelWidget::UserListPanelWidget(TabSupervisor *_tabSupervisor, AbstractClient *_client, QWidget *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
auto *mainLayout = new QVBoxLayout(this);
|
||||
mainLayout->setContentsMargins(0, 0, 0, 0);
|
||||
mainLayout->setSpacing(2);
|
||||
auto *mainLayout = QtUtils::makeLayout<QVBoxLayout>(this, 2);
|
||||
|
||||
searchBar = new QLineEdit(this);
|
||||
searchBar->setClearButtonEnabled(true);
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
#include <libcockatrice/settings/interface_settings.h>
|
||||
#include <libcockatrice/settings/personal_settings.h>
|
||||
#include <libcockatrice/settings/visual_deck_storage_settings.h>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <qnamespace.h>
|
||||
|
||||
enum visualDeckStoragePromptForConversionIndex
|
||||
|
|
@ -248,8 +249,7 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
|||
|
||||
updateCommanderSpellbookUiState();
|
||||
|
||||
auto *labelLayout = new QHBoxLayout;
|
||||
labelLayout->setContentsMargins(0, 0, 0, 0);
|
||||
auto *labelLayout = QtUtils::makeLayout<QHBoxLayout>();
|
||||
labelLayout->addWidget(&commanderSpellbookIntegrationUseOfficialBracketNamesLabel);
|
||||
labelLayout->addWidget(&commanderSpellbookIntegrationUseOfficialBracketNamesExplainer);
|
||||
|
||||
|
|
|
|||
|
|
@ -238,7 +238,5 @@ void ArchidektApiResponseDeckDisplayWidget::constructZoneWidgetsFromDeckListMode
|
|||
void ArchidektApiResponseDeckDisplayWidget::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
QWidget::resizeEvent(event);
|
||||
layout->invalidate();
|
||||
layout->activate();
|
||||
layout->update();
|
||||
QtUtils::relayout(layout);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
#include <QVariant>
|
||||
#include <QWidget>
|
||||
#include <QtGlobal>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <qnamespace.h>
|
||||
#include <version_string.h>
|
||||
|
||||
|
|
@ -241,9 +242,7 @@ void ArchidektApiResponseDeckEntryDisplayWidget::updateScaledPreview()
|
|||
void ArchidektApiResponseDeckEntryDisplayWidget::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
QWidget::resizeEvent(event);
|
||||
layout->invalidate();
|
||||
layout->activate();
|
||||
layout->update();
|
||||
QtUtils::relayout(layout);
|
||||
}
|
||||
|
||||
void ArchidektApiResponseDeckEntryDisplayWidget::actRequestNavigationToDeck()
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkRequest>
|
||||
#include <QSlider>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <qnamespace.h>
|
||||
|
||||
ArchidektApiResponseDeckListingsDisplayWidget::ArchidektApiResponseDeckListingsDisplayWidget(
|
||||
|
|
@ -19,8 +20,7 @@ ArchidektApiResponseDeckListingsDisplayWidget::ArchidektApiResponseDeckListingsD
|
|||
CardSizeWidget *_cardSizeSlider)
|
||||
: QWidget(parent), cardSizeSlider(_cardSizeSlider)
|
||||
{
|
||||
layout = new QHBoxLayout(this);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout = QtUtils::makeLayout<QHBoxLayout>(this);
|
||||
setLayout(layout);
|
||||
|
||||
flowWidget = new FlowWidget(this, Qt::Horizontal, Qt::ScrollBarAlwaysOff, Qt::ScrollBarAsNeeded);
|
||||
|
|
@ -64,7 +64,5 @@ void ArchidektApiResponseDeckListingsDisplayWidget::append(const ArchidektDeckLi
|
|||
void ArchidektApiResponseDeckListingsDisplayWidget::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
QWidget::resizeEvent(event);
|
||||
layout->invalidate();
|
||||
layout->activate();
|
||||
layout->update();
|
||||
QtUtils::relayout(layout);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,9 +81,7 @@ void TabArchidekt::initializeUi()
|
|||
{
|
||||
// Main container
|
||||
container = new QWidget(this);
|
||||
mainLayout = new QVBoxLayout(container);
|
||||
mainLayout->setContentsMargins(0, 0, 0, 0);
|
||||
mainLayout->setSpacing(0);
|
||||
mainLayout = QtUtils::makeLayout<QVBoxLayout>(container, 0);
|
||||
|
||||
// Primary toolbar (most important filters)
|
||||
primaryToolbar = new QWidget(container);
|
||||
|
|
@ -106,9 +104,7 @@ void TabArchidekt::initializeUi()
|
|||
|
||||
// Color filter (inline)
|
||||
QWidget *colorWidget = new QWidget(primaryToolbar);
|
||||
QHBoxLayout *colorLayout = new QHBoxLayout(colorWidget);
|
||||
colorLayout->setContentsMargins(0, 0, 0, 0);
|
||||
colorLayout->setSpacing(2);
|
||||
QHBoxLayout *colorLayout = QtUtils::makeLayout<QHBoxLayout>(colorWidget, 2);
|
||||
|
||||
QString colorIdentity = "WUBRG";
|
||||
for (const QChar &color : colorIdentity) {
|
||||
|
|
@ -190,9 +186,7 @@ void TabArchidekt::initializeUi()
|
|||
scrollArea = QtUtils::makeScrollArea(container);
|
||||
|
||||
resultsContainer = new QWidget();
|
||||
resultsLayout = new QVBoxLayout(resultsContainer);
|
||||
resultsLayout->setContentsMargins(0, 0, 0, 0);
|
||||
resultsLayout->setSpacing(0);
|
||||
resultsLayout = QtUtils::makeLayout<QVBoxLayout>(resultsContainer, 0);
|
||||
|
||||
scrollArea->setWidget(resultsContainer);
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#include <QToolButton>
|
||||
#include <QVBoxLayout>
|
||||
#include <libcockatrice/settings/deck_editor_settings.h>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <qnamespace.h>
|
||||
|
||||
template <class T> class QSharedPointer;
|
||||
|
|
@ -44,8 +45,7 @@ CommanderBracketWidget::CommanderBracketWidget(QWidget *parent) : QWidget(parent
|
|||
|
||||
connect(bracketRefreshButton, &QToolButton::clicked, this, &CommanderBracketWidget::requestBracketEstimate);
|
||||
|
||||
auto *layout = new QGridLayout(this);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
auto *layout = QtUtils::makeLayout<QGridLayout>(this);
|
||||
layout->addWidget(bracketLabel, 0, 0);
|
||||
|
||||
auto *bracketRow = new QHBoxLayout;
|
||||
|
|
@ -110,8 +110,7 @@ bool CommanderBracketWidget::promptCommanderSpellbookIntegration()
|
|||
|
||||
// Create label + explainer button
|
||||
auto *labelWidget = new QWidget(&dialog);
|
||||
auto *labelLayout = new QHBoxLayout(labelWidget);
|
||||
labelLayout->setContentsMargins(0, 0, 0, 0);
|
||||
auto *labelLayout = QtUtils::makeLayout<QHBoxLayout>(labelWidget);
|
||||
|
||||
auto *namingLabel = new QLabel(tr("Bracket naming:"), labelWidget);
|
||||
auto *explainerButton = new QToolButton(labelWidget);
|
||||
|
|
|
|||
|
|
@ -107,9 +107,7 @@ void EdhrecCommanderApiResponseDisplayWidget::resizeEvent(QResizeEvent *event)
|
|||
{
|
||||
QWidget::resizeEvent(event);
|
||||
qDebug() << event->size();
|
||||
layout->invalidate();
|
||||
layout->activate();
|
||||
layout->update();
|
||||
QtUtils::relayout(layout);
|
||||
if (scrollArea && scrollArea->widget()) {
|
||||
scrollArea->widget()->resize(event->size());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,9 +43,7 @@ EdhrecTopCardsApiResponseDisplayWidget::EdhrecTopCardsApiResponseDisplayWidget(Q
|
|||
void EdhrecTopCardsApiResponseDisplayWidget::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
QWidget::resizeEvent(event);
|
||||
layout->invalidate();
|
||||
layout->activate();
|
||||
layout->update();
|
||||
QtUtils::relayout(layout);
|
||||
if (scrollArea && scrollArea->widget()) {
|
||||
scrollArea->widget()->resize(event->size());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,9 +48,7 @@ void EdhrecTopCommandersApiResponseDisplayWidget::resizeEvent(QResizeEvent *even
|
|||
{
|
||||
QWidget::resizeEvent(event);
|
||||
qDebug() << event->size();
|
||||
layout->invalidate();
|
||||
layout->activate();
|
||||
layout->update();
|
||||
QtUtils::relayout(layout);
|
||||
if (scrollArea && scrollArea->widget()) {
|
||||
scrollArea->widget()->resize(event->size());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,9 +43,7 @@ EdhrecTopTagsApiResponseDisplayWidget::EdhrecTopTagsApiResponseDisplayWidget(QWi
|
|||
void EdhrecTopTagsApiResponseDisplayWidget::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
QWidget::resizeEvent(event);
|
||||
layout->invalidate();
|
||||
layout->activate();
|
||||
layout->update();
|
||||
QtUtils::relayout(layout);
|
||||
if (scrollArea && scrollArea->widget()) {
|
||||
scrollArea->widget()->resize(event->size());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@
|
|||
#include <libcockatrice/settings/debug_settings.h>
|
||||
#include <libcockatrice/settings/interface_settings.h>
|
||||
#include <libcockatrice/settings/layouts_settings.h>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <libcockatrice/utility/string_limits.h>
|
||||
#include <qnamespace.h>
|
||||
#include <qobjectdefs.h>
|
||||
|
|
@ -1287,8 +1288,7 @@ void TabGame::createPlayAreaWidget(bool bReplay)
|
|||
connect(game->getGameEventHandler(), &GameEventHandler::arrowDeleted, scene, &GameScene::deleteArrow);
|
||||
gameView = new GameView(scene);
|
||||
|
||||
auto gamePlayAreaVBox = new QVBoxLayout;
|
||||
gamePlayAreaVBox->setContentsMargins(0, 0, 0, 0);
|
||||
auto gamePlayAreaVBox = QtUtils::makeLayout<QVBoxLayout>();
|
||||
gamePlayAreaVBox->addWidget(gameView);
|
||||
|
||||
gamePlayAreaWidget = new QWidget;
|
||||
|
|
@ -1320,8 +1320,7 @@ void TabGame::createDeckViewContainerWidget(bool bReplay)
|
|||
|
||||
deckViewContainerWidget = new QWidget();
|
||||
deckViewContainerWidget->setObjectName("deckViewContainerWidget");
|
||||
deckViewContainerLayout = new QVBoxLayout;
|
||||
deckViewContainerLayout->setContentsMargins(0, 0, 0, 0);
|
||||
deckViewContainerLayout = QtUtils::makeLayout<QVBoxLayout>();
|
||||
deckViewContainerWidget->setLayout(deckViewContainerLayout);
|
||||
}
|
||||
|
||||
|
|
@ -1336,8 +1335,7 @@ void TabGame::createCardInfoDock(bool bReplay)
|
|||
|
||||
cardInfoFrameWidget = new CardInfoFrameWidget();
|
||||
auto cardHInfoLayout = new QHBoxLayout;
|
||||
auto cardVInfoLayout = new QVBoxLayout;
|
||||
cardVInfoLayout->setContentsMargins(0, 0, 0, 0);
|
||||
auto cardVInfoLayout = QtUtils::makeLayout<QVBoxLayout>();
|
||||
cardVInfoLayout->addWidget(cardInfoFrameWidget);
|
||||
cardVInfoLayout->addLayout(cardHInfoLayout);
|
||||
|
||||
|
|
@ -1364,9 +1362,7 @@ void TabGame::createPlayerListDock(bool bReplay)
|
|||
playerListWidget->setFocusPolicy(Qt::NoFocus);
|
||||
|
||||
auto *playerListBox = new QWidget(this);
|
||||
auto *vbox = new QVBoxLayout(playerListBox);
|
||||
vbox->setContentsMargins(0, 0, 0, 0);
|
||||
vbox->setSpacing(0);
|
||||
auto *vbox = QtUtils::makeLayout<QVBoxLayout>(playerListBox, 0);
|
||||
|
||||
vbox->addWidget(playerListWidget);
|
||||
|
||||
|
|
@ -1391,8 +1387,7 @@ void TabGame::createPlayerListDock(bool bReplay)
|
|||
|
||||
void TabGame::createMessageDock(bool bReplay)
|
||||
{
|
||||
auto messageLogLayout = new QVBoxLayout;
|
||||
messageLogLayout->setContentsMargins(0, 0, 0, 0);
|
||||
auto messageLogLayout = QtUtils::makeLayout<QVBoxLayout>();
|
||||
|
||||
// clock
|
||||
if (!bReplay) {
|
||||
|
|
|
|||
|
|
@ -210,8 +210,7 @@ TabReport::TabReport(TabSupervisor *_tabSupervisor, AbstractClient *_client) : T
|
|||
sgLayout->addWidget(statsTrendLabel);
|
||||
sgLayout->addWidget(statsCategoriesLabel);
|
||||
sgLayout->addWidget(statsDetailText);
|
||||
auto *statsGroupLayout = new QVBoxLayout(statsGroup);
|
||||
statsGroupLayout->setContentsMargins(0, 0, 0, 0);
|
||||
auto *statsGroupLayout = QtUtils::makeLayout<QVBoxLayout>(statsGroup);
|
||||
statsGroupLayout->addWidget(statsContent);
|
||||
statsGroup->setChecked(true);
|
||||
connect(statsGroup, &QGroupBox::toggled, this, [this, statsContent](bool checked) {
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#include <libcockatrice/protocol/pb/response.pb.h>
|
||||
#include <libcockatrice/protocol/pending_command.h>
|
||||
#include <libcockatrice/settings/network_settings.h>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
|
|
@ -46,9 +47,7 @@ TabDeckStorageVisual::TabDeckStorageVisual(TabSupervisor *_tabSupervisor, Abstra
|
|||
});
|
||||
|
||||
auto *widget = new QWidget(this);
|
||||
auto *layout = new QVBoxLayout(widget);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->setSpacing(0);
|
||||
auto *layout = QtUtils::makeLayout<QVBoxLayout>(widget, 0);
|
||||
widget->setLayout(layout);
|
||||
this->setCentralWidget(widget);
|
||||
layout->addWidget(visualDeckStorageWidget);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
#include <QPushButton>
|
||||
#include <QStringLiteral>
|
||||
#include <QToolTip>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
|
||||
SequenceEdit::SequenceEdit(const QString &_shortcutName, QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
|
|
@ -26,9 +27,7 @@ SequenceEdit::SequenceEdit(const QString &_shortcutName, QWidget *parent) : QWid
|
|||
clearButton->setIcon(themePixmap(QStringLiteral("icons/clearsearch")));
|
||||
defaultButton->setIcon(themePixmap(QStringLiteral("icons/update")));
|
||||
|
||||
auto *layout = new QHBoxLayout(this);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->setSpacing(1);
|
||||
auto *layout = QtUtils::makeLayout<QHBoxLayout>(this, 1);
|
||||
layout->addWidget(lineEdit);
|
||||
layout->addWidget(clearButton);
|
||||
layout->addWidget(defaultButton);
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#include <QVariant>
|
||||
#include <QWidget>
|
||||
#include <QtGlobal>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <qnamespace.h>
|
||||
|
||||
class DeckListModel;
|
||||
|
|
@ -110,14 +111,10 @@ VisualDatabaseDisplayFilterToolbarWidget::VisualDatabaseDisplayFilterToolbarWidg
|
|||
|
||||
void VisualDatabaseDisplayFilterToolbarWidget::initialize()
|
||||
{
|
||||
auto sortLayout = new QHBoxLayout(sortGroupBox);
|
||||
sortLayout->setContentsMargins(0, 0, 0, 0);
|
||||
sortLayout->setSpacing(0);
|
||||
auto sortLayout = QtUtils::makeLayout<QHBoxLayout>(sortGroupBox, 0);
|
||||
sortLayout->setAlignment(Qt::AlignLeft);
|
||||
|
||||
auto filterLayout = new QHBoxLayout(filterGroupBox);
|
||||
filterLayout->setContentsMargins(0, 0, 0, 0);
|
||||
filterLayout->setSpacing(2);
|
||||
auto filterLayout = QtUtils::makeLayout<QHBoxLayout>(filterGroupBox, 2);
|
||||
filterLayout->setAlignment(Qt::AlignLeft);
|
||||
|
||||
// create settings widgets
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
#include <algorithm>
|
||||
#include <libcockatrice/card/database/card_database_manager.h>
|
||||
#include <libcockatrice/filters/filter_tree.h>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <limits>
|
||||
#include <qnamespace.h>
|
||||
|
||||
|
|
@ -48,8 +49,7 @@ VisualDatabaseDisplayFormatLegalityFilterWidget::VisualDatabaseDisplayFormatLega
|
|||
layout->addWidget(flowWidget);
|
||||
|
||||
// Create a container for the threshold control
|
||||
auto *thresholdLayout = new QHBoxLayout();
|
||||
thresholdLayout->setContentsMargins(0, 0, 0, 0);
|
||||
auto *thresholdLayout = QtUtils::makeLayout<QHBoxLayout>();
|
||||
|
||||
thresholdLabel = new QLabel(this);
|
||||
thresholdLayout->addWidget(thresholdLabel);
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#include <QtGlobal>
|
||||
#include <libcockatrice/card/database/card_database_manager.h>
|
||||
#include <libcockatrice/filters/filter_tree.h>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <qnamespace.h>
|
||||
|
||||
VisualDatabaseDisplayMainTypeFilterWidget::VisualDatabaseDisplayMainTypeFilterWidget(QWidget *parent,
|
||||
|
|
@ -42,8 +43,7 @@ VisualDatabaseDisplayMainTypeFilterWidget::VisualDatabaseDisplayMainTypeFilterWi
|
|||
layout->addWidget(flowWidget);
|
||||
|
||||
// Create a container for the threshold control
|
||||
auto *thresholdLayout = new QHBoxLayout();
|
||||
thresholdLayout->setContentsMargins(0, 0, 0, 0);
|
||||
auto *thresholdLayout = QtUtils::makeLayout<QHBoxLayout>();
|
||||
|
||||
thresholdLabel = new QLabel(this);
|
||||
thresholdLayout->addWidget(thresholdLabel);
|
||||
|
|
|
|||
|
|
@ -30,13 +30,13 @@
|
|||
#include <libcockatrice/card/database/card_database_manager.h>
|
||||
#include <libcockatrice/filters/filter_tree.h>
|
||||
#include <libcockatrice/settings/visual_deck_storage_settings.h>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <qnamespace.h>
|
||||
|
||||
VisualDatabaseDisplayRecentSetFilterSettingsWidget::VisualDatabaseDisplayRecentSetFilterSettingsWidget(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
layout = new QHBoxLayout(this);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout = QtUtils::makeLayout<QHBoxLayout>(this);
|
||||
|
||||
setLayout(layout);
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
#include <QtGlobal>
|
||||
#include <libcockatrice/card/database/card_database_manager.h>
|
||||
#include <libcockatrice/filters/filter_tree.h>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <qnamespace.h>
|
||||
|
||||
VisualDatabaseDisplaySubTypeFilterWidget::VisualDatabaseDisplaySubTypeFilterWidget(QWidget *parent,
|
||||
|
|
@ -47,8 +48,7 @@ VisualDatabaseDisplaySubTypeFilterWidget::VisualDatabaseDisplaySubTypeFilterWidg
|
|||
layout->addWidget(flowWidget);
|
||||
|
||||
// Create a container for the threshold control
|
||||
auto *thresholdLayout = new QHBoxLayout();
|
||||
thresholdLayout->setContentsMargins(0, 0, 0, 0);
|
||||
auto *thresholdLayout = QtUtils::makeLayout<QHBoxLayout>();
|
||||
|
||||
thresholdLabel = new QLabel(this);
|
||||
thresholdLayout->addWidget(thresholdLabel);
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@
|
|||
#include <libcockatrice/card/database/card_database_manager.h>
|
||||
#include <libcockatrice/deck_list/tree/inner_deck_list_node.h>
|
||||
#include <libcockatrice/settings/cards_display_settings.h>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <utility>
|
||||
|
||||
class QMouseEvent;
|
||||
|
|
@ -92,10 +93,8 @@ VisualDatabaseDisplayWidget::VisualDatabaseDisplayWidget(QWidget *parent,
|
|||
// Set up main layout and widgets
|
||||
setMinimumSize(0, 0);
|
||||
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
mainLayout = new QVBoxLayout(this);
|
||||
mainLayout = QtUtils::makeLayout<QVBoxLayout>(this, 0, 1);
|
||||
setLayout(mainLayout);
|
||||
mainLayout->setSpacing(1);
|
||||
mainLayout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
flowWidget = new FlowWidget(this, Qt::Horizontal, Qt::ScrollBarAlwaysOff, Qt::ScrollBarPolicy::ScrollBarAsNeeded);
|
||||
cardSizeWidget = new CardSizeWidget(this, flowWidget,
|
||||
|
|
|
|||
|
|
@ -26,9 +26,7 @@
|
|||
|
||||
VisualDeckDisplayOptionsWidget::VisualDeckDisplayOptionsWidget(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
groupAndSortLayout = new QHBoxLayout(this);
|
||||
groupAndSortLayout->setContentsMargins(0, 0, 0, 0);
|
||||
groupAndSortLayout->setSpacing(3);
|
||||
groupAndSortLayout = QtUtils::makeLayout<QHBoxLayout>(this, 3);
|
||||
groupAndSortLayout->setAlignment(Qt::AlignLeft);
|
||||
this->setLayout(groupAndSortLayout);
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
#include <compare>
|
||||
#include <libcockatrice/card/database/card_database_manager.h>
|
||||
#include <libcockatrice/settings/cards_display_settings.h>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <qlogging.h>
|
||||
#include <qnamespace.h>
|
||||
#include <qobjectdefs.h>
|
||||
|
|
@ -41,9 +42,7 @@ VisualDeckEditorSampleHandWidget::VisualDeckEditorSampleHandWidget(QWidget *pare
|
|||
layout->setSpacing(0);
|
||||
setLayout(layout);
|
||||
|
||||
auto upperLayout = new QVBoxLayout();
|
||||
upperLayout->setContentsMargins(0, 0, 0, 0);
|
||||
upperLayout->setSpacing(0);
|
||||
auto upperLayout = QtUtils::makeLayout<QVBoxLayout>(nullptr, 0);
|
||||
|
||||
resetAndHandSizeContainerWidget = new QWidget(this);
|
||||
resetAndHandSizeLayout = new QHBoxLayout(resetAndHandSizeContainerWidget);
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
#include <QHBoxLayout>
|
||||
#include <QSizePolicy>
|
||||
#include <libcockatrice/settings/paths_settings.h>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <optional>
|
||||
#include <qnamespace.h>
|
||||
|
||||
|
|
@ -26,8 +27,7 @@ DeckPreviewDeckTagsDisplayWidget::DeckPreviewDeckTagsDisplayWidget(QWidget *_par
|
|||
setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
||||
|
||||
// Create layout
|
||||
auto *layout = new QHBoxLayout(this);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
auto *layout = QtUtils::makeLayout<QHBoxLayout>(this);
|
||||
|
||||
setFixedHeight(100);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,13 +2,12 @@
|
|||
|
||||
#include <QCheckBox>
|
||||
#include <QHBoxLayout>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
|
||||
DeckPreviewTagItemWidget::DeckPreviewTagItemWidget(const QString &tagName, bool isChecked, QWidget *parent)
|
||||
: QWidget(parent), checkBox_(new QCheckBox(this))
|
||||
{
|
||||
auto *layout = new QHBoxLayout(this);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->setSpacing(5);
|
||||
auto *layout = QtUtils::makeLayout<QHBoxLayout>(this, 5);
|
||||
|
||||
checkBox_->setText(tagName); // Set the tag name as the checkbox label
|
||||
checkBox_->setChecked(isChecked); // Set the initial state of the checkbox
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
#include <QVBoxLayout>
|
||||
#include <libcockatrice/card/database/card_database_manager.h>
|
||||
#include <libcockatrice/settings/visual_deck_storage_settings.h>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
#include <qnamespace.h>
|
||||
|
||||
PublicDeckPreviewWidget::PublicDeckPreviewWidget(QWidget *parent, const RemotePublicDecksModel::DeckEntry &entry)
|
||||
|
|
@ -36,8 +37,7 @@ PublicDeckPreviewWidget::PublicDeckPreviewWidget(QWidget *parent, const RemotePu
|
|||
tagsFlowWidget = new FlowWidget(this, Qt::Horizontal, Qt::ScrollBarAlwaysOff, Qt::ScrollBarAsNeeded);
|
||||
tagsFlowWidget->setSpacing(3, 3);
|
||||
|
||||
auto *layout = new QVBoxLayout(this);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
auto *layout = QtUtils::makeLayout<QVBoxLayout>(this);
|
||||
layout->addWidget(bannerCardDisplayWidget);
|
||||
layout->addWidget(uploadTimeLabel);
|
||||
layout->addWidget(colorIdentityWidget);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#include <QLineEdit>
|
||||
#include <QStringLiteral>
|
||||
#include <QTimer>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
|
||||
/**
|
||||
* @brief Constructs a search bar for filtering decks in the Visual Deck Storage.
|
||||
|
|
@ -20,8 +21,7 @@
|
|||
*/
|
||||
VisualDeckStorageSearchWidget::VisualDeckStorageSearchWidget(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
layout = new QHBoxLayout(this);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout = QtUtils::makeLayout<QHBoxLayout>(this);
|
||||
setLayout(layout);
|
||||
|
||||
searchBar = new QLineEdit(this);
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@
|
|||
#include <QHBoxLayout>
|
||||
#include <QtGlobal>
|
||||
#include <libcockatrice/settings/visual_deck_storage_settings.h>
|
||||
#include <libcockatrice/utility/qt_utils.h>
|
||||
|
||||
VisualDeckStorageSortWidget::VisualDeckStorageSortWidget(VisualDeckStorageWidget *parent) : QWidget(parent)
|
||||
{
|
||||
layout = new QHBoxLayout(this);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout = QtUtils::makeLayout<QHBoxLayout>(this);
|
||||
setLayout(layout);
|
||||
|
||||
// Initialize the ComboBox
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue