Kaydet (Commit) ae1e2365 authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

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: 's avatarJan-Marek Glogowski <glogow@fbihome.de>
üst 558956dc
......@@ -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 \
......
......@@ -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
......
/* -*- 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: */
/* -*- 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: */
......@@ -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);
......
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