Kaydet (Commit) 3b93b176 authored tarafından Katarina Behrens's avatar Katarina Behrens

gtk3_kde5: Checkboxes on the left, texts on the right

QFormLayout does it the other way round (text left, checkbox right)
and it looks odd, so use QGridLayout

Change-Id: Iff4255f695ce17561bac44e496a3567e1b438581
Reviewed-on: https://gerrit.libreoffice.org/49815Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarKatarina Behrens <Katarina.Behrens@cib.de>
üst 5b128983
......@@ -28,7 +28,7 @@
#include <QtGui/QWindow>
#include <QtWidgets/QCheckBox>
#include <QtWidgets/QFileDialog>
#include <QtWidgets/QFormLayout>
#include <QtWidgets/QGridLayout>
#include <QtWidgets/QWidget>
#include <QtWidgets/QApplication>
......@@ -38,7 +38,7 @@ KDE5FilePicker::KDE5FilePicker(QObject* parent)
: QObject(parent)
, _dialog(new QFileDialog(nullptr, {}, QDir::homePath()))
, _extraControls(new QWidget)
, _layout(new QFormLayout(_extraControls))
, _layout(new QGridLayout(_extraControls))
, _winId(0)
, allowRemoteUrls(false)
{
......@@ -197,13 +197,14 @@ QString KDE5FilePicker::getLabel(sal_Int16 controlId) const
void KDE5FilePicker::addCheckBox(sal_Int16 controlId, const QString& label, bool hidden)
{
auto widget = new QCheckBox(_extraControls);
auto resString = label;
resString.replace('~', '&');
auto widget = new QCheckBox(resString, _extraControls);
widget->setHidden(hidden);
if (!hidden)
{
auto resString = label;
resString.replace('~', '&');
_layout->addRow(resString, widget);
_layout->addWidget(widget);
}
_customWidgets.insert(controlId, widget);
}
......
......@@ -28,7 +28,7 @@
class QFileDialog;
class QWidget;
class QFormLayout;
class QGridLayout;
class KDE5FilePicker : public QObject
{
......@@ -51,7 +51,7 @@ protected:
QWidget* _extraControls;
//layout for extra custom controls
QFormLayout* _layout;
QGridLayout* _layout;
sal_uIntPtr _winId;
......
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