added spacing to the split header title

This commit is contained in:
fourtf 2020-09-25 23:41:18 +02:00
parent 5fc495a073
commit 3375e58a4f
2 changed files with 8 additions and 1 deletions

View file

@ -15,7 +15,8 @@ class BaseWidget : public QWidget
Q_OBJECT
public:
explicit BaseWidget(QWidget *parent, Qt::WindowFlags f = Qt::WindowFlags());
explicit BaseWidget(QWidget *parent = nullptr,
Qt::WindowFlags f = Qt::WindowFlags());
virtual float scale() const;
pajlada::Signals::Signal<float> scaleChanged;

View file

@ -174,6 +174,9 @@ SplitHeader::SplitHeader(Split *_split)
void SplitHeader::initializeLayout()
{
auto layout = makeLayout<QHBoxLayout>({
// space
makeWidget<BaseWidget>(
[](auto w) { w->setScaleIndependantSize(8, 4); }),
// title
this->titleLabel_ = makeWidget<Label>([](auto w) {
w->setSizePolicy(QSizePolicy::MinimumExpanding,
@ -181,6 +184,9 @@ void SplitHeader::initializeLayout()
w->setCentered(true);
w->setHasOffset(false);
}),
// space
makeWidget<BaseWidget>(
[](auto w) { w->setScaleIndependantSize(8, 4); }),
// mode
this->modeButton_ = makeWidget<EffectLabel>([&](auto w) {
w->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);