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() ) ),
|
aDescriptionText ( this, ResId( ABOUT_DESCRIPTION_TEXT, *rId.GetResMgr() ) ),
|
||||||
aCopyrightText ( this, ResId( ABOUT_COPYRIGHT_TEXT, *rId.GetResMgr() ) ),
|
aCopyrightText ( this, ResId( ABOUT_COPYRIGHT_TEXT, *rId.GetResMgr() ) ),
|
||||||
aCopyrightTextShadow ( 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() ) ),
|
aCreditsButton ( this, ResId( ABOUT_BTN_CREDITS, *rId.GetResMgr() ) ),
|
||||||
aWebsiteButton ( this, ResId( ABOUT_BTN_WEBSITE, *rId.GetResMgr() ) ),
|
aWebsiteButton ( this, ResId( ABOUT_BTN_WEBSITE, *rId.GetResMgr() ) ),
|
||||||
aCancelButton ( this, ResId( ABOUT_BTN_CANCEL, *rId.GetResMgr() ) ),
|
aCancelButton ( this, ResId( ABOUT_BTN_CANCEL, *rId.GetResMgr() ) ),
|
||||||
@@ -191,15 +191,20 @@ void AboutDialog::LayoutControls()
|
|||||||
Size aDialogSize ( aIdealTextWidth + aDialogBorder * 2, 0);
|
Size aDialogSize ( aIdealTextWidth + aDialogBorder * 2, 0);
|
||||||
|
|
||||||
// Render and Position Logo
|
// Render and Position Logo
|
||||||
vcl::RenderGraphicRasterizer aRasterizerLogo = Application::LoadBrandSVG("flat_logo");
|
Size aLogoSize( aIdealTextWidth, aIdealTextWidth / 20 );
|
||||||
float aLogoWidthHeightRatio = (float)aRasterizerLogo.GetDefaultSizePixel().Width() /
|
|
||||||
(float)aRasterizerLogo.GetDefaultSizePixel().Height();
|
|
||||||
|
|
||||||
Size aLogoSize( aIdealTextWidth, aIdealTextWidth / aLogoWidthHeightRatio );
|
|
||||||
Point aLogoPos( aDialogBorder, aDialogBorder );
|
Point aLogoPos( aDialogBorder, aDialogBorder );
|
||||||
|
|
||||||
|
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 );
|
aLogoBitmap = aRasterizerLogo.Rasterize( aLogoSize );
|
||||||
aLogoImage.SetImage( Image( aLogoBitmap ) );
|
aLogoImage.SetImage( Image( aLogoBitmap ) );
|
||||||
aLogoImage.SetPosSizePixel( aLogoPos, aLogoSize );
|
aLogoImage.SetPosSizePixel( aLogoPos, aLogoSize );
|
||||||
|
}
|
||||||
|
|
||||||
// Position version text
|
// Position version text
|
||||||
sal_Int32 aLogoVersionSpacing = aLogoSize.Height() * 0.15;
|
sal_Int32 aLogoVersionSpacing = aLogoSize.Height() * 0.15;
|
||||||
|
@@ -114,7 +114,4 @@ ModalDialog RID_DEFAULTABOUT
|
|||||||
DefButton = TRUE ;
|
DefButton = TRUE ;
|
||||||
Text [ en-US ] = "~Close";
|
Text [ en-US ] = "~Close";
|
||||||
};
|
};
|
||||||
FixedImage ABOUT_IMAGE_LOGO
|
|
||||||
{
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
@@ -122,6 +122,7 @@ vcl::RenderGraphicRasterizer Application::LoadBrandSVG (const char* pName)
|
|||||||
aRasterizer = loadSvg ("$BRAND_BASE_DIR/program/edition", aName);
|
aRasterizer = loadSvg ("$BRAND_BASE_DIR/program/edition", aName);
|
||||||
if (!aRasterizer.GetRenderGraphic().IsEmpty())
|
if (!aRasterizer.GetRenderGraphic().IsEmpty())
|
||||||
return aRasterizer;
|
return aRasterizer;
|
||||||
|
|
||||||
aRasterizer = loadSvg ("$BRAND_BASE_DIR/program", aName);
|
aRasterizer = loadSvg ("$BRAND_BASE_DIR/program", aName);
|
||||||
return aRasterizer;
|
return aRasterizer;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user