[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:
BruebachL 2026-10-24 19:06:18 +02:00 • committed by GitHub
parent 06b9ca368f
commit e806085681
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
56 changed files with 116 additions and 175 deletions

View file

@ -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);