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

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Thu Apr 4 12:18:27 UTC 2019


 vcl/Library_vclplug_kde5.mk      |    1 
 vcl/qt5/Qt5Data.cxx              |   15 +++++++++-
 vcl/unx/kde5/KDE5SalData.cxx     |   56 ---------------------------------------
 vcl/unx/kde5/KDE5SalData.hxx     |   33 ----------------------
 vcl/unx/kde5/KDE5SalInstance.cxx |    8 ++---
 5 files changed, 16 insertions(+), 97 deletions(-)

New commits:
commit ae1e23651a6d2e97d39bbe46bab83b7982d19611
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Sun Mar 31 11:29:30 2019 +0000
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Thu Apr 4 14:17:55 2019 +0200

    KDE5 merge KDE5SalData into Qt5Data
    
    Currently there is no point for a seperate KDE5 SalData class.
    The additional NWF settings fix the wrong popup menu for qt5, so
    this just moves all the NWF data and gets rid of KDE5SalData.
    
    Change-Id: I1c02d1f660df288a0d2e1c6607b34fc1ce593727
    Reviewed-on: https://gerrit.libreoffice.org/70005
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>

diff --git a/vcl/Library_vclplug_kde5.mk b/vcl/Library_vclplug_kde5.mk
index 704557150ae5..f011f397d7d3 100644
--- a/vcl/Library_vclplug_kde5.mk
+++ b/vcl/Library_vclplug_kde5.mk
@@ -80,7 +80,6 @@ $(eval $(call gb_Library_add_libs,vclplug_kde5,\
 
 $(eval $(call gb_Library_add_exception_objects,vclplug_kde5,\
     vcl/unx/kde5/KDE5FilePicker2 \
-    vcl/unx/kde5/KDE5SalData \
     vcl/unx/kde5/KDE5SalFrame \
     vcl/unx/kde5/KDE5SalGraphics \
     vcl/unx/kde5/KDE5SalInstance \
diff --git a/vcl/qt5/Qt5Data.cxx b/vcl/qt5/Qt5Data.cxx
index 597a0a4d0a77..9f9bf2557c3d 100644
--- a/vcl/qt5/Qt5Data.cxx
+++ b/vcl/qt5/Qt5Data.cxx
@@ -19,8 +19,10 @@
 
 #include <Qt5Data.hxx>
 
-#include <QtGui/QCursor>
 #include <QtGui/QBitmap>
+#include <QtGui/QCursor>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QStyle>
 
 #include <sal/log.hxx>
 
@@ -156,8 +158,17 @@ Qt5Data::Qt5Data(SalInstance* pInstance)
 {
     ImplSVData* pSVData = ImplGetSVData();
 
-    // draw toolbars on separate lines
     pSVData->maNWFData.mbDockingAreaSeparateTB = true;
+    pSVData->maNWFData.mbFlatMenu = true;
+    pSVData->maNWFData.mbRolloverMenubar = true;
+    pSVData->maNWFData.mbNoFocusRects = true;
+    pSVData->maNWFData.mbNoFocusRectsForFlatButtons = true;
+
+    QStyle* style = QApplication::style();
+    pSVData->maNWFData.mnMenuFormatBorderX = style->pixelMetric(QStyle::PM_MenuPanelWidth)
+                                             + style->pixelMetric(QStyle::PM_MenuHMargin);
+    pSVData->maNWFData.mnMenuFormatBorderY = style->pixelMetric(QStyle::PM_MenuPanelWidth)
+                                             + style->pixelMetric(QStyle::PM_MenuVMargin);
 }
 
 // outline dtor b/c of GlyphCache incomplete type
diff --git a/vcl/unx/kde5/KDE5SalData.cxx b/vcl/unx/kde5/KDE5SalData.cxx
deleted file mode 100644
index 587bf021410b..000000000000
--- a/vcl/unx/kde5/KDE5SalData.cxx
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <QtWidgets/QStyle>
-#include <QtWidgets/QApplication>
-
-#undef Region
-
-#include "KDE5SalData.hxx"
-
-KDE5SalData::KDE5SalData(SalInstance* pInstance)
-    : Qt5Data(pInstance)
-{
-}
-
-KDE5SalData::~KDE5SalData() {}
-
-void KDE5SalData::initNWF()
-{
-    ImplSVData* pSVData = ImplGetSVData();
-
-    // draw toolbars on separate lines
-    pSVData->maNWFData.mbDockingAreaSeparateTB = true;
-    // no borders for menu, theming does that
-    pSVData->maNWFData.mbFlatMenu = true;
-    // Qt theme engines may support a rollover menubar
-    pSVData->maNWFData.mbRolloverMenubar = true;
-
-    pSVData->maNWFData.mbNoFocusRects = true;
-    pSVData->maNWFData.mbNoFocusRectsForFlatButtons = true;
-
-    // Styled menus need additional space
-    QStyle* style = QApplication::style();
-    pSVData->maNWFData.mnMenuFormatBorderX = style->pixelMetric(QStyle::PM_MenuPanelWidth)
-                                             + style->pixelMetric(QStyle::PM_MenuHMargin);
-    pSVData->maNWFData.mnMenuFormatBorderY = style->pixelMetric(QStyle::PM_MenuPanelWidth)
-                                             + style->pixelMetric(QStyle::PM_MenuVMargin);
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5SalData.hxx b/vcl/unx/kde5/KDE5SalData.hxx
deleted file mode 100644
index 500aab2da24f..000000000000
--- a/vcl/unx/kde5/KDE5SalData.hxx
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#pragma once
-
-#include <qt5/Qt5Data.hxx>
-
-class KDE5SalData : public Qt5Data
-{
-public:
-    KDE5SalData(SalInstance* pInstance);
-    virtual ~KDE5SalData() override;
-
-    static void initNWF();
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5SalInstance.cxx b/vcl/unx/kde5/KDE5SalInstance.cxx
index d746d53beace..2a35a3e4ef36 100644
--- a/vcl/unx/kde5/KDE5SalInstance.cxx
+++ b/vcl/unx/kde5/KDE5SalInstance.cxx
@@ -30,8 +30,9 @@
 #include <osl/process.h>
 #include <sal/log.hxx>
 
+#include <Qt5Data.hxx>
+
 #include "KDE5FilePicker.hxx"
-#include "KDE5SalData.hxx"
 #include "KDE5SalInstance.hxx"
 #include "KDE5SalFrame.hxx"
 
@@ -42,8 +43,6 @@ KDE5SalInstance::KDE5SalInstance()
 {
     ImplSVData* pSVData = ImplGetSVData();
     pSVData->maAppData.mxToolkitName = OUString("kde5");
-
-    KDE5SalData::initNWF();
 }
 
 SalFrame* KDE5SalInstance::CreateFrame(SalFrame* pParent, SalFrameStyleFlags nState)
@@ -157,8 +156,7 @@ VCLPLUG_KDE5_PUBLIC SalInstance* create_SalInstance()
 
     KDE5SalInstance* pInstance = new KDE5SalInstance();
 
-    // initialize SalData
-    new KDE5SalData(pInstance);
+    new Qt5Data(pInstance);
 
     pInstance->m_pQApplication.reset(pQApplication);
     pInstance->m_pFakeArgvFreeable.reset(pFakeArgvFreeable);


More information about the Libreoffice-commits mailing list