Kaydet (Commit) fb8d0502 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

refactor AboutDialog to use RenderContext

Change-Id: I7ce9df8c9f26d417d2400628cbb91f8ae18bc4d6
üst 95887e62
...@@ -160,23 +160,25 @@ void AboutDialog::StyleControls() ...@@ -160,23 +160,25 @@ void AboutDialog::StyleControls()
m_pDescriptionText->SetPaintTransparent(true); m_pDescriptionText->SetPaintTransparent(true);
m_pCopyrightText->SetPaintTransparent(true); m_pCopyrightText->SetPaintTransparent(true);
vcl::Font aLabelFont = GetSettings().GetStyleSettings().GetLabelFont(); const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
vcl::Font aLabelFont = rStyleSettings.GetLabelFont();
vcl::Font aLargeFont = aLabelFont; vcl::Font aLargeFont = aLabelFont;
aLargeFont.SetSize( Size( 0, aLabelFont.GetSize().Height() * 3 ) ); aLargeFont.SetSize(Size( 0, aLabelFont.GetSize().Height() * 3));
// Logo Replacement Text // Logo Replacement Text
m_pLogoReplacement->SetControlFont( aLargeFont ); m_pLogoReplacement->SetControlFont(aLargeFont);
// Description Text // Description Text
aLargeFont.SetSize( Size( 0, aLabelFont.GetSize().Height() * 1.3 ) ); aLargeFont.SetSize(Size(0, aLabelFont.GetSize().Height() * 1.3));
m_pDescriptionText->SetControlFont(aLargeFont); m_pDescriptionText->SetControlFont(aLargeFont);
// Version Text // Version Text
aLargeFont.SetSize( Size( 0, aLabelFont.GetSize().Height() * 1.2 ) ); aLargeFont.SetSize(Size(0, aLabelFont.GetSize().Height() * 1.2));
m_pVersion->SetControlFont(aLargeFont); m_pVersion->SetControlFont(aLargeFont);
// If not in high-contrast mode, hard-code colors // If not in high-contrast mode, hard-code colors
if ( !(Application::GetSettings().GetStyleSettings().GetHighContrastMode()) ) if (!rStyleSettings.GetHighContrastMode())
{ {
m_pLogoReplacement->SetControlForeground(Color(51, 51, 51)); m_pLogoReplacement->SetControlForeground(Color(51, 51, 51));
m_pVersion->SetControlForeground(Color(102, 102, 102)); m_pVersion->SetControlForeground(Color(102, 102, 102));
...@@ -195,8 +197,8 @@ void AboutDialog::SetLogo() ...@@ -195,8 +197,8 @@ void AboutDialog::SetLogo()
aDrawOpt.SetAntiAliasing(true); aDrawOpt.SetAntiAliasing(true);
// load svg logo, specify desired width, scale height isotrophically // load svg logo, specify desired width, scale height isotrophically
if( SfxApplication::loadBrandSvg("flat_logo", aLogoBitmap, nWidth) && if (SfxApplication::loadBrandSvg("flat_logo", aLogoBitmap, nWidth) &&
!aLogoBitmap.IsEmpty() ) !aLogoBitmap.IsEmpty())
{ {
m_pLogoImage->SetImage(Image(aLogoBitmap)); m_pLogoImage->SetImage(Image(aLogoBitmap));
m_pLogoReplacement->Hide(); m_pLogoReplacement->Hide();
...@@ -213,21 +215,23 @@ void AboutDialog::SetLogo() ...@@ -213,21 +215,23 @@ void AboutDialog::SetLogo()
void AboutDialog::Resize() void AboutDialog::Resize()
{ {
SfxModalDialog::Resize(); SfxModalDialog::Resize();
// Load background image // Load background image
if (isInitialLayout(this) && !(Application::GetSettings().GetStyleSettings().GetHighContrastMode())) if (isInitialLayout(this) && !(Application::GetSettings().GetStyleSettings().GetHighContrastMode()))
{ {
SfxApplication::loadBrandSvg("shell/about", aBackgroundBitmap, GetOutputSizePixel().Width()); SfxApplication::loadBrandSvg("shell/about", aBackgroundBitmap, GetSizePixel().Width());
} }
} }
void AboutDialog::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& rRect ) void AboutDialog::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect)
{ {
SetClipRegion(vcl::Region(rRect)); rRenderContext.SetClipRegion(vcl::Region(rRect));
Size aSize(GetOutputSizePixel()); Size aSize(rRenderContext.GetOutputSizePixel());
Point aPos(aSize.Width() - aBackgroundBitmap.GetSizePixel().Width(), Point aPos(aSize.Width() - aBackgroundBitmap.GetSizePixel().Width(),
aSize.Height() - aBackgroundBitmap.GetSizePixel().Height()); aSize.Height() - aBackgroundBitmap.GetSizePixel().Height());
DrawBitmapEx(aPos, aBackgroundBitmap);
rRenderContext.DrawBitmapEx(aPos, aBackgroundBitmap);
} }
OUString AboutDialog::GetBuildId() OUString AboutDialog::GetBuildId()
...@@ -274,9 +278,7 @@ OUString AboutDialog::GetVersionString() ...@@ -274,9 +278,7 @@ OUString AboutDialog::GetVersionString()
OUString sVersion = m_aVersionTextStr; OUString sVersion = m_aVersionTextStr;
#ifdef _WIN64 #ifdef _WIN64
sVersion += " (x64)"; sVersion += " (x64)";
#endif #endif
OUString sBuildId = GetBuildId(); OUString sBuildId = GetBuildId();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment