diff --git a/resources/qss/settings.qss b/resources/qss/settings.qss index 3643d7b3..54f9bfbd 100644 --- a/resources/qss/settings.qss +++ b/resources/qss/settings.qss @@ -24,7 +24,12 @@ QComboBox QFrame { border: 1px solid #66BCFF; } -chatterino--SettingsPage { +chatterino--SettingsDialog chatterino--SettingsDialogTab { + font-family: "Segoe UI"; + font-size: 14; +} + +chatterino--SettingsPage #generalSettingsScrollContent { background: #222; } @@ -39,5 +44,12 @@ chatterino--TitleLabel { } chatterino--DescriptionLabel { + font-size: 14px; color: #999; } + +chatterino--NavigationLabel { + font-family: "Segoe UI light"; + font-size: 16px; + color: #A6DDF4; +} diff --git a/src/util/LayoutHelper.cpp b/src/util/LayoutHelper.cpp index ab42fadc..43987d7e 100644 --- a/src/util/LayoutHelper.cpp +++ b/src/util/LayoutHelper.cpp @@ -12,7 +12,7 @@ QWidget *wrapLayout(QLayout *layout) return widget; } -QScrollArea *makeScrollArea(LayoutItem item) +QScrollArea *makeScrollArea(WidgetOrLayout item) { auto area = new QScrollArea(); diff --git a/src/util/LayoutHelper.hpp b/src/util/LayoutHelper.hpp index 9d998681..1cf7f700 100644 --- a/src/util/LayoutHelper.hpp +++ b/src/util/LayoutHelper.hpp @@ -8,10 +8,11 @@ class QScrollArea; namespace chatterino { -using LayoutItem = boost::variant; +using LayoutItem = boost::variant; +using WidgetOrLayout = boost::variant; QWidget *wrapLayout(QLayout *layout); -QScrollArea *makeScrollArea(LayoutItem item); +QScrollArea *makeScrollArea(WidgetOrLayout item); template T *makeLayout(std::initializer_list items) @@ -26,7 +27,7 @@ T *makeLayout(std::initializer_list items) t->addItem(new QWidgetItem(boost::get(item))); break; case 1: - t->addItem(boost::get(item)); + t->addItem(boost::get(item)); break; } } @@ -36,14 +37,6 @@ T *makeLayout(std::initializer_list items) return t; } -template -T *makeStretchingLayout(std::initializer_list items) -{ - auto layout = makeLayout(items); - layout->addStretch(1); - return layout; -} - template T *makeWidget(With with) { diff --git a/src/widgets/helper/SettingsDialogTab.cpp b/src/widgets/helper/SettingsDialogTab.cpp index 5ad366ab..a3b7bf81 100644 --- a/src/widgets/helper/SettingsDialogTab.cpp +++ b/src/widgets/helper/SettingsDialogTab.cpp @@ -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) diff --git a/src/widgets/settingspages/GeneralPage.cpp b/src/widgets/settingspages/GeneralPage.cpp index b9ca01b7..ca37bbac 100644 --- a/src/widgets/settingspages/GeneralPage.cpp +++ b/src/widgets/settingspages/GeneralPage.cpp @@ -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); } diff --git a/src/widgets/settingspages/GeneralPageView.cpp b/src/widgets/settingspages/GeneralPageView.cpp index b862e3a1..7e425bcf 100644 --- a/src/widgets/settingspages/GeneralPageView.cpp +++ b/src/widgets/settingspages/GeneralPageView.cpp @@ -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({})); + navigation->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum); + this->navigationLayout_->setAlignment(Qt::AlignTop); + this->navigationLayout_->addSpacing(6); - this->setLayout(makeLayout({scrollArea, navigation})); + this->setLayout(makeLayout( + {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 { diff --git a/src/widgets/settingspages/GeneralPageView.hpp b/src/widgets/settingspages/GeneralPageView.hpp index 007f4cd2..bd489d74 100644 --- a/src/widgets/settingspages/GeneralPageView.hpp +++ b/src/widgets/settingspages/GeneralPageView.hpp @@ -87,6 +87,7 @@ public: bool editable = false); ColorButton *addColorButton(const QString &text, const QColor &color, pajlada::Settings::Setting &setting); + void addNavigationSpacing(); template QPushButton *makeButton(const QString &text, OnClick onClick)