summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorRuslan Kabatsayev <b7.10110111@gmail.com>2012-05-28 02:28:49 +0400
committerMichael Meeks <michael.meeks@suse.com>2012-05-31 12:02:49 +0100
commit7b52e6b9b1c42ccd9ff5a6adbc3b62622d31ca75 (patch)
treed73beb25de21752fea134c2700a738ff02d23fce /vcl
parent71056d59de59561ee1d74a3c2d9d66a223422c7e (diff)
GTK theming: implement rendering window background
Change-Id: I34c6c38f383fce54aa0b2a61a5e88ee9a8cff4e7
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/unx/gtk/gtkgdi.hxx5
-rw-r--r--vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx30
2 files changed, 34 insertions, 1 deletions
diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx
index bdc397e35c2e..fbdcef187ff9 100644
--- a/vcl/inc/unx/gtk/gtkgdi.hxx
+++ b/vcl/inc/unx/gtk/gtkgdi.hxx
@@ -165,6 +165,11 @@ protected:
GdkPixmap* NWGetPixmapFromScreen( Rectangle srcRect );
sal_Bool NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRect );
+ sal_Bool NWPaintGTKWindowBackground( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ const Rectangle& rControlRectangle,
+ const clipList& rClipList,
+ ControlState nState, const ImplControlValue& aValue,
+ const OUString& rCaption );
sal_Bool NWPaintGTKButtonReal( GtkWidget* button, GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
const clipList& rClipList,
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index d65d635189c9..f9781abf74b1 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -614,7 +614,8 @@ sal_Bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPar
( (nPart == PART_TRACK_HORZ_AREA)
|| (nPart == PART_TRACK_VERT_AREA)
)
- )
+ ) ||
+ (nType == CTRL_WINDOW_BACKGROUND)
)
return( sal_True );
return( sal_False );
@@ -898,6 +899,10 @@ sal_Bool GtkSalGraphics::drawNativeControl( ControlType nType,
{
returnVal = NWPaintGTKSlider( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
}
+ else if( nType == CTRL_WINDOW_BACKGROUND )
+ {
+ returnVal = NWPaintGTKWindowBackground( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
+ }
if( pixmap )
{
@@ -1132,6 +1137,29 @@ sal_Bool GtkSalGraphics::getNativeControlRegion( ControlType nType,
/************************************************************************
* Individual control drawing functions
************************************************************************/
+sal_Bool GtkSalGraphics::NWPaintGTKWindowBackground(
+ GdkDrawable* gdkDrawable,
+ ControlType, ControlPart,
+ const Rectangle& rControlRectangle,
+ const clipList& rClipList,
+ ControlState nState, const ImplControlValue&,
+ const OUString& )
+{
+ int w,h;
+ gtk_window_get_size(GTK_WINDOW(m_pWindow),&w,&h);
+ GdkRectangle clipRect;
+ for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it )
+ {
+ clipRect.x = it->Left();
+ clipRect.y = it->Top();
+ clipRect.width = it->GetWidth();
+ clipRect.height = it->GetHeight();
+
+ gtk_paint_flat_box(m_pWindow->style,gdkDrawable,GTK_STATE_NORMAL,GTK_SHADOW_NONE,&clipRect,m_pWindow,"base",0,0,w,h);
+ }
+
+ return sal_True;
+}
sal_Bool GtkSalGraphics::NWPaintGTKButtonReal(
GtkWidget* button,