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