summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChirag Manwani <cmkmanwani@gmail.com>2016-03-18 11:09:04 +0530
committerTomaž Vajngerl <quikee@gmail.com>2016-03-28 01:54:35 +0000
commitd31a6e77478d36798a0b410f6977cda51ae45360 (patch)
tree84621fd281091e19ad67e1fb3e6edc3a2e1f5ef0
parent454ad54ccfbfd09c46a46211a9469d3d85050fbd (diff)
tdf#90795 Fix Hyperlink Dialog for HiDPI
Change-Id: I30964d3bd3b5c4433e72be45bfa0202661248051 Reviewed-on: https://gerrit.libreoffice.org/23347 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r--cui/source/dialogs/cuihyperdlg.cxx25
-rw-r--r--cui/source/dialogs/hldocntp.cxx4
-rw-r--r--cui/source/dialogs/hldoctp.cxx8
-rw-r--r--cui/source/dialogs/hlinettp.cxx4
-rw-r--r--cui/source/dialogs/hlmailtp.cxx4
-rw-r--r--cui/source/dialogs/hltpbase.cxx4
-rw-r--r--svtools/source/contnr/imivctl1.cxx14
-rw-r--r--svtools/source/contnr/ivctrl.cxx1
8 files changed, 45 insertions, 19 deletions
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 <svx/svxids.hrc>
+#include <vector>
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<Image> 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);
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index dbfb1d1cf0d8..794fdfca4fbb 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -94,7 +94,7 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl(
aVerSBar( VclPtr<ScrollBar>::Create(pCurView, WB_DRAG | WB_VSCROLL) ),
aHorSBar( VclPtr<ScrollBar>::Create(pCurView, WB_DRAG | WB_HSCROLL) ),
aScrBarBox( VclPtr<ScrollBarBox>::Create(pCurView) ),
- aImageSize( 32, 32 ),
+ aImageSize( 32 * pCurView->GetDPIScaleFactor(), 32 * pCurView->GetDPIScaleFactor()),
m_pColumns( nullptr )
{
bChooseWithCursor = false;
@@ -147,8 +147,12 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl(
aVisRectChangedIdle.SetIdleHdl(LINK(this,SvxIconChoiceCtrl_Impl,VisRectChangedHdl));
Clear( true );
-
- SetGrid( Size(100, 70) );
+ Size gridSize(100,70);
+ if(pView->GetDPIScaleFactor() > 1)
+ {
+ gridSize.Height() *= pView->GetDPIScaleFactor();
+ }
+ SetGrid(gridSize);
}
SvxIconChoiceCtrl_Impl::~SvxIconChoiceCtrl_Impl()
@@ -2420,6 +2424,10 @@ void SvxIconChoiceCtrl_Impl::SetDefaultTextSize()
long nHeight = pView->GetTextHeight();
if (nDY < nHeight)
nDY = nHeight;
+ if(pView->GetDPIScaleFactor() > 1)
+ {
+ nDY*=2;
+ }
aDefaultTextSize = Size(nDX, nDY);
}
diff --git a/svtools/source/contnr/ivctrl.cxx b/svtools/source/contnr/ivctrl.cxx
index e2480983003a..43041ecbf1ac 100644
--- a/svtools/source/contnr/ivctrl.cxx
+++ b/svtools/source/contnr/ivctrl.cxx
@@ -80,7 +80,6 @@ SvtIconChoiceCtrl::SvtIconChoiceCtrl( vcl::Window* pParent, WinBits nWinStyle )
{
SetLineColor();
- _pImp->SetGrid( Size( 100, 70 ) );
_pImp->InitSettings();
_pImp->SetPositionMode( IcnViewPositionModeAutoArrange );
}