diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2023-08-25 18:01:32 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2023-08-31 10:15:45 +0200 |
commit | 3fad74eb9def27788faddd74f5285120e0aefdd9 (patch) | |
tree | 6268c8401e3e375e51ebc5715d7b6899185678fc /vcl/source/window/window.cxx | |
parent | eecf74196b852cddaaffbf7e0442fd2abbc36a5d (diff) |
jsdialog: render font previews with hidpi
we pass dpi scale, let's use it to determine combobox entry size
Change-Id: I4088eca565b301c5693e52b1c05af1a335fc34fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156115
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156251
Tested-by: Jenkins
Diffstat (limited to 'vcl/source/window/window.cxx')
-rw-r--r-- | vcl/source/window/window.cxx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 869516b45902..35b17761e2c4 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -1374,17 +1374,20 @@ void Window::ImplInitResolutionSettings() } } -void Window::ImplPointToLogic(vcl::RenderContext const & rRenderContext, vcl::Font& rFont) const +void Window::ImplPointToLogic(vcl::RenderContext const & rRenderContext, vcl::Font& rFont, + bool bUseRenderContextDPI) const { Size aSize = rFont.GetFontSize(); if (aSize.Width()) { - aSize.setWidth( aSize.Width() * ( mpWindowImpl->mpFrameData->mnDPIX) ); + aSize.setWidth( aSize.Width() * + ( bUseRenderContextDPI ? rRenderContext.GetDPIX() : mpWindowImpl->mpFrameData->mnDPIX) ); aSize.AdjustWidth(72 / 2 ); aSize.setWidth( aSize.Width() / 72 ); } - aSize.setHeight( aSize.Height() * ( mpWindowImpl->mpFrameData->mnDPIY) ); + aSize.setHeight( aSize.Height() + * ( bUseRenderContextDPI ? rRenderContext.GetDPIY() : mpWindowImpl->mpFrameData->mnDPIY) ); aSize.AdjustHeight(72/2 ); aSize.setHeight( aSize.Height() / 72 ); @@ -2170,10 +2173,11 @@ void Window::CollectChildren(::std::vector<vcl::Window *>& rAllChildren ) } } -void Window::SetPointFont(vcl::RenderContext& rRenderContext, const vcl::Font& rFont) +void Window::SetPointFont(vcl::RenderContext& rRenderContext, const vcl::Font& rFont, + bool bUseRenderContextDPI) { vcl::Font aFont = rFont; - ImplPointToLogic(rRenderContext, aFont); + ImplPointToLogic(rRenderContext, aFont, bUseRenderContextDPI); rRenderContext.SetFont(aFont); } |