[Libreoffice-commits] core.git: vcl/unx

Katarina Behrens Katarina.Behrens at cib.de
Fri Feb 16 09:00:49 UTC 2018


 vcl/unx/gtk3_kde5/kde5_filepicker.cxx |   13 +++++++------
 vcl/unx/gtk3_kde5/kde5_filepicker.hxx |    4 ++--
 2 files changed, 9 insertions(+), 8 deletions(-)

New commits:
commit 3b93b176572971f00845e268c12eef94190d03bc
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Thu Feb 15 14:06:48 2018 +0100

    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/49815
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>

diff --git a/vcl/unx/gtk3_kde5/kde5_filepicker.cxx b/vcl/unx/gtk3_kde5/kde5_filepicker.cxx
index d774ebc2834e..f3b48b837836 100644
--- a/vcl/unx/gtk3_kde5/kde5_filepicker.cxx
+++ b/vcl/unx/gtk3_kde5/kde5_filepicker.cxx
@@ -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);
 }
diff --git a/vcl/unx/gtk3_kde5/kde5_filepicker.hxx b/vcl/unx/gtk3_kde5/kde5_filepicker.hxx
index 17a37b7e27a3..d999f7bf7a09 100644
--- a/vcl/unx/gtk3_kde5/kde5_filepicker.hxx
+++ b/vcl/unx/gtk3_kde5/kde5_filepicker.hxx
@@ -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;
 


More information about the Libreoffice-commits mailing list