Gui: Ability to target new file buttons fia QSS.

This adds ability to target New File buttons via `#CreateNewRow >
QPushButton` selector.
This commit is contained in:
Kacper Donat
2024-07-10 22:59:27 +02:00
committed by Chris Hennes
parent 538579d5dd
commit d282d449b9
3 changed files with 21 additions and 1 deletions

View File

@@ -147,8 +147,18 @@ StartView::StartView(QWidget* parent)
_newFileLabel = gsl::owner<QLabel*>(new QLabel());
layout->addWidget(_newFileLabel);
auto createNewRow = gsl::owner<QWidget*>(new QWidget);
auto flowLayout = gsl::owner<FlowLayout*>(new FlowLayout);
layout->addLayout(flowLayout);
// reset margins of layout to provide consistent spacing
flowLayout->setContentsMargins({});
// this allows new file widgets to be targeted via QSS
createNewRow->setObjectName(QStringLiteral("CreateNewRow"));
createNewRow->setLayout(flowLayout);
layout->addWidget(createNewRow);
configureNewFileButtons(flowLayout);
_recentFilesLabel = gsl::owner<QLabel*>(new QLabel());