[Libreoffice-commits] core.git: vcl/qt5 vcl/unx vcl/win
vcl/qt5/QtFrame.cxx |4 vcl/unx/gtk3/salnativewidgets-gtk.cxx |5 + vcl/win/window/salframe.cxx |4 3 files changed, 13 insertions(+) New commits: commit 169ff786a6694ab412d53c911550db101fb50876 Author: Michael Weghorn AuthorDate: Fri Jul 1 10:45:13 2022 +0200 Commit: Michael Weghorn CommitDate: Sat Jul 2 06:55:15 2022 +0200 tdf#149804 Set newly introduced list box colors from system colors commit 3c6a53b9ce64180b2a03e097c1844f7496f26815 Date: Sat Apr 17 14:49:43 2021 +0200 improve the look of the macOS combobox had introduced separate style colors to be used for list/combo boxes, but since those new colors were not set explicitly for gtk3, qt5/qt6 and Windows, this resulted in style/theme/system colors no longer being used, but only the default colors introduced in above commit. This sets the style/theme/system colors for qt5/qt6, gtk3 and Windows as well, using the same values that were used previously. Change-Id: I31401af38b991e7e0cdc436b894ee0f491a22752 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136735 Reviewed-by: Noel Grandin Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx index 3a240b2808ca..1b9f8ae88175 100644 --- a/vcl/qt5/QtFrame.cxx +++ b/vcl/qt5/QtFrame.cxx @@ -1085,6 +1085,7 @@ void QtFrame::UpdateSettings(AllSettings& rSettings) // Text style.SetFieldTextColor(aText); style.SetFieldRolloverTextColor(aText); +style.SetListBoxWindowTextColor(aText); style.SetWindowTextColor(aText); style.SetToolTextColor(aText); @@ -1092,6 +1093,7 @@ void QtFrame::UpdateSettings(AllSettings& rSettings) style.SetFieldColor(aBase); style.SetWindowColor(aBase); style.SetActiveTabColor(aBase); +style.SetListBoxWindowBackgroundColor(aBase); style.SetAlternatingRowColor(toColor(pal.color(QPalette::Active, QPalette::AlternateBase))); // Buttons @@ -1129,6 +1131,8 @@ void QtFrame::UpdateSettings(AllSettings& rSettings) // Selection style.SetHighlightColor(aHigh); style.SetHighlightTextColor(aHighText); +style.SetListBoxWindowHighlightColor(aHigh); +style.SetListBoxWindowHighlightTextColor(aHighText); style.SetActiveColor(aHigh); style.SetActiveTextColor(aHighText); diff --git a/vcl/unx/gtk3/salnativewidgets-gtk.cxx b/vcl/unx/gtk3/salnativewidgets-gtk.cxx index 3eaffc903e16..3074dd0fbad7 100644 --- a/vcl/unx/gtk3/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/salnativewidgets-gtk.cxx @@ -2306,6 +2306,7 @@ bool GtkSalGraphics::updateSettings(AllSettings& rSettings) aStyleSet.SetButtonTextColor( aTextColor ); aStyleSet.SetDefaultActionButtonTextColor(aTextColor); aStyleSet.SetActionButtonTextColor(aTextColor); +aStyleSet.SetListBoxWindowTextColor( aTextColor ); aStyleSet.SetRadioCheckTextColor( aTextColor ); aStyleSet.SetGroupTextColor( aTextColor ); aStyleSet.SetLabelTextColor( aTextColor ); @@ -2406,6 +2407,8 @@ bool GtkSalGraphics::updateSettings(AllSettings& rSettings) ::Color aHighlightTextColor = getColor( text_color ); aStyleSet.SetHighlightColor( aHighlightColor ); aStyleSet.SetHighlightTextColor( aHighlightTextColor ); +aStyleSet.SetListBoxWindowHighlightColor( aHighlightColor ); +aStyleSet.SetListBoxWindowHighlightTextColor( aHighlightTextColor ); // make active like highlight, except with a small contrast. Note, see // a GtkListBoxRow in a GtkStackSidebar for a gtk widget with a // difference between highlighted and highlighted with focus. @@ -2424,6 +2427,8 @@ bool GtkSalGraphics::updateSettings(AllSettings& rSettings) aStyleSet.SetFieldColor( aBackFieldColor ); // This baby is the default page/paper color aStyleSet.SetWindowColor( aBackFieldColor ); +// listbox background color +aStyleSet.SetListBoxWindowBackgroundColor( aBackFieldColor ); #if GTK_CHECK_VERSION(4, 0, 0) double caretAspectRatio = 0.04f; diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index b419a259c450..598b5ea70fa8 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -2714,10 +2714,14 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings ) aStyleSettings.SetActiveTabColor( aStyleSettings.GetWindowColor() ); aStyleSettings.SetToolTextColor( ImplWinColorToSal( GetSysColor( COLOR_WINDOWTEXT ) ) ); aStyleSettings.SetFieldColor( aStyleSettings.GetWindowColor() ); +aStyleSettings.SetListBoxWindowBackgroundColor( aStyleSettings.GetWindowColor() ); aStyleSettings.SetFieldTextColor( aStyleSettings.GetWindowTextColor() ); aStyleSettings.SetFieldRolloverTextColor( aStyleSettings.GetFieldTextColor() ); +aStyleSettings.SetListBoxWindowTextColor(
[Libreoffice-commits] core.git: vcl/qt5 vcl/unx
vcl/qt5/Qt5Graphics_Controls.cxx |4 ++-- vcl/qt5/Qt5SvpVirtualDevice.hxx |2 +- vcl/unx/kf5/KF5FilePicker.cxx|2 +- vcl/unx/kf5/KF5SalFrame.hxx |4 ++-- vcl/unx/kf5/KF5SalInstance.hxx |2 +- 5 files changed, 7 insertions(+), 7 deletions(-) New commits: commit 8728f287cd490411edc419bf39511a87e98af565 Author: Michael Weghorn AuthorDate: Mon Sep 27 16:47:10 2021 +0200 Commit: Michael Weghorn CommitDate: Wed Sep 29 12:59:37 2021 +0200 qt5/kf5: Drop 'qt5/' prefix from includes 'vcl/inc/qt5' is in the include path for the qt5 and kf5 VCL plugins, so there's no need for this (and it's not used in the other places, either). Change-Id: I1de3afd4399869e318dba2e7786711e65ef83c62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122803 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/vcl/qt5/Qt5Graphics_Controls.cxx b/vcl/qt5/Qt5Graphics_Controls.cxx index 5082e9340b2d..b7ab8d38ccc1 100644 --- a/vcl/qt5/Qt5Graphics_Controls.cxx +++ b/vcl/qt5/Qt5Graphics_Controls.cxx @@ -24,8 +24,8 @@ #include #include -#include -#include +#include +#include #include /** diff --git a/vcl/qt5/Qt5SvpVirtualDevice.hxx b/vcl/qt5/Qt5SvpVirtualDevice.hxx index f961d4ccfed2..3b76a6f5200a 100644 --- a/vcl/qt5/Qt5SvpVirtualDevice.hxx +++ b/vcl/qt5/Qt5SvpVirtualDevice.hxx @@ -20,7 +20,7 @@ #pragma once #include -#include +#include class VCL_DLLPUBLIC Qt5SvpVirtualDevice : public SvpSalVirtualDevice { diff --git a/vcl/unx/kf5/KF5FilePicker.cxx b/vcl/unx/kf5/KF5FilePicker.cxx index 20e64007bd96..c02ac7bc516b 100644 --- a/vcl/unx/kf5/KF5FilePicker.cxx +++ b/vcl/unx/kf5/KF5FilePicker.cxx @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include diff --git a/vcl/unx/kf5/KF5SalFrame.hxx b/vcl/unx/kf5/KF5SalFrame.hxx index d0fdd91978e6..613630b6c9d2 100644 --- a/vcl/unx/kf5/KF5SalFrame.hxx +++ b/vcl/unx/kf5/KF5SalFrame.hxx @@ -21,8 +21,8 @@ #include -#include -#include +#include +#include class QWidget; diff --git a/vcl/unx/kf5/KF5SalInstance.hxx b/vcl/unx/kf5/KF5SalInstance.hxx index 635f51ec9bc7..3009baecd3b0 100644 --- a/vcl/unx/kf5/KF5SalInstance.hxx +++ b/vcl/unx/kf5/KF5SalInstance.hxx @@ -19,7 +19,7 @@ #pragma once -#include +#include class KF5SalInstance final : public Qt5Instance {
[Libreoffice-commits] core.git: vcl/qt5 vcl/unx
vcl/qt5/Qt5Instance.cxx| 18 +++--- vcl/unx/kf5/KF5SalInstance.cxx | 15 --- 2 files changed, 27 insertions(+), 6 deletions(-) New commits: commit 923b30aa27ceb377d6a540c012000e89ce5db31e Author: Jan-Marek Glogowski AuthorDate: Thu Aug 26 13:49:13 2021 +0200 Commit: Jan-Marek Glogowski CommitDate: Thu Aug 26 17:58:03 2021 +0200 tdf#144008 Qt5/Kf5 create frames in the GUI thread There was a 50% chance my pick would have been correct... ok, just half-true, as in hindsight, I should have preferred the secure variant using RunInMain to start with. I thought I could use some templated class functions to get rid of all the copy and paste, but that looked even more ugly. P.S. if you wonder - like myself - about the code formatting in Qt5Instance::CreateFrame: that if from clang-format. Change-Id: I3a6b0c12c9d71ad8e777ed82526d1515a249832c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121091 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx index 432af5e6f718..f1e34d2761b1 100644 --- a/vcl/qt5/Qt5Instance.cxx +++ b/vcl/qt5/Qt5Instance.cxx @@ -285,13 +285,21 @@ void Qt5Instance::deleteObjectLater(QObject* pObject) { pObject->deleteLater(); SalFrame* Qt5Instance::CreateChildFrame(SystemParentData* /*pParent*/, SalFrameStyleFlags nStyle) { -return new Qt5Frame(nullptr, nStyle, m_bUseCairo); +SalFrame* pRet(nullptr); +RunInMainThread([&, this]() { pRet = new Qt5Frame(nullptr, nStyle, useCairo()); }); +assert(pRet); +return pRet; } SalFrame* Qt5Instance::CreateFrame(SalFrame* pParent, SalFrameStyleFlags nStyle) { assert(!pParent || dynamic_cast(pParent)); -return new Qt5Frame(static_cast(pParent), nStyle, m_bUseCairo); + +SalFrame* pRet(nullptr); +RunInMainThread( +[&, this]() { pRet = new Qt5Frame(static_cast(pParent), nStyle, useCairo()); }); +assert(pRet); +return pRet; } void Qt5Instance::DestroyFrame(SalFrame* pFrame) @@ -306,7 +314,11 @@ void Qt5Instance::DestroyFrame(SalFrame* pFrame) SalObject* Qt5Instance::CreateObject(SalFrame* pParent, SystemWindowData*, bool bShow) { assert(!pParent || dynamic_cast(pParent)); -return new Qt5Object(static_cast(pParent), bShow); + +SalObject* pRet(nullptr); +RunInMainThread([&]() { pRet = new Qt5Object(static_cast(pParent), bShow); }); +assert(pRet); +return pRet; } void Qt5Instance::DestroyObject(SalObject* pObject) diff --git a/vcl/unx/kf5/KF5SalInstance.cxx b/vcl/unx/kf5/KF5SalInstance.cxx index 608b5dccc4dc..9279ec50b98b 100644 --- a/vcl/unx/kf5/KF5SalInstance.cxx +++ b/vcl/unx/kf5/KF5SalInstance.cxx @@ -42,13 +42,22 @@ KF5SalInstance::KF5SalInstance(std::unique_ptr& pQApp, bool bUseCa SalFrame* KF5SalInstance::CreateChildFrame(SystemParentData* /*pParent*/, SalFrameStyleFlags nStyle) { -return new KF5SalFrame(nullptr, nStyle, useCairo()); +SalFrame* pRet(nullptr); +RunInMainThread([&, this]() { pRet = new KF5SalFrame(nullptr, nStyle, useCairo()); }); +assert(pRet); +return pRet; } -SalFrame* KF5SalInstance::CreateFrame(SalFrame* pParent, SalFrameStyleFlags nState) +SalFrame* KF5SalInstance::CreateFrame(SalFrame* pParent, SalFrameStyleFlags nStyle) { assert(!pParent || dynamic_cast(pParent)); -return new KF5SalFrame(static_cast(pParent), nState, useCairo()); + +SalFrame* pRet(nullptr); +RunInMainThread([&, this]() { +pRet = new KF5SalFrame(static_cast(pParent), nStyle, useCairo()); +}); +assert(pRet); +return pRet; } bool KF5SalInstance::hasNativeFileSelection() const
[Libreoffice-commits] core.git: vcl/qt5 vcl/unx
vcl/qt5/Qt5Graphics_Controls.cxx |9 +-- vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx | 35 -- 2 files changed, 17 insertions(+), 27 deletions(-) New commits: commit 771f1411c588a02ed276febc9a479323bf4232cd Author: Michael Weghorn AuthorDate: Thu Nov 19 11:23:33 2020 +0100 Commit: Michael Weghorn CommitDate: Thu Nov 19 18:10:24 2020 +0100 tdf#138010 (II) getNativeControlRegion (gtk3/kf5): Consider frame's border Take the frame border/padding into account when calculating the content rectangle (i.e. the area that can safely be drawn into without overlapping the actual frame) when calculating dimensions in 'getNativeControlRegion' regardless of the exact 'DrawFrameFlags' being passed. Previously, gtk3 and qt5 only did this when the 'DrawFrameFlags::NoDraw' flag was passed in addition, but the actual drawing routine 'drawNativeControl' does not make any such distinction, so the frame ended up at a place that was still in the "content rectangle" as calculated previously (which was the same as the bounding rect). Returning the actual content rect is a prerequisite for making 'VclScrolledWindow' take the width of a natively drawn frame into account, which will be done in a follow-up commit. Change-Id: I8d3a3fbd387108a24a0478e3465c8950e6d59735 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106155 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/vcl/qt5/Qt5Graphics_Controls.cxx b/vcl/qt5/Qt5Graphics_Controls.cxx index 6f88d66a1c3b..9d6779621234 100644 --- a/vcl/qt5/Qt5Graphics_Controls.cxx +++ b/vcl/qt5/Qt5Graphics_Controls.cxx @@ -901,13 +901,8 @@ bool Qt5Graphics_Controls::getNativeControlRegion(ControlType type, ControlPart { if (part == ControlPart::Border) { -auto nStyle = static_cast(val.getNumericVal() & 0xFFF0); -if (nStyle & DrawFrameFlags::NoDraw) -{ -int nFrameWidth -= upscale(pixelMetric(QStyle::PM_DefaultFrameWidth), Round::Ceil); -contentRect.adjust(nFrameWidth, nFrameWidth, -nFrameWidth, -nFrameWidth); -} +int nFrameWidth = upscale(pixelMetric(QStyle::PM_DefaultFrameWidth), Round::Ceil); +contentRect.adjust(nFrameWidth, nFrameWidth, -nFrameWidth, -nFrameWidth); retVal = true; } break; diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx index 74f7e421e2f5..6e91fc3503d2 100644 --- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx @@ -2083,30 +2083,25 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar else if (nType == ControlType::Frame && nPart == ControlPart::Border) { aEditRect = rControlRegion; -DrawFrameFlags nStyle = static_cast(rValue.getNumericVal() & 0xfff0); -if (nStyle & DrawFrameFlags::NoDraw) -{ -GtkBorder padding; -gtk_style_context_get_padding(mpFrameInStyle, gtk_style_context_get_state(mpFrameInStyle), ); -GtkBorder border; -gtk_style_context_get_border(mpFrameInStyle, gtk_style_context_get_state(mpFrameInStyle), ); +GtkBorder padding; +gtk_style_context_get_padding(mpFrameInStyle, gtk_style_context_get_state(mpFrameInStyle), ); + +GtkBorder border; +gtk_style_context_get_border(mpFrameInStyle, gtk_style_context_get_state(mpFrameInStyle), ); -int x1 = aEditRect.Left(); -int y1 = aEditRect.Top(); -int x2 = aEditRect.Right(); -int y2 = aEditRect.Bottom(); +int x1 = aEditRect.Left(); +int y1 = aEditRect.Top(); +int x2 = aEditRect.Right(); +int y2 = aEditRect.Bottom(); -rNativeBoundingRegion = aEditRect; -rNativeContentRegion = tools::Rectangle(x1 + (padding.left + border.left), - y1 + (padding.top + border.top), - x2 - (padding.right + border.right), - y2 - (padding.bottom + border.bottom)); +rNativeBoundingRegion = aEditRect; +rNativeContentRegion = tools::Rectangle(x1 + (padding.left + border.left), + y1 + (padding.top + border.top), + x2 - (padding.right + border.right), + y2 - (padding.bottom + border.bottom)); -return true; -} -else -rNativeContentRegion = rControlRegion; +return true; } else { ___ Libreoffice-commits mailing list
[Libreoffice-commits] core.git: vcl/qt5 vcl/unx
vcl/qt5/Qt5Graphics_GDI.cxx |4 ++-- vcl/qt5/Qt5Instance.cxx |2 ++ vcl/unx/kde5/KDE5SalGraphics.cxx |4 ++-- vcl/unx/kde5/KDE5SalInstance.cxx |2 ++ 4 files changed, 8 insertions(+), 4 deletions(-) New commits: commit b4698a2241ec26d796c66da3a814f7cc693785b6 Author: Jan-Marek Glogowski AuthorDate: Fri Mar 29 02:58:59 2019 +0100 Commit: Jan-Marek Glogowski CommitDate: Sat Mar 30 00:51:02 2019 +0100 tdf#124292 Qt5 / KDE5 disable Qt's HiDPI scaling LO does its own layouting and also all the scaling, so disable the automatic HiDPI scaling explicitly. Otherwise fonts will be rendered in LoDPI and just scaled as an image, if UI scaling is enabled in KDE, resulting in really blocky / ugly fonts. Change-Id: I38503ce27c1671e80d0749d21c6c6dcff1a808a6 Reviewed-on: https://gerrit.libreoffice.org/69941 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski diff --git a/vcl/qt5/Qt5Graphics_GDI.cxx b/vcl/qt5/Qt5Graphics_GDI.cxx index e38a10d4fb90..d5186f0d583b 100644 --- a/vcl/qt5/Qt5Graphics_GDI.cxx +++ b/vcl/qt5/Qt5Graphics_GDI.cxx @@ -643,8 +643,8 @@ void Qt5Graphics::GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY) return; QScreen* pScreen = m_pFrame->GetQWidget()->window()->windowHandle()->screen(); -rDPIX = pScreen->logicalDotsPerInchX(); -rDPIY = pScreen->logicalDotsPerInchY(); +rDPIX = pScreen->logicalDotsPerInchX() * pScreen->devicePixelRatio() + 0.5; +rDPIY = pScreen->logicalDotsPerInchY() * pScreen->devicePixelRatio() + 0.5; } sal_uInt16 Qt5Graphics::GetBitCount() const { return getFormatBits(m_pQImage->format()); } diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx index 429b69f90b79..f0d42666e3ce 100644 --- a/vcl/qt5/Qt5Instance.cxx +++ b/vcl/qt5/Qt5Instance.cxx @@ -495,6 +495,8 @@ VCLPLUG_QT5_PUBLIC SalInstance* create_SalInstance() unsetenv("SESSION_MANAGER"); } +QApplication::setAttribute(Qt::AA_DisableHighDpiScaling); + int* pFakeArgc = new int; *pFakeArgc = nFakeArgc; pQApplication = new QApplication(*pFakeArgc, pFakeArgv); diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 290127d0526e..0b4b4283f0da 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -78,8 +78,8 @@ void KDE5SalGraphics::GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY) return; QScreen* pScreen = m_pFrame->GetQWidget()->window()->windowHandle()->screen(); -rDPIX = pScreen->logicalDotsPerInchX(); -rDPIY = pScreen->logicalDotsPerInchY(); +rDPIX = pScreen->logicalDotsPerInchX() * pScreen->devicePixelRatio() + 0.5; +rDPIY = pScreen->logicalDotsPerInchY() * pScreen->devicePixelRatio() + 0.5; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kde5/KDE5SalInstance.cxx b/vcl/unx/kde5/KDE5SalInstance.cxx index 6bca4d88a90c..d746d53beace 100644 --- a/vcl/unx/kde5/KDE5SalInstance.cxx +++ b/vcl/unx/kde5/KDE5SalInstance.cxx @@ -140,6 +140,8 @@ VCLPLUG_KDE5_PUBLIC SalInstance* create_SalInstance() unsetenv("SESSION_MANAGER"); } +QApplication::setAttribute(Qt::AA_DisableHighDpiScaling); + int* pFakeArgc = new int; *pFakeArgc = nFakeArgc; pQApplication = new QApplication(*pFakeArgc, pFakeArgv); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: vcl/qt5 vcl/unx
vcl/qt5/Qt5Instance.cxx |2 +- vcl/unx/kde5/KDE5SalInstance.cxx |2 -- vcl/unx/kde5/KDE5SalInstance.hxx |2 -- 3 files changed, 1 insertion(+), 5 deletions(-) New commits: commit 3448ffae2f2a7a0cdef6626f747b6b95b87f596b Author: Jan-Marek Glogowski AuthorDate: Sat Mar 23 04:16:37 2019 +0100 Commit: Michael Weghorn CommitDate: Sat Mar 23 09:53:12 2019 +0100 Qt5 fix Qt5Instance::IsMainThread() ... and I was wondering why Qt5 didn't start anymore. Looks like it was already broken in my initial commit :-( Now there is also no more need for the KDE5SalInstance "variant". Change-Id: I035d31eaf191b3f2a4255869cea25394470d0dd0 Reviewed-on: https://gerrit.libreoffice.org/69577 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx index 05ebf9aafb1b..429b69f90b79 100644 --- a/vcl/qt5/Qt5Instance.cxx +++ b/vcl/qt5/Qt5Instance.cxx @@ -378,7 +378,7 @@ void Qt5Instance::AddToRecentDocumentList(const OUString&, const OUString&, cons OpenGLContext* Qt5Instance::CreateOpenGLContext() { return new Qt5OpenGLContext; } -bool Qt5Instance::IsMainThread() const { return qApp->thread() != QThread::currentThread(); } +bool Qt5Instance::IsMainThread() const { return qApp->thread() == QThread::currentThread(); } void Qt5Instance::TriggerUserEventProcessing() { diff --git a/vcl/unx/kde5/KDE5SalInstance.cxx b/vcl/unx/kde5/KDE5SalInstance.cxx index 0847e99c0f79..6bca4d88a90c 100644 --- a/vcl/unx/kde5/KDE5SalInstance.cxx +++ b/vcl/unx/kde5/KDE5SalInstance.cxx @@ -86,8 +86,6 @@ KDE5SalInstance::createFolderPicker(const uno::Reference return uno::Reference(new KDE5FilePicker(QFileDialog::Directory)); } -bool KDE5SalInstance::IsMainThread() const { return qApp->thread() == QThread::currentThread(); } - extern "C" { VCLPLUG_KDE5_PUBLIC SalInstance* create_SalInstance() { diff --git a/vcl/unx/kde5/KDE5SalInstance.hxx b/vcl/unx/kde5/KDE5SalInstance.hxx index 5980ea4699cc..dbca2ef3b830 100644 --- a/vcl/unx/kde5/KDE5SalInstance.hxx +++ b/vcl/unx/kde5/KDE5SalInstance.hxx @@ -40,8 +40,6 @@ public: virtual css::uno::Reference createFolderPicker(const css::uno::Reference&) override; -virtual bool IsMainThread() const override; - private: virtual SalFrame* CreateFrame(SalFrame* pParent, SalFrameStyleFlags nStyle) override; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: vcl/qt5 vcl/unx
vcl/qt5/Qt5FilePicker.cxx|8 --- vcl/unx/kde5/KDE5FilePicker.hxx |7 -- vcl/unx/kde5/KDE5FilePicker2.cxx | 40 --- 3 files changed, 5 insertions(+), 50 deletions(-) New commits: commit e180574ff8b6055fc962974042acb9b1ef27690e Author: Michael Weghorn AuthorDate: Wed Feb 6 08:55:59 2019 +0100 Commit: Katarina Behrens CommitDate: Wed Feb 20 16:45:55 2019 +0100 kde5 fpicker: Drop 'getFiles' and 'getSelectedFiles' ... and related signals/slots. Those from the Qt5FilePicker base class do the same thing, except for one 'SolarMutexReleaser' that was commented out in 'KDE5FilePicker::getFiles' for no apparent reason since that line was added in commit 8fb0881a3e5b2. Take over the slightly nicer syntax for the range-based for loop from 'KDE5FilePicker::getSelectedFiles' to 'Qt5FilePicker::getSelectedFiles'. Change-Id: I419f933d256f3b85eccaea85803b4890770efa24 Reviewed-on: https://gerrit.libreoffice.org/68046 Tested-by: Jenkins Reviewed-by: Katarina Behrens diff --git a/vcl/qt5/Qt5FilePicker.cxx b/vcl/qt5/Qt5FilePicker.cxx index 5a0abc2b8d48..37790a7d0349 100644 --- a/vcl/qt5/Qt5FilePicker.cxx +++ b/vcl/qt5/Qt5FilePicker.cxx @@ -300,9 +300,11 @@ uno::Sequence SAL_CALL Qt5FilePicker::getSelectedFiles() } QList urls = m_pFileDialog->selectedUrls(); uno::Sequence seq(urls.size()); -int i = 0; -foreach (const QUrl& url, urls) -seq[i++] = toOUString(url.toString()); + +size_t i = 0; +for (const QUrl& aURL : urls) +seq[i++] = toOUString(aURL.toString()); + return seq; } diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx index 6fff9e44c2a4..451e76af659c 100644 --- a/vcl/unx/kde5/KDE5FilePicker.hxx +++ b/vcl/unx/kde5/KDE5FilePicker.hxx @@ -81,7 +81,6 @@ public: // XFilePicker functions virtual OUString SAL_CALL getDisplayDirectory() override; -virtual css::uno::Sequence SAL_CALL getFiles() override; // XFilterManager functions virtual void SAL_CALL appendFilter(const OUString& rTitle, const OUString& rFilter) override; @@ -117,9 +116,6 @@ public: virtual sal_Bool SAL_CALL getShowState( ); */ -// XFilePicker2 functions -virtual css::uno::Sequence SAL_CALL getSelectedFiles() override; - // XInitialization virtual void SAL_CALL initialize(const css::uno::Sequence& rArguments) override; @@ -161,8 +157,6 @@ Q_SIGNALS: const css::uno::Sequence& rFilters); void setCurrentFilterSignal(const OUString& rFilter); OUString getCurrentFilterSignal(); -css::uno::Sequence getFilesSignal(); -css::uno::Sequence getSelectedFilesSignal(); private Q_SLOTS: OUString getDisplayDirectorySlot() { return implGetDirectory(); } @@ -202,7 +196,6 @@ private Q_SLOTS: void setCurrentFilterSlot(const OUString& rFilter) { return setCurrentFilter(rFilter); } OUString getCurrentFilterSlot() { return getCurrentFilter(); } -css::uno::Sequence getSelectedFilesSlot() { return getFiles(); } }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index 2d295cf128c5..a3f771bcaf9f 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -130,11 +130,6 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) Qt::BlockingQueuedConnection); connect(this, ::enableControlSignal, this, ::enableControlSlot, Qt::BlockingQueuedConnection); -// XFilePicker2 -connect(this, ::getSelectedFilesSignal, this, -::getSelectedFilesSlot, Qt::BlockingQueuedConnection); -connect(this, ::getFilesSignal, this, ::getFiles, -Qt::BlockingQueuedConnection); // used to set the custom controls qApp->installEventFilter(this); @@ -171,41 +166,6 @@ OUString SAL_CALL KDE5FilePicker::getDisplayDirectory() return implGetDirectory(); } -uno::Sequence SAL_CALL KDE5FilePicker::getFiles() -{ -if (qApp->thread() != QThread::currentThread()) -{ -//SolarMutexReleaser aReleaser; -return Q_EMIT getFilesSignal(); -} - -uno::Sequence seq = getSelectedFiles(); -if (seq.getLength() > 1) -seq.realloc(1); -return seq; -} - -// XFilePicker2 -uno::Sequence SAL_CALL KDE5FilePicker::getSelectedFiles() -{ -if (qApp->thread() != QThread::currentThread()) -{ -SolarMutexReleaser aReleaser; -return Q_EMIT getSelectedFilesSignal(); -} - -QList aURLs = m_pFileDialog->selectedUrls(); -uno::Sequence seq(aURLs.size()); - -size_t i = 0; -for (auto& aURL : aURLs) -{ -seq[i++] = toOUString(aURL.toString()); -} - -return seq; -} - // XFilterManager void SAL_CALL KDE5FilePicker::appendFilter(const OUString& title, const OUString& filter) {
[Libreoffice-commits] core.git: vcl/qt5 vcl/unx
vcl/qt5/Qt5Graphics_GDI.cxx |4 ++-- vcl/unx/kde5/KDE5SalFrame.cxx|2 +- vcl/unx/kde5/KDE5SalGraphics.cxx | 25 - vcl/unx/kde5/KDE5SalGraphics.hxx |7 ++- 4 files changed, 33 insertions(+), 5 deletions(-) New commits: commit b0b089e8f7a6df793761bdec6ee9d98b1bf12a5a Author: Jan-Marek Glogowski AuthorDate: Thu Jan 17 14:01:51 2019 + Commit: Jan-Marek Glogowski CommitDate: Fri Jan 25 23:44:29 2019 +0100 Qt5/KDE5 use logicalDotsPerInch to report DPI It looks like all other backend don't use the physical, but the logical DPI to report the resolution. So use the QScreens logical resolution when reporting the DPI values. Also use QScreen for KDE5, as the Svp defaults to 96. This might fix tdf#122131, but since I can't reproduce... Change-Id: Iefc75acf26f8664f2a9ad995edbdc749be2228cf Reviewed-on: https://gerrit.libreoffice.org/66525 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski diff --git a/vcl/qt5/Qt5Graphics_GDI.cxx b/vcl/qt5/Qt5Graphics_GDI.cxx index 156c487ad57d..90baba36d3f0 100644 --- a/vcl/qt5/Qt5Graphics_GDI.cxx +++ b/vcl/qt5/Qt5Graphics_GDI.cxx @@ -643,8 +643,8 @@ void Qt5Graphics::GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY) return; QScreen* pScreen = m_pFrame->GetQWidget()->window()->windowHandle()->screen(); -rDPIX = pScreen->physicalDotsPerInchX(); -rDPIY = pScreen->physicalDotsPerInchY(); +rDPIX = pScreen->logicalDotsPerInchX(); +rDPIY = pScreen->logicalDotsPerInchY(); } sal_uInt16 Qt5Graphics::GetBitCount() const { return getFormatBits(m_pQImage->format()); } diff --git a/vcl/unx/kde5/KDE5SalFrame.cxx b/vcl/unx/kde5/KDE5SalFrame.cxx index 9c82f6ca53b1..ec4a7ff8f45c 100644 --- a/vcl/unx/kde5/KDE5SalFrame.cxx +++ b/vcl/unx/kde5/KDE5SalFrame.cxx @@ -208,7 +208,7 @@ SalGraphics* KDE5SalFrame::AcquireGraphics() if (!m_pKDE5Graphics.get()) { -m_pKDE5Graphics.reset(new KDE5SalGraphics()); +m_pKDE5Graphics.reset(new KDE5SalGraphics(this)); Qt5Frame::InitSvpSalGraphics(m_pKDE5Graphics.get()); } diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 583edf6e8e6c..290127d0526e 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -21,7 +21,11 @@ #include +#include +#include + #include +#include static void QImage2BitmapBuffer(QImage* pImg, BitmapBuffer* pBuf) { @@ -35,8 +39,9 @@ static void QImage2BitmapBuffer(QImage* pImg, BitmapBuffer* pBuf) } } -KDE5SalGraphics::KDE5SalGraphics() +KDE5SalGraphics::KDE5SalGraphics(Qt5Frame* pFrame) : SvpSalGraphics() +, m_pFrame(pFrame) { } @@ -59,4 +64,22 @@ bool KDE5SalGraphics::drawNativeControl(ControlType nType, ControlPart nPart, return bHandled; } +void KDE5SalGraphics::GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY) +{ +char* pForceDpi; +if ((pForceDpi = getenv("SAL_FORCEDPI"))) +{ +OString sForceDPI(pForceDpi); +rDPIX = rDPIY = sForceDPI.toInt32(); +return; +} + +if (!m_pFrame || !m_pFrame->GetQWidget()->window()->windowHandle()) +return; + +QScreen* pScreen = m_pFrame->GetQWidget()->window()->windowHandle()->screen(); +rDPIX = pScreen->logicalDotsPerInchX(); +rDPIY = pScreen->logicalDotsPerInchY(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kde5/KDE5SalGraphics.hxx b/vcl/unx/kde5/KDE5SalGraphics.hxx index d5b01542e877..109a0fa8ac29 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.hxx +++ b/vcl/unx/kde5/KDE5SalGraphics.hxx @@ -29,13 +29,15 @@ #include #include +class Qt5Frame; + /** * Handles native graphics requests and performs the needed drawing operations. */ class KDE5SalGraphics : public SvpSalGraphics { public: -KDE5SalGraphics(); +KDE5SalGraphics(Qt5Frame* pFrame); virtual bool IsNativeControlSupported(ControlType, ControlPart) override; virtual bool hitTestNativeControl(ControlType, ControlPart, const tools::Rectangle&, @@ -48,8 +50,11 @@ public: ControlState, const ImplControlValue&, const OUString&, tools::Rectangle&, tools::Rectangle&) override; +virtual void GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY) override; + private: Qt5Graphics_Controls m_aControl; +Qt5Frame* m_pFrame; }; inline bool KDE5SalGraphics::IsNativeControlSupported(ControlType nType, ControlPart nPart) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: vcl/qt5 vcl/unx
vcl/qt5/Qt5Frame.cxx |6 -- vcl/unx/kde4/KDESalFrame.cxx |6 -- 2 files changed, 12 deletions(-) New commits: commit 89c888b48eca24e25ffe8895542cf7ac9b731187 Author: Jan-Marek Glogowski AuthorDate: Wed Dec 12 12:57:10 2018 +0100 Commit: Jan-Marek Glogowski CommitDate: Wed Dec 12 18:08:21 2018 +0100 Qt5+kde4 don't override generic VCL style settings In commit 3911bf8364da ("tdf#98253 Qt5 rely on VCL for SetDeactiveColor") the named was dropped from the Qt5 styling. This results in SetDeactiveColor now being controlled by LO, but SetActiveColor by the Qt theming. But IMHO both need to be managed together in some way, as the deactive color is normally some variant of active with a lower opacity. Also no other backends except Windows and headless even overide the four general colors Set(De|A)ctive(Text)?Color and Windows is setting them from the window decorations (CAPTION)?! So let's get rid of all these settings for Qt5 and kde4. Change-Id: Id9497dc067e4718d25d24c5795589b6c028a8817 Reviewed-on: https://gerrit.libreoffice.org/65028 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx index c123e8e638ee..87637916fe79 100644 --- a/vcl/qt5/Qt5Frame.cxx +++ b/vcl/qt5/Qt5Frame.cxx @@ -836,12 +836,6 @@ void Qt5Frame::UpdateSettings(AllSettings& rSettings) style.SetToolbarIconSize(ToolbarIconSize::Large); -style.SetActiveColor(toColor(pal.color(QPalette::Active, QPalette::Window))); -// rely on VCL for style.SetDeactiveColor - -style.SetActiveTextColor(toColor(pal.color(QPalette::Active, QPalette::WindowText))); -style.SetDeactiveTextColor(toColor(pal.color(QPalette::Inactive, QPalette::WindowText))); - Color aFore = toColor(pal.color(QPalette::Active, QPalette::WindowText)); Color aBack = toColor(pal.color(QPalette::Active, QPalette::Window)); Color aText = toColor(pal.color(QPalette::Active, QPalette::Text)); diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx index e9b5f4ecc1ba..c92551fe6ca2 100644 --- a/vcl/unx/kde4/KDESalFrame.cxx +++ b/vcl/unx/kde4/KDESalFrame.cxx @@ -170,12 +170,6 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings ) style.SetToolbarIconSize( ToolbarIconSize::Large ); -style.SetActiveColor(toColor(pal.color(QPalette::Active, QPalette::Window))); -style.SetDeactiveColor(toColor(pal.color(QPalette::Inactive, QPalette::Window))); - -style.SetActiveTextColor(toColor(pal.color(QPalette::Active, QPalette::WindowText))); -style.SetDeactiveTextColor(toColor(pal.color(QPalette::Inactive, QPalette::WindowText))); - // Font vcl::Font aFont = toFont( QApplication::font(), rSettings.GetUILanguageTag().getLocale() ); style.BatchSetFonts( aFont, aFont ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: vcl/qt5 vcl/unx
vcl/qt5/Qt5Frame.cxx | 119 ++ vcl/unx/kde5/KDE5SalFrame.cxx | 119 -- 2 files changed, 121 insertions(+), 117 deletions(-) New commits: commit 0927c5b3101064905028aeaff2c266771c6e09b3 Author: Jan-Marek Glogowski AuthorDate: Thu Aug 9 14:51:41 2018 +0200 Commit: Jan-Marek Glogowski CommitDate: Fri Aug 10 09:46:34 2018 +0200 Qt5 also move color setting handling from kde5 This is all QStyle based. Font handling still to do. Change-Id: I784e64aa88d013146e2c9a07051a0a76a1369ff0 Reviewed-on: https://gerrit.libreoffice.org/58788 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx index cabee2b2d2dc..86854c9b3fd8 100644 --- a/vcl/qt5/Qt5Frame.cxx +++ b/vcl/qt5/Qt5Frame.cxx @@ -31,7 +31,10 @@ #include #include #include +#include +#include #include +#include #include #include @@ -473,13 +476,129 @@ bool Qt5Frame::MapUnicodeToKeyCode(sal_Unicode /*aUnicode*/, LanguageType /*aLan LanguageType Qt5Frame::GetInputLanguage() { return LANGUAGE_DONTKNOW; } +static Color toColor(const QColor& rColor) +{ +return Color(rColor.red(), rColor.green(), rColor.blue()); +} + void Qt5Frame::UpdateSettings(AllSettings& rSettings) { StyleSettings style(rSettings.GetStyleSettings()); +// General settings +QPalette pal = QApplication::palette(); + +style.SetToolbarIconSize(ToolbarIconSize::Large); + +style.SetActiveColor(toColor(pal.color(QPalette::Active, QPalette::Window))); +style.SetDeactiveColor(toColor(pal.color(QPalette::Inactive, QPalette::Window))); + +style.SetActiveTextColor(toColor(pal.color(QPalette::Active, QPalette::WindowText))); +style.SetDeactiveTextColor(toColor(pal.color(QPalette::Inactive, QPalette::WindowText))); + +Color aFore = toColor(pal.color(QPalette::Active, QPalette::WindowText)); +Color aBack = toColor(pal.color(QPalette::Active, QPalette::Window)); +Color aText = toColor(pal.color(QPalette::Active, QPalette::Text)); +Color aBase = toColor(pal.color(QPalette::Active, QPalette::Base)); +Color aButn = toColor(pal.color(QPalette::Active, QPalette::ButtonText)); +Color aMid = toColor(pal.color(QPalette::Active, QPalette::Mid)); +Color aHigh = toColor(pal.color(QPalette::Active, QPalette::Highlight)); +Color aHighText = toColor(pal.color(QPalette::Active, QPalette::HighlightedText)); + +style.SetSkipDisabledInMenus(true); + +// Foreground +style.SetRadioCheckTextColor(aFore); +style.SetLabelTextColor(aFore); +style.SetDialogTextColor(aFore); +style.SetGroupTextColor(aFore); + +// Text +style.SetFieldTextColor(aText); +style.SetFieldRolloverTextColor(aText); +style.SetWindowTextColor(aText); +style.SetToolTextColor(aText); + +// Base +style.SetFieldColor(aBase); +style.SetWindowColor(aBase); +style.SetActiveTabColor(aBase); + +// Buttons +style.SetButtonTextColor(aButn); +style.SetButtonRolloverTextColor(aButn); +style.SetButtonPressedRolloverTextColor(aButn); + +// Tabs +style.SetTabTextColor(aButn); +style.SetTabRolloverTextColor(aButn); +style.SetTabHighlightTextColor(aButn); + +// Disable color +style.SetDisableColor(toColor(pal.color(QPalette::Disabled, QPalette::WindowText))); + +// Background +style.BatchSetBackgrounds(aBack); +style.SetInactiveTabColor(aBack); + +// Workspace +style.SetWorkspaceColor(aMid); + +// Selection +style.SetHighlightColor(aHigh); +style.SetHighlightTextColor(aHighText); + +// Tooltip +style.SetHelpColor(toColor(QToolTip::palette().color(QPalette::Active, QPalette::ToolTipBase))); +style.SetHelpTextColor( +toColor(QToolTip::palette().color(QPalette::Active, QPalette::ToolTipText))); + const int flash_time = QApplication::cursorFlashTime(); style.SetCursorBlinkTime(flash_time != 0 ? flash_time / 2 : STYLE_CURSOR_NOBLINKTIME); +// Menu +std::unique_ptr pMenuBar = std::unique_ptr(new QMenuBar()); +QPalette qMenuCG = pMenuBar->palette(); + +// Menu text and background color, theme specific +Color aMenuFore = toColor(qMenuCG.color(QPalette::WindowText)); +Color aMenuBack = toColor(qMenuCG.color(QPalette::Window)); + +style.SetMenuTextColor(aMenuFore); + style.SetMenuBarTextColor(style.GetPersonaMenuBarTextColor().get_value_or(aMenuFore)); +style.SetMenuColor(aMenuBack); +style.SetMenuBarColor(aMenuBack); +style.SetMenuHighlightColor(toColor(qMenuCG.color(QPalette::Highlight))); + style.SetMenuHighlightTextColor(toColor(qMenuCG.color(QPalette::HighlightedText))); + +// set special menubar highlight text color +if (QApplication::style()->inherits("HighContrastStyle")) +ImplGetSVData()->maNWFData.maMenuBarHighlightTextColor +=