Fix the About dialog rendering when librsvg is not available / functional.
Change-Id: Ib460f3cbf44114ef74065168b218daca51f2f0e9
This commit is contained in:
@@ -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
|
||||
vcl::RenderGraphicRasterizer aRasterizerLogo = Application::LoadBrandSVG("flat_logo");
|
||||
float aLogoWidthHeightRatio = (float)aRasterizerLogo.GetDefaultSizePixel().Width() /
|
||||
(float)aRasterizerLogo.GetDefaultSizePixel().Height();
|
||||
|
||||
Size aLogoSize( aIdealTextWidth, aIdealTextWidth / aLogoWidthHeightRatio );
|
||||
Size aLogoSize( aIdealTextWidth, aIdealTextWidth / 20 );
|
||||
Point aLogoPos( aDialogBorder, aDialogBorder );
|
||||
aLogoBitmap = aRasterizerLogo.Rasterize( aLogoSize );
|
||||
aLogoImage.SetImage( Image( aLogoBitmap ) );
|
||||
aLogoImage.SetPosSizePixel( aLogoPos, aLogoSize );
|
||||
|
||||
vcl::RenderGraphicRasterizer aRasterizerLogo = Application::LoadBrandSVG("flat_logo");
|
||||
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 );
|
||||
|
||||
aLogoBitmap = aRasterizerLogo.Rasterize( aLogoSize );
|
||||
aLogoImage.SetImage( Image( aLogoBitmap ) );
|
||||
aLogoImage.SetPosSizePixel( aLogoPos, aLogoSize );
|
||||
}
|
||||
|
||||
// Position version text
|
||||
sal_Int32 aLogoVersionSpacing = aLogoSize.Height() * 0.15;
|
||||
|
@@ -114,7 +114,4 @@ ModalDialog RID_DEFAULTABOUT
|
||||
DefButton = TRUE ;
|
||||
Text [ en-US ] = "~Close";
|
||||
};
|
||||
FixedImage ABOUT_IMAGE_LOGO
|
||||
{
|
||||
};
|
||||
};
|
||||
|
@@ -122,8 +122,9 @@ vcl::RenderGraphicRasterizer Application::LoadBrandSVG (const char* pName)
|
||||
aRasterizer = loadSvg ("$BRAND_BASE_DIR/program/edition", aName);
|
||||
if (!aRasterizer.GetRenderGraphic().IsEmpty())
|
||||
return aRasterizer;
|
||||
|
||||
aRasterizer = loadSvg ("$BRAND_BASE_DIR/program", aName);
|
||||
return aRasterizer;
|
||||
return aRasterizer;
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
Reference in New Issue
Block a user