From d31a6e77478d36798a0b410f6977cda51ae45360 Mon Sep 17 00:00:00 2001 From: Chirag Manwani Date: Fri, 18 Mar 2016 11:09:04 +0530 Subject: tdf#90795 Fix Hyperlink Dialog for HiDPI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I30964d3bd3b5c4433e72be45bfa0202661248051 Reviewed-on: https://gerrit.libreoffice.org/23347 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- cui/source/dialogs/cuihyperdlg.cxx | 25 ++++++++++++++++--------- cui/source/dialogs/hldocntp.cxx | 4 +++- cui/source/dialogs/hldoctp.cxx | 8 ++++++-- cui/source/dialogs/hlinettp.cxx | 4 +++- cui/source/dialogs/hlmailtp.cxx | 4 +++- cui/source/dialogs/hltpbase.cxx | 4 +++- 6 files changed, 34 insertions(+), 15 deletions(-) (limited to 'cui') diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx index 1c872b1d957f..02b29e70f086 100644 --- a/cui/source/dialogs/cuihyperdlg.cxx +++ b/cui/source/dialogs/cuihyperdlg.cxx @@ -25,6 +25,7 @@ #include "hldoctp.hxx" #include "hldocntp.hxx" #include +#include using ::com::sun::star::uno::Reference; using ::com::sun::star::frame::XFrame; @@ -91,25 +92,31 @@ SvxHpLinkDlg::SvxHpLinkDlg (vcl::Window* pParent, SfxBindings* pBindings) SetUniqueId( HID_HYPERLINK_DIALOG ); mbGrabFocus = true; // insert pages - Image aImage; + std::vector imgVector; OUString aStrTitle; SvxIconChoiceCtrlEntry *pEntry; + imgVector.push_back( Image( CUI_RES ( RID_SVXBMP_HLINETTP ) ) ); + imgVector.push_back( Image( CUI_RES ( RID_SVXBMP_HLMAILTP ) ) ); + imgVector.push_back( Image( CUI_RES ( RID_SVXBMP_HLDOCTP ) ) ); + imgVector.push_back( Image( CUI_RES ( RID_SVXBMP_HLDOCNTP ) ) ); + for(Image &aImage : imgVector ) + { + BitmapEx aBitmap = aImage.GetBitmapEx(); + aBitmap.Scale(GetDPIScaleFactor(),GetDPIScaleFactor(),BmpScaleFlag::BestQuality); + aImage = Image(aBitmap); + } aStrTitle = CUI_RESSTR( RID_SVXSTR_HYPERDLG_HLINETTP ); - aImage = Image( CUI_RES ( RID_SVXBMP_HLINETTP ) ); - pEntry = AddTabPage ( RID_SVXPAGE_HYPERLINK_INTERNET, aStrTitle, aImage, SvxHyperlinkInternetTp::Create ); + pEntry = AddTabPage ( RID_SVXPAGE_HYPERLINK_INTERNET, aStrTitle, imgVector[0], SvxHyperlinkInternetTp::Create ); pEntry->SetQuickHelpText( CUI_RESSTR( RID_SVXSTR_HYPERDLG_HLINETTP_HELP ) ); aStrTitle = CUI_RESSTR( RID_SVXSTR_HYPERDLG_HLMAILTP ); - aImage = Image( CUI_RES ( RID_SVXBMP_HLMAILTP ) ); - pEntry = AddTabPage ( RID_SVXPAGE_HYPERLINK_MAIL, aStrTitle, aImage, SvxHyperlinkMailTp::Create ); + pEntry = AddTabPage ( RID_SVXPAGE_HYPERLINK_MAIL, aStrTitle, imgVector[1], SvxHyperlinkMailTp::Create ); pEntry->SetQuickHelpText( CUI_RESSTR( RID_SVXSTR_HYPERDLG_HLMAILTP_HELP ) ); aStrTitle = CUI_RESSTR( RID_SVXSTR_HYPERDLG_HLDOCTP ); - aImage = Image( CUI_RES ( RID_SVXBMP_HLDOCTP ) ); - pEntry = AddTabPage ( RID_SVXPAGE_HYPERLINK_DOCUMENT, aStrTitle, aImage, SvxHyperlinkDocTp::Create ); + pEntry = AddTabPage ( RID_SVXPAGE_HYPERLINK_DOCUMENT, aStrTitle, imgVector[2], SvxHyperlinkDocTp::Create ); pEntry->SetQuickHelpText( CUI_RESSTR( RID_SVXSTR_HYPERDLG_HLDOCTP_HELP ) ); aStrTitle = CUI_RESSTR( RID_SVXSTR_HYPERDLG_HLDOCNTP ); - aImage = Image( CUI_RES ( RID_SVXBMP_HLDOCNTP ) ); - pEntry = AddTabPage ( RID_SVXPAGE_HYPERLINK_NEWDOCUMENT, aStrTitle, aImage, SvxHyperlinkNewDocTp::Create ); + pEntry = AddTabPage ( RID_SVXPAGE_HYPERLINK_NEWDOCUMENT, aStrTitle, imgVector[3], SvxHyperlinkNewDocTp::Create ); pEntry->SetQuickHelpText( CUI_RESSTR( RID_SVXSTR_HYPERDLG_HLDOCNTP_HELP ) ); // set OK/Cancel - button diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx index ec6026ec9a02..479d6a961ed9 100644 --- a/cui/source/dialogs/hldocntp.cxx +++ b/cui/source/dialogs/hldocntp.cxx @@ -105,7 +105,9 @@ SvxHyperlinkNewDocTp::SvxHyperlinkNewDocTp ( vcl::Window *pParent, IconChoiceDia get(m_pCbbPath, "path"); m_pCbbPath->SetSmartProtocol(INetProtocol::File); get(m_pBtCreate, "create"); - m_pBtCreate->SetModeImage(Image(CUI_RES(RID_SVXBMP_NEWDOC))); + BitmapEx aBitmap = Image(CUI_RES(RID_SVXBMP_NEWDOC)).GetBitmapEx(); + aBitmap.Scale(GetDPIScaleFactor(),GetDPIScaleFactor(),BmpScaleFlag::BestQuality ); + m_pBtCreate->SetModeImage(Image(aBitmap)); get(m_pLbDocTypes, "types"); m_pLbDocTypes->set_height_request(m_pLbDocTypes->GetTextHeight() * 5); diff --git a/cui/source/dialogs/hldoctp.cxx b/cui/source/dialogs/hldoctp.cxx index 5fc269e2f450..4deb11d47964 100644 --- a/cui/source/dialogs/hldoctp.cxx +++ b/cui/source/dialogs/hldoctp.cxx @@ -41,11 +41,15 @@ SvxHyperlinkDocTp::SvxHyperlinkDocTp ( vcl::Window *pParent, IconChoiceDialog* p get(m_pCbbPath, "path"); m_pCbbPath->SetSmartProtocol(INetProtocol::File); get(m_pBtFileopen, "fileopen"); - m_pBtFileopen->SetModeImage(Image(CUI_RES(RID_SVXBMP_FILEOPEN))); + BitmapEx aBitmap = Image(CUI_RES(RID_SVXBMP_FILEOPEN)).GetBitmapEx(); + aBitmap.Scale(GetDPIScaleFactor(),GetDPIScaleFactor(),BmpScaleFlag::BestQuality); + m_pBtFileopen->SetModeImage(Image(aBitmap)); get(m_pEdTarget, "target"); get(m_pFtFullURL, "url"); get(m_pBtBrowse, "browse"); - m_pBtBrowse->SetModeImage(Image(CUI_RES(RID_SVXBMP_TARGET))); + aBitmap = Image(CUI_RES(RID_SVXBMP_TARGET)).GetBitmapEx(); + aBitmap.Scale(GetDPIScaleFactor(),GetDPIScaleFactor(),BmpScaleFlag::BestQuality ); + m_pBtBrowse->SetModeImage(Image(aBitmap)); // Disable display of bitmap names. m_pBtBrowse->EnableTextDisplay (false); diff --git a/cui/source/dialogs/hlinettp.cxx b/cui/source/dialogs/hlinettp.cxx index 8f24c212f13b..700a58f6c77e 100644 --- a/cui/source/dialogs/hlinettp.cxx +++ b/cui/source/dialogs/hlinettp.cxx @@ -46,7 +46,9 @@ SvxHyperlinkInternetTp::SvxHyperlinkInternetTp ( vcl::Window *pParent, get(m_pCbbTarget, "target"); m_pCbbTarget->SetSmartProtocol(INetProtocol::Http); get(m_pBtBrowse, "browse"); - m_pBtBrowse->SetModeImage(Image(CUI_RES (RID_SVXBMP_BROWSE))); + BitmapEx aBitmap = Image(CUI_RES (RID_SVXBMP_BROWSE)).GetBitmapEx(); + aBitmap.Scale(GetDPIScaleFactor(),GetDPIScaleFactor(),BmpScaleFlag::BestQuality ); + m_pBtBrowse->SetModeImage(Image(aBitmap)); get(m_pFtLogin, "login_label"); get(m_pEdLogin, "login"); get(m_pFtPassword, "password_label"); diff --git a/cui/source/dialogs/hlmailtp.cxx b/cui/source/dialogs/hlmailtp.cxx index d511cc5663fb..cb40ed8b5280 100644 --- a/cui/source/dialogs/hlmailtp.cxx +++ b/cui/source/dialogs/hlmailtp.cxx @@ -44,7 +44,9 @@ SvxHyperlinkMailTp::SvxHyperlinkMailTp ( vcl::Window *pParent, IconChoiceDialog* get(m_pCbbReceiver, "receiver"); m_pCbbReceiver->SetSmartProtocol(INetProtocol::Mailto); get(m_pBtAdrBook, "adressbook"); - m_pBtAdrBook->SetModeImage(Image(CUI_RES(RID_SVXBMP_ADRESSBOOK))); + BitmapEx aBitmap = Image(CUI_RES(RID_SVXBMP_ADRESSBOOK)).GetBitmapEx(); + aBitmap.Scale(GetDPIScaleFactor(),GetDPIScaleFactor(),BmpScaleFlag::BestQuality ); + m_pBtAdrBook->SetModeImage(Image(aBitmap)); get(m_pFtSubject, "subject_label"); get(m_pEdSubject, "subject"); diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx index c40509eed95c..07cbd4cd3870 100644 --- a/cui/source/dialogs/hltpbase.cxx +++ b/cui/source/dialogs/hltpbase.cxx @@ -199,7 +199,9 @@ void SvxHyperlinkTabPageBase::InitStdControls () get(mpEdIndication, "indication"); get(mpEdText, "name"); get(mpBtScript, "script"); - mpBtScript->SetModeImage(Image(CUI_RES (RID_SVXBMP_SCRIPT))); + BitmapEx aBitmap = Image(CUI_RES (RID_SVXBMP_SCRIPT)).GetBitmapEx(); + aBitmap.Scale(GetDPIScaleFactor(),GetDPIScaleFactor(),BmpScaleFlag::BestQuality ); + mpBtScript->SetModeImage(Image(aBitmap)); mpBtScript->SetClickHdl ( LINK ( this, SvxHyperlinkTabPageBase, ClickScriptHdl_Impl ) ); mpBtScript->EnableTextDisplay (false); -- cgit