fixed spaces and margins in general settings

This commit is contained in:
fourtf
2020-02-21 03:01:48 +01:00
parent 5a2633ef5c
commit 03cf6e81ff
4 changed files with 23 additions and 15 deletions
+8 -4
View File
@@ -74,14 +74,16 @@ namespace {
TitleLabel *SettingsLayout::addTitle(const QString &title)
{
auto label = new TitleLabel(title + ":");
// space
if (!this->groups_.empty())
this->addWidget(this->groups_.back().space = new Space);
if (this->count() == 0)
label->setStyleSheet("margin-top: 0");
// title
auto label = new TitleLabel(title + ":");
this->addWidget(label);
// groups
this->groups_.push_back(Group{title, label, {}});
this->groups_.push_back(Group{title, label, nullptr, {}});
return label;
}
@@ -228,6 +230,8 @@ bool SettingsLayout::filterElements(const QString &query)
}
}
if (group.space)
group.space->setVisible(groupAny);
group.title->setVisible(groupAny);
any |= groupAny;
}