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

ApplySettings for dialog

Change-Id: I30f26799e0dfa059ad754eead5ba382f44bf1310
üst 6fa87f3f
......@@ -53,6 +53,8 @@ private:
SAL_DLLPRIVATE void ImplInitDialogData();
SAL_DLLPRIVATE void ImplInitSettings();
virtual void ApplySettings(vcl::RenderContext& rRenderContext);
SAL_DLLPRIVATE Dialog (const Dialog &) SAL_DELETED_FUNCTION;
SAL_DLLPRIVATE Dialog & operator= (const Dialog &) SAL_DELETED_FUNCTION;
......
......@@ -44,11 +44,15 @@ private:
QuickHelpFlags mnStyle;
protected:
DECL_LINK_TYPED( TimerHdl, Timer*, void );
virtual void Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& ) SAL_OVERRIDE;
virtual void RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE;
virtual OUString GetText() const SAL_OVERRIDE;
void ImplShow();
DECL_LINK_TYPED( TimerHdl, Timer*, void );
virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle&) SAL_OVERRIDE;
virtual void RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE;
virtual void ApplySettings(vcl::RenderContext& rRenderContext) SAL_OVERRIDE;
virtual OUString GetText() const SAL_OVERRIDE;
void ImplShow();
public:
HelpTextWindow( vcl::Window* pParent, const OUString& rText, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle );
......
......@@ -253,17 +253,18 @@ HelpTextWindow::HelpTextWindow( vcl::Window* pParent, const OUString& rText, sal
// FIXME RenderContext
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
SetPointFont(*this, rStyleSettings.GetHelpFont());
SetTextColor( rStyleSettings.GetHelpTextColor() );
SetTextAlign( ALIGN_TOP );
if ( IsNativeControlSupported( CTRL_TOOLTIP, PART_ENTIRE_CONTROL ) )
SetTextColor(rStyleSettings.GetHelpTextColor());
SetTextAlign(ALIGN_TOP);
if (IsNativeControlSupported(CTRL_TOOLTIP, PART_ENTIRE_CONTROL))
{
EnableChildTransparentMode( true );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
SetPaintTransparent( true );
EnableChildTransparentMode(true);
SetParentClipMode(PARENTCLIPMODE_NOCLIP);
SetPaintTransparent(true);
SetBackground();
}
else
SetBackground( Wallpaper( rStyleSettings.GetHelpColor() ) );
SetBackground(Wallpaper(rStyleSettings.GetHelpColor()));
if( rStyleSettings.GetHelpColor().IsDark() )
SetLineColor( COL_WHITE );
else
......@@ -289,6 +290,30 @@ HelpTextWindow::HelpTextWindow( vcl::Window* pParent, const OUString& rText, sal
maHideTimer.SetTimeout( rHelpSettings.GetTipTimeout() );
}
void HelpTextWindow::ApplySettings(vcl::RenderContext& rRenderContext)
{
const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
SetPointFont(rRenderContext, rStyleSettings.GetHelpFont());
rRenderContext.SetTextColor(rStyleSettings.GetHelpTextColor());
rRenderContext.SetTextAlign(ALIGN_TOP);
if (rRenderContext.IsNativeControlSupported(CTRL_TOOLTIP, PART_ENTIRE_CONTROL))
{
EnableChildTransparentMode(true);
SetParentClipMode(PARENTCLIPMODE_NOCLIP);
SetPaintTransparent(true);
rRenderContext.SetBackground();
}
else
rRenderContext.SetBackground(Wallpaper(rStyleSettings.GetHelpColor()));
if (rStyleSettings.GetHelpColor().IsDark())
rRenderContext.SetLineColor(COL_WHITE);
else
rRenderContext.SetLineColor(COL_BLACK);
rRenderContext.SetFillColor();
}
HelpTextWindow::~HelpTextWindow()
{
disposeOnce();
......
......@@ -432,20 +432,40 @@ void Dialog::ImplInit( vcl::Window* pParent, WinBits nStyle, InitFlag eFlag )
ImplInitSettings();
}
void Dialog::ApplySettings(vcl::RenderContext& rRenderContext)
{
if (IsControlBackground())
{
// user override
SetBackground(GetControlBackground());
}
else if (rRenderContext.IsNativeControlSupported(CTRL_WINDOW_BACKGROUND, PART_BACKGROUND_DIALOG))
{
// NWF background
mpWindowImpl->mnNativeBackground = PART_BACKGROUND_DIALOG;
EnableChildTransparentMode(true);
}
else
{
// fallback to settings color
rRenderContext.SetBackground(GetSettings().GetStyleSettings().GetDialogColor());
}
}
void Dialog::ImplInitSettings()
{
// user override
if ( IsControlBackground() )
SetBackground( GetControlBackground() );
if (IsControlBackground())
SetBackground(GetControlBackground());
// NWF background
else if( IsNativeControlSupported( CTRL_WINDOW_BACKGROUND, PART_BACKGROUND_DIALOG ) )
else if( IsNativeControlSupported(CTRL_WINDOW_BACKGROUND, PART_BACKGROUND_DIALOG))
{
mpWindowImpl->mnNativeBackground = PART_BACKGROUND_DIALOG;
EnableChildTransparentMode( true );
}
// fallback to settings color
else
SetBackground( GetSettings().GetStyleSettings().GetDialogColor() );
SetBackground(GetSettings().GetStyleSettings().GetDialogColor());
}
Dialog::Dialog( WindowType nType )
......
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