Commit 29c1693f authored by JanKusanagi's avatar JanKusanagi

Use QDialogButtonBox to have bottom buttons properly sorted for each DE

parent b30ce857
......@@ -2233,6 +2233,7 @@ void Post::onImageFailed(QString imageUrl)
m_postImageFailed = true;
}
// Tentatively redraw anyway, in case other <img src> images failed
this->redrawImages(imageUrl);
}
......
......@@ -135,6 +135,11 @@ ProfileEditor::ProfileEditor(PumpController *pumpController,
connect(m_cancelButton, &QAbstractButton::clicked,
this, &QWidget::close);
// Buttons managed via DBB to have proper order on each desktop environment
m_buttonBox = new QDialogButtonBox(this);
m_buttonBox->addButton(m_saveButton, QDialogButtonBox::AcceptRole);
m_buttonBox->addButton(m_cancelButton, QDialogButtonBox::RejectRole);
// ESC to cancel, too
m_cancelAction = new QAction(this);
......@@ -169,17 +174,10 @@ ProfileEditor::ProfileEditor(PumpController *pumpController,
// FIXME: the FormLayout doesn't let the bioTextEdit row grow taller than its sizeHint()
m_bottomLayout = new QHBoxLayout();
m_bottomLayout->setAlignment(Qt::AlignRight | Qt::AlignBottom);
m_bottomLayout->setContentsMargins(0, 0, 0, 0);
m_bottomLayout->addWidget(m_saveButton);
m_bottomLayout->addWidget(m_cancelButton);
m_mainLayout = new QVBoxLayout();
m_mainLayout->addLayout(m_topLayout, 9);
m_mainLayout->addLayout(m_topLayout, 9);
m_mainLayout->addWidget(m_newAvatarInfoLabel);
m_mainLayout->addLayout(m_bottomLayout, 1);
m_mainLayout->addWidget(m_buttonBox, 1);
this->setLayout(m_mainLayout);
......
......@@ -28,6 +28,7 @@
#include <QLineEdit>
#include <QTextEdit>
#include <QPushButton>
#include <QDialogButtonBox>
#include <QFileDialog>
#include <QMessageBox>
#include <QAction>
......@@ -78,7 +79,6 @@ private:
QFormLayout *m_topLayout;
QHBoxLayout *m_emailLayout;
QHBoxLayout *m_avatarLayout;
QHBoxLayout *m_bottomLayout;
QLabel *m_webfingerLabel;
......@@ -98,6 +98,7 @@ private:
QPushButton *m_saveButton;
QPushButton *m_cancelButton;
QDialogButtonBox *m_buttonBox;
QAction *m_cancelAction;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment