mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 17:43:23 -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
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue