fixed spacing

This commit is contained in:
fourtf 2019-09-02 19:14:19 +02:00
parent eaaa52260e
commit 0ada2e51c6

View file

@ -49,9 +49,10 @@ void SettingsDialog::initUi()
LayoutCreator<SettingsDialog> layoutCreator(this); LayoutCreator<SettingsDialog> layoutCreator(this);
// tab pages // tab pages
layoutCreator.setLayoutType<QHBoxLayout>() auto outerBox = layoutCreator.setLayoutType<QHBoxLayout>();
.withoutSpacing() outerBox->setSpacing(12);
.emplace<QWidget>()
outerBox.emplace<QWidget>()
.assign(&this->ui_.tabContainerContainer) .assign(&this->ui_.tabContainerContainer)
.emplace<QVBoxLayout>() .emplace<QVBoxLayout>()
.withoutMargin() .withoutMargin()
@ -59,8 +60,6 @@ void SettingsDialog::initUi()
this->ui_.tabContainerContainer->layout()->setContentsMargins(8, 8, 0, 39); this->ui_.tabContainerContainer->layout()->setContentsMargins(8, 8, 0, 39);
this->layout()->setSpacing(0);
// right side layout // right side layout
auto right = auto right =
layoutCreator.emplace<QVBoxLayout>().withoutMargin().withoutSpacing(); layoutCreator.emplace<QVBoxLayout>().withoutMargin().withoutSpacing();
@ -125,11 +124,16 @@ void SettingsDialog::initUi()
auto searchButton = header.emplace<Button>(); auto searchButton = header.emplace<Button>();
searchButton->setPixmap(getApp()->resources->buttons.search); searchButton->setPixmap(getApp()->resources->buttons.search);
searchButton->setScaleIndependantSize(30, 30); searchButton->setScaleIndependantSize(30, 30);
QObject::connect(
searchButton.getElement(), &Button::clicked, this,
[]() { QDesktopServices::openUrl({"https://google.com"}); });
right.emplace<QStackedLayout>() right.emplace<QStackedLayout>()
.assign(&this->ui_.pageStack) .assign(&this->ui_.pageStack)
.withoutMargin(); .withoutMargin();
right->addSpacing(12);
auto buttons = right.emplace<QDialogButtonBox>(Qt::Horizontal); auto buttons = right.emplace<QDialogButtonBox>(Qt::Horizontal);
{ {
this->ui_.okButton = this->ui_.okButton =
@ -161,8 +165,6 @@ void SettingsDialog::addTabs()
this->ui_.tabContainer->setMargin(0); this->ui_.tabContainer->setMargin(0);
this->ui_.tabContainer->setSpacing(0); this->ui_.tabContainer->setSpacing(0);
this->ui_.tabContainer->addSpacing(16);
this->addTab(new GeneralPage); this->addTab(new GeneralPage);
this->ui_.tabContainer->addSpacing(16); this->ui_.tabContainer->addSpacing(16);
@ -216,9 +218,7 @@ void SettingsDialog::selectTab(SettingsDialogTab *tab, bool byUser)
tab->setSelected(true); tab->setSelected(true);
tab->setStyleSheet("background: #222; color: #4FC3F7;" tab->setStyleSheet("background: #222; color: #4FC3F7;"
"border-left: 1px solid #444;" "border: 1px solid #444;");
"border-top: 1px solid #444;"
"border-bottom: 1px solid #444;");
this->selectedTab_ = tab; this->selectedTab_ = tab;
if (byUser) if (byUser)
{ {