mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Replaced QLayout::setMargin with QLayout::setContentsMargins
It's been already deprecated in Qt5, removed from Qt6 completely Reference: - https://doc.qt.io/qt-5/qlayout-obsolete.html
This commit is contained in:
parent
c99f12e8fe
commit
fa31c57dc9
|
@ -46,7 +46,7 @@ AttachedWindow::AttachedWindow(void *_target, int _yOffset)
|
||||||
, yOffset_(_yOffset)
|
, yOffset_(_yOffset)
|
||||||
{
|
{
|
||||||
QLayout *layout = new QVBoxLayout(this);
|
QLayout *layout = new QVBoxLayout(this);
|
||||||
layout->setMargin(0);
|
layout->setContentsMargins(0, 0, 0, 0);
|
||||||
this->setLayout(layout);
|
this->setLayout(layout);
|
||||||
|
|
||||||
auto *split = new Split(this);
|
auto *split = new Split(this);
|
||||||
|
|
|
@ -150,7 +150,7 @@ void BaseWindow::init()
|
||||||
{
|
{
|
||||||
QHBoxLayout *buttonLayout = this->ui_.titlebarBox =
|
QHBoxLayout *buttonLayout = this->ui_.titlebarBox =
|
||||||
new QHBoxLayout();
|
new QHBoxLayout();
|
||||||
buttonLayout->setMargin(0);
|
buttonLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
layout->addLayout(buttonLayout);
|
layout->addLayout(buttonLayout);
|
||||||
|
|
||||||
// title
|
// title
|
||||||
|
|
|
@ -29,7 +29,7 @@ StreamView::StreamView(ChannelPtr channel, const QUrl &url)
|
||||||
chat->setChannel(std::move(channel));
|
chat->setChannel(std::move(channel));
|
||||||
|
|
||||||
this->layout()->setSpacing(0);
|
this->layout()->setSpacing(0);
|
||||||
this->layout()->setMargin(0);
|
this->layout()->setContentsMargins(0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace chatterino
|
} // namespace chatterino
|
||||||
|
|
|
@ -149,7 +149,7 @@ void Window::addLayout()
|
||||||
this->getLayoutContainer()->setLayout(layout);
|
this->getLayoutContainer()->setLayout(layout);
|
||||||
|
|
||||||
// set margin
|
// set margin
|
||||||
layout->setMargin(0);
|
layout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
this->notebook_->setAllowUserTabManagement(true);
|
this->notebook_->setAllowUserTabManagement(true);
|
||||||
this->notebook_->setShowAddButton(true);
|
this->notebook_->setShowAddButton(true);
|
||||||
|
|
|
@ -139,7 +139,7 @@ EmotePopup::EmotePopup(QWidget *parent)
|
||||||
|
|
||||||
auto notebook = new Notebook(this);
|
auto notebook = new Notebook(this);
|
||||||
layout->addWidget(notebook);
|
layout->addWidget(notebook);
|
||||||
layout->setMargin(0);
|
layout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
auto clicked = [this](const Link &link) {
|
auto clicked = [this](const Link &link) {
|
||||||
this->linkClicked.invoke(link);
|
this->linkClicked.invoke(link);
|
||||||
|
|
|
@ -84,7 +84,7 @@ void SettingsDialog::initUi()
|
||||||
.assign(&this->ui_.pageStack)
|
.assign(&this->ui_.pageStack)
|
||||||
.withoutMargin();
|
.withoutMargin();
|
||||||
|
|
||||||
this->ui_.pageStack->setMargin(0);
|
this->ui_.pageStack->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
outerBox->addSpacing(12);
|
outerBox->addSpacing(12);
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ void SettingsDialog::filterElements(const QString &text)
|
||||||
|
|
||||||
void SettingsDialog::addTabs()
|
void SettingsDialog::addTabs()
|
||||||
{
|
{
|
||||||
this->ui_.tabContainer->setMargin(0);
|
this->ui_.tabContainer->setContentsMargins(0, 0, 0, 0);
|
||||||
this->ui_.tabContainer->setSpacing(0);
|
this->ui_.tabContainer->setSpacing(0);
|
||||||
|
|
||||||
this->ui_.tabContainer->setContentsMargins(0, 20, 0, 20);
|
this->ui_.tabContainer->setContentsMargins(0, 20, 0, 20);
|
||||||
|
|
|
@ -28,7 +28,7 @@ EditableModelView::EditableModelView(QAbstractTableModel *model, bool movable)
|
||||||
|
|
||||||
// create layout
|
// create layout
|
||||||
QVBoxLayout *vbox = new QVBoxLayout(this);
|
QVBoxLayout *vbox = new QVBoxLayout(this);
|
||||||
vbox->setMargin(0);
|
vbox->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
// create button layout
|
// create button layout
|
||||||
QHBoxLayout *buttons = new QHBoxLayout(this);
|
QHBoxLayout *buttons = new QHBoxLayout(this);
|
||||||
|
|
|
@ -13,7 +13,7 @@ EffectLabel::EffectLabel(BaseWidget *parent, int spacing)
|
||||||
|
|
||||||
this->label_.setAlignment(Qt::AlignCenter);
|
this->label_.setAlignment(Qt::AlignCenter);
|
||||||
|
|
||||||
this->hbox_.setMargin(0);
|
this->hbox_.setContentsMargins(0, 0, 0, 0);
|
||||||
this->hbox_.addSpacing(spacing);
|
this->hbox_.addSpacing(spacing);
|
||||||
this->hbox_.addWidget(&this->label_);
|
this->hbox_.addWidget(&this->label_);
|
||||||
this->hbox_.addSpacing(spacing);
|
this->hbox_.addSpacing(spacing);
|
||||||
|
@ -29,7 +29,7 @@ EffectLabel2::EffectLabel2(BaseWidget *parent, int padding)
|
||||||
// this->label_.setAlignment(Qt::AlignCenter);
|
// this->label_.setAlignment(Qt::AlignCenter);
|
||||||
this->label_.setCentered(true);
|
this->label_.setCentered(true);
|
||||||
|
|
||||||
hbox->setMargin(0);
|
hbox->setContentsMargins(0, 0, 0, 0);
|
||||||
// hbox.addSpacing(spacing);
|
// hbox.addSpacing(spacing);
|
||||||
hbox->addWidget(&this->label_);
|
hbox->addWidget(&this->label_);
|
||||||
// hbox.addSpacing(spacing);
|
// hbox.addSpacing(spacing);
|
||||||
|
|
|
@ -116,13 +116,13 @@ void SearchPopup::initLayout()
|
||||||
// VBOX
|
// VBOX
|
||||||
{
|
{
|
||||||
QVBoxLayout *layout1 = new QVBoxLayout(this);
|
QVBoxLayout *layout1 = new QVBoxLayout(this);
|
||||||
layout1->setMargin(0);
|
layout1->setContentsMargins(0, 0, 0, 0);
|
||||||
layout1->setSpacing(0);
|
layout1->setSpacing(0);
|
||||||
|
|
||||||
// HBOX
|
// HBOX
|
||||||
{
|
{
|
||||||
QHBoxLayout *layout2 = new QHBoxLayout(this);
|
QHBoxLayout *layout2 = new QHBoxLayout(this);
|
||||||
layout2->setMargin(8);
|
layout2->setContentsMargins(8, 8, 8, 8);
|
||||||
layout2->setSpacing(8);
|
layout2->setSpacing(8);
|
||||||
|
|
||||||
// SEARCH INPUT
|
// SEARCH INPUT
|
||||||
|
|
|
@ -90,7 +90,7 @@ Split::Split(QWidget *parent)
|
||||||
this->view_->setFocusPolicy(Qt::FocusPolicy::NoFocus);
|
this->view_->setFocusPolicy(Qt::FocusPolicy::NoFocus);
|
||||||
|
|
||||||
this->vbox_->setSpacing(0);
|
this->vbox_->setSpacing(0);
|
||||||
this->vbox_->setMargin(1);
|
this->vbox_->setContentsMargins(1, 1, 1, 1);
|
||||||
|
|
||||||
this->vbox_->addWidget(this->header_);
|
this->vbox_->addWidget(this->header_);
|
||||||
this->vbox_->addWidget(this->view_, 1);
|
this->vbox_->addWidget(this->view_, 1);
|
||||||
|
|
|
@ -325,7 +325,7 @@ void SplitHeader::initializeLayout()
|
||||||
},
|
},
|
||||||
this->managedConnections_);
|
this->managedConnections_);
|
||||||
|
|
||||||
layout->setMargin(0);
|
layout->setContentsMargins(0, 0, 0, 0);
|
||||||
layout->setSpacing(0);
|
layout->setSpacing(0);
|
||||||
this->setLayout(layout);
|
this->setLayout(layout);
|
||||||
|
|
||||||
|
|
|
@ -144,8 +144,8 @@ void SplitInput::themeChangedEvent()
|
||||||
this->ui_.textEdit->setPalette(placeholderPalette);
|
this->ui_.textEdit->setPalette(placeholderPalette);
|
||||||
this->ui_.textEdit->setStyleSheet(this->theme->splits.input.styleSheet);
|
this->ui_.textEdit->setStyleSheet(this->theme->splits.input.styleSheet);
|
||||||
|
|
||||||
this->ui_.hbox->setMargin(
|
int scale = (this->theme->isLightTheme() ? 4 : 2) * this->scale();
|
||||||
int((this->theme->isLightTheme() ? 4 : 2) * this->scale()));
|
this->ui_.hbox->setContentsMargins(scale, scale, scale, scale);
|
||||||
|
|
||||||
this->ui_.emoteButton->getLabel().setStyleSheet("color: #000");
|
this->ui_.emoteButton->getLabel().setStyleSheet("color: #000");
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ SplitOverlay::SplitOverlay(Split *parent)
|
||||||
{
|
{
|
||||||
QGridLayout *layout = new QGridLayout(this);
|
QGridLayout *layout = new QGridLayout(this);
|
||||||
this->layout_ = layout;
|
this->layout_ = layout;
|
||||||
layout->setMargin(1);
|
layout->setContentsMargins(1, 1, 1, 1);
|
||||||
layout->setSpacing(1);
|
layout->setSpacing(1);
|
||||||
|
|
||||||
layout->setRowStretch(1, 1);
|
layout->setRowStretch(1, 1);
|
||||||
|
|
Loading…
Reference in a new issue