diff options
author | Jan Holesovsky <kendy@suse.cz> | 2012-07-13 15:36:28 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2012-07-13 15:37:17 +0200 |
commit | debfb21c927e39ab18aafb1895f343840967e16a (patch) | |
tree | f7e353ec52bef41684b0d85048439df0f74f9a0d /cui | |
parent | 05a0aaa25efc53c4cfa8a955dbf96bbb63b8bc98 (diff) |
Fix the About dialog rendering when librsvg is not available / functional.
Change-Id: Ib460f3cbf44114ef74065168b218daca51f2f0e9
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/about.cxx | 21 | ||||
-rw-r--r-- | cui/source/dialogs/about.src | 3 |
2 files changed, 13 insertions, 11 deletions
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx index 6dc820d2e5cb..cdf63a58e583 100644 --- a/cui/source/dialogs/about.cxx +++ b/cui/source/dialogs/about.cxx @@ -74,7 +74,7 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId) : aDescriptionText ( this, ResId( ABOUT_DESCRIPTION_TEXT, *rId.GetResMgr() ) ), aCopyrightText ( this, ResId( ABOUT_COPYRIGHT_TEXT, *rId.GetResMgr() ) ), aCopyrightTextShadow ( this, ResId( ABOUT_COPYRIGHT_TEXT, *rId.GetResMgr() ) ), - aLogoImage ( this, ResId( ABOUT_IMAGE_LOGO, *rId.GetResMgr() ) ), + aLogoImage ( this ), aCreditsButton ( this, ResId( ABOUT_BTN_CREDITS, *rId.GetResMgr() ) ), aWebsiteButton ( this, ResId( ABOUT_BTN_WEBSITE, *rId.GetResMgr() ) ), aCancelButton ( this, ResId( ABOUT_BTN_CANCEL, *rId.GetResMgr() ) ), @@ -191,15 +191,20 @@ void AboutDialog::LayoutControls() Size aDialogSize ( aIdealTextWidth + aDialogBorder * 2, 0); // Render and Position Logo + Size aLogoSize( aIdealTextWidth, aIdealTextWidth / 20 ); + Point aLogoPos( aDialogBorder, aDialogBorder ); + vcl::RenderGraphicRasterizer aRasterizerLogo = Application::LoadBrandSVG("flat_logo"); - float aLogoWidthHeightRatio = (float)aRasterizerLogo.GetDefaultSizePixel().Width() / - (float)aRasterizerLogo.GetDefaultSizePixel().Height(); + if ( !aRasterizerLogo.GetRenderGraphic().IsEmpty() && + aRasterizerLogo.GetDefaultSizePixel().Width() > 0 && aRasterizerLogo.GetDefaultSizePixel().Height() > 0 ) + { + const float aLogoWidthHeightRatio = (float)aRasterizerLogo.GetDefaultSizePixel().Width() / (float)aRasterizerLogo.GetDefaultSizePixel().Height(); + aLogoSize = Size( aIdealTextWidth, aIdealTextWidth / aLogoWidthHeightRatio ); - Size aLogoSize( aIdealTextWidth, aIdealTextWidth / aLogoWidthHeightRatio ); - Point aLogoPos( aDialogBorder, aDialogBorder ); - aLogoBitmap = aRasterizerLogo.Rasterize( aLogoSize ); - aLogoImage.SetImage( Image( aLogoBitmap ) ); - aLogoImage.SetPosSizePixel( aLogoPos, aLogoSize ); + aLogoBitmap = aRasterizerLogo.Rasterize( aLogoSize ); + aLogoImage.SetImage( Image( aLogoBitmap ) ); + aLogoImage.SetPosSizePixel( aLogoPos, aLogoSize ); + } // Position version text sal_Int32 aLogoVersionSpacing = aLogoSize.Height() * 0.15; diff --git a/cui/source/dialogs/about.src b/cui/source/dialogs/about.src index ab853c665a46..37938644f83a 100644 --- a/cui/source/dialogs/about.src +++ b/cui/source/dialogs/about.src @@ -114,7 +114,4 @@ ModalDialog RID_DEFAULTABOUT DefButton = TRUE ; Text [ en-US ] = "~Close"; }; - FixedImage ABOUT_IMAGE_LOGO - { - }; }; |