moved navigation to the right

This commit is contained in:
fourtf
2020-10-23 09:32:45 +02:00
parent 74e2242da2
commit 5f54b1b495
7 changed files with 36 additions and 18 deletions
+3 -2
View File
@@ -65,8 +65,9 @@ void SettingsDialogTab::paintEvent(QPaintEvent *)
a = a + a + 20 + a;
painter.drawText(QRect(a, 0, width() - a, height()), this->ui_.labelText,
QTextOption(Qt::AlignLeft | Qt::AlignVCenter));
this->style()->drawItemText(&painter, QRect(a, 0, width() - a, height()),
Qt::AlignLeft | Qt::AlignVCenter,
this->palette(), false, this->ui_.labelText);
}
void SettingsDialogTab::mousePressEvent(QMouseEvent *event)
+2 -1
View File
@@ -420,6 +420,7 @@ void GeneralPage::initLayout(GeneralPageView &layout)
layout.addCheckbox("Category", s.headerGame);
layout.addCheckbox("Title", s.headerStreamTitle);
layout.addNavigationSpacing();
layout.addTitle("Beta");
if (Version::instance().isSupportedOS())
{
@@ -563,7 +564,7 @@ void GeneralPage::initLayout(GeneralPageView &layout)
// invisible element for width
auto inv = new BaseWidget(this);
inv->setScaleIndependantWidth(500);
// inv->setScaleIndependantWidth(600);
layout.addWidget(inv);
}
+12 -2
View File
@@ -15,11 +15,16 @@ GeneralPageView::GeneralPageView(QWidget *parent)
{
auto scrollArea = this->contentScrollArea_ =
makeScrollArea(this->contentLayout_ = new QVBoxLayout);
scrollArea->setObjectName("generalSettingsScrollContent");
auto navigation =
wrapLayout(this->navigationLayout_ = makeLayout<QVBoxLayout>({}));
navigation->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum);
this->navigationLayout_->setAlignment(Qt::AlignTop);
this->navigationLayout_->addSpacing(6);
this->setLayout(makeLayout<QHBoxLayout>({scrollArea, navigation}));
this->setLayout(makeLayout<QHBoxLayout>(
{scrollArea, new QSpacerItem(16, 1), navigation}));
QObject::connect(scrollArea->verticalScrollBar(), &QScrollBar::valueChanged,
this, [=] { this->updateNavigationHighlighting(); });
@@ -166,6 +171,11 @@ ColorButton *GeneralPageView::addColorButton(
return colorButton;
}
void GeneralPageView::addNavigationSpacing()
{
this->navigationLayout_->addSpacing(24);
}
DescriptionLabel *GeneralPageView::addDescription(const QString &text)
{
auto label = new DescriptionLabel(text);
@@ -259,7 +269,7 @@ void GeneralPageView::updateNavigationHighlighting()
&group == &this->groups_.back()))
{
first = false;
group.navigationLink->setStyleSheet("color: #4FC3F7");
group.navigationLink->setStyleSheet("color: #00ABF4");
}
else
{
@@ -87,6 +87,7 @@ public:
bool editable = false);
ColorButton *addColorButton(const QString &text, const QColor &color,
pajlada::Settings::Setting<QString> &setting);
void addNavigationSpacing();
template <typename OnClick>
QPushButton *makeButton(const QString &text, OnClick onClick)