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
+9 -10
View File
@@ -33,8 +33,7 @@ SettingsDialog::SettingsDialog()
this->initUi();
this->addTabs();
this->overrideBackgroundColor_ = QColor("#111111");
this->scaleChangedEvent(
this->scale()); // execute twice to fix performance + width of item
this->scaleChangedEvent(this->scale()); // execute twice to width of item
}
void SettingsDialog::initUi()
@@ -67,13 +66,9 @@ void SettingsDialog::initUi()
.assign(&this->ui_.tabContainer);
// right side (pages)
auto right =
centerBox.emplace<QVBoxLayout>().withoutMargin().withoutSpacing();
{
right.emplace<QStackedLayout>()
.assign(&this->ui_.pageStack)
.withoutMargin();
}
centerBox.emplace<QStackedLayout>()
.assign(&this->ui_.pageStack)
.withoutMargin();
this->ui_.pageStack->setMargin(0);
@@ -155,6 +150,8 @@ void SettingsDialog::addTabs()
this->ui_.tabContainer->setContentsMargins(0, 20, 0, 20);
// Constructors are wrapped in std::function to remove some strain from first time loading.
// clang-format off
this->addTab([]{return new GeneralPage;}, "General", ":/settings/about.svg");
this->ui_.tabContainer->addSpacing(16);
@@ -268,8 +265,10 @@ void SettingsDialog::showDialog(SettingsDialogPreference preferredTab)
void SettingsDialog::refresh()
{
// Resets the cancel button.
getSettings()->saveSnapshot();
// Updates tabs.
for (auto *tab : this->tabs_)
{
tab->page()->onShow();
@@ -300,7 +299,7 @@ void SettingsDialog::themeChangedEvent()
BaseWindow::themeChangedEvent();
QPalette palette;
palette.setColor(QPalette::Background, QColor("#111"));
palette.setColor(QPalette::Window, QColor("#111"));
this->setPalette(palette);
}