fixed spaces and margins in general settings
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,11 @@ class QComboBox;
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
class Space : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
};
|
||||
|
||||
class TitleLabel : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -162,6 +167,7 @@ private:
|
||||
struct Group {
|
||||
QString name;
|
||||
QWidget *title{};
|
||||
Space *space{};
|
||||
std::vector<Widget> widgets;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user