[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 2 commits - vcl/inc vcl/Library_vclplug_qt5.mk vcl/qt5 vcl/unx

Katarina Behrens Katarina.Behrens at cib.de
Thu Jul 5 10:03:33 UTC 2018


 vcl/Library_vclplug_qt5.mk       |    1 +
 vcl/inc/qt5/Qt5System.hxx        |   27 +++++++++++++++++++++++++++
 vcl/qt5/Qt5Instance.cxx          |    4 ++--
 vcl/qt5/Qt5System.cxx            |   32 ++++++++++++++++++++++++++++++++
 vcl/unx/kde5/KDE5SalGraphics.cxx |    4 ++++
 5 files changed, 66 insertions(+), 2 deletions(-)

New commits:
commit 34fec433197c5ec3e2a0c6603392fd5f1067c44b
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Thu Jul 5 11:45:45 2018 +0200

    Basic Qt5 system display data
    
    copied from dummy headless implementation
    
    Change-Id: I1b184745627acd065b4c0cc54f044c47ec980c93

diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk
index 4fcd649e1777..1ad01555ed3a 100644
--- a/vcl/Library_vclplug_qt5.mk
+++ b/vcl/Library_vclplug_qt5.mk
@@ -96,6 +96,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\
     vcl/qt5/Qt5Object \
     vcl/qt5/Qt5Painter \
     vcl/qt5/Qt5Printer \
+    vcl/qt5/Qt5System \
     vcl/qt5/Qt5Timer \
     vcl/qt5/Qt5Tools \
     vcl/qt5/Qt5VirtualDevice \
diff --git a/vcl/inc/qt5/Qt5System.hxx b/vcl/inc/qt5/Qt5System.hxx
new file mode 100644
index 000000000000..fbc753757b36
--- /dev/null
+++ b/vcl/inc/qt5/Qt5System.hxx
@@ -0,0 +1,27 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include <vcl/sysdata.hxx>
+#include <unx/gensys.h>
+
+class Qt5System : public SalGenericSystem
+{
+public:
+    Qt5System();
+    virtual ~Qt5System() override;
+
+    virtual unsigned int GetDisplayScreenCount() override;
+    virtual tools::Rectangle GetDisplayScreenPosSizePixel(unsigned int nScreen) override;
+    virtual int ShowNativeDialog(const OUString& rTitle, const OUString& rMessage,
+                                 const std::vector<OUString>& rButtons) override;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx
index ef618e18fa7f..c2f2b7eb1566 100644
--- a/vcl/qt5/Qt5Instance.cxx
+++ b/vcl/qt5/Qt5Instance.cxx
@@ -26,6 +26,7 @@
 #include <Qt5Frame.hxx>
 #include <Qt5Menu.hxx>
 #include <Qt5Object.hxx>
+#include <Qt5System.hxx>
 #include <Qt5Timer.hxx>
 #include <Qt5VirtualDevice.hxx>
 
@@ -40,7 +41,6 @@
 #include <sal/log.hxx>
 #include <osl/process.h>
 
-#include <headless/svpdummies.hxx>
 #include <headless/svpbmp.hxx>
 
 Qt5Instance::Qt5Instance(SalYieldMutex* pMutex, bool bUseCairo)
@@ -125,7 +125,7 @@ std::unique_ptr<SalMenuItem> Qt5Instance::CreateMenuItem(const SalItemParams& rI
 
 SalTimer* Qt5Instance::CreateSalTimer() { return new Qt5Timer(); }
 
-SalSystem* Qt5Instance::CreateSalSystem() { return new SvpSalSystem(); }
+SalSystem* Qt5Instance::CreateSalSystem() { return new Qt5System(); }
 
 std::shared_ptr<SalBitmap> Qt5Instance::CreateSalBitmap()
 {
diff --git a/vcl/qt5/Qt5System.cxx b/vcl/qt5/Qt5System.cxx
new file mode 100644
index 000000000000..0de1940d9eff
--- /dev/null
+++ b/vcl/qt5/Qt5System.cxx
@@ -0,0 +1,32 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <string.h>
+#include <tools/gen.hxx>
+#include <Qt5System.hxx>
+
+Qt5System::Qt5System() {}
+Qt5System::~Qt5System() {}
+
+unsigned int Qt5System::GetDisplayScreenCount() { return 1; }
+
+tools::Rectangle Qt5System::GetDisplayScreenPosSizePixel(unsigned int nScreen)
+{
+    tools::Rectangle aRect;
+    if (nScreen == 0)
+        aRect = tools::Rectangle(Point(0, 0), Size(1024, 768));
+    return aRect;
+}
+
+int Qt5System::ShowNativeDialog(const OUString&, const OUString&, const std::vector<OUString>&)
+{
+    return 0;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 3d8dbf46e69a00049132108808e0c00cdb5bcc55
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Thu Jul 5 11:28:39 2018 +0200

    Don't draw focus around checkboxes and radiobuttons
    
    it is drawn separately around cb/rb's text
    
    Change-Id: I22737944048c4d501ba4dc5416fa79d4d081e91c

diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx
index 9377a134fdc4..f26e559b921e 100644
--- a/vcl/unx/kde5/KDE5SalGraphics.cxx
+++ b/vcl/unx/kde5/KDE5SalGraphics.cxx
@@ -468,6 +468,8 @@ bool KDE5SalGraphics::drawNativeControl(ControlType type, ControlPart part,
         if (part == ControlPart::Entire)
         {
             QStyleOptionButton option;
+            // clear FOCUSED bit, focus is drawn separately
+            nControlState &= ~(ControlState::FOCUSED);
             draw(QStyle::CE_CheckBox, &option, m_image.get(),
                  vclStateValue2StateFlag(nControlState, value));
         }
@@ -548,6 +550,8 @@ bool KDE5SalGraphics::drawNativeControl(ControlType type, ControlPart part,
         if (part == ControlPart::Entire)
         {
             QStyleOptionButton option;
+            // clear FOCUSED bit, focus is drawn separately
+            nControlState &= ~(ControlState::FOCUSED);
             draw(QStyle::CE_RadioButton, &option, m_image.get(),
                  vclStateValue2StateFlag(nControlState, value));
         }


More information about the Libreoffice-commits mailing list