summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2012-08-10 16:16:21 +0200
committerJan Holesovsky <kendy@suse.cz>2012-08-10 16:44:26 +0200
commit03dbe1a97c0050365ac3820575134bace0908e2b (patch)
tree9af2511a019b41c83e300e3638e78161d3793ee4
parent6a7b32b09e621364239bca6ec02c858b122e07b8 (diff)
Windows toolbars: Use our own theming even for vertical or bottom toolbars.
Change-Id: I4836d7f2055c4811f0e6ccdc87dc58895528b3f8
-rw-r--r--vcl/win/source/gdi/salnativewidgets-luna.cxx61
1 files changed, 35 insertions, 26 deletions
diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx
index 065e450f9217..8c343fef458b 100644
--- a/vcl/win/source/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx
@@ -457,31 +457,41 @@ void ImplConvertSpinbuttonValues( int nControlPart, const ControlState& rState,
pRect->bottom = rRect.Bottom()+1;
}
-void impl_drawAeroToolbar( HDC hDC, RECT rc )
+/// Draw an own toolbar style on Windows Vista or later, looks better there
+void impl_drawAeroToolbar( HDC hDC, RECT rc, bool bHorizontal )
{
- const long GRADIENT_HEIGHT = 32;
+ if ( rc.top == 0 && bHorizontal )
+ {
+ const long GRADIENT_HEIGHT = 32;
- long gradient_break = rc.top;
- GRADIENT_RECT g_rect[1] = { { 0, 1 } };
+ long gradient_break = rc.top;
+ GRADIENT_RECT g_rect[1] = { { 0, 1 } };
- // very slow gradient at the top (if we have space for that)
- if ( rc.bottom - rc.top > GRADIENT_HEIGHT )
- {
- gradient_break = rc.bottom - GRADIENT_HEIGHT;
+ // very slow gradient at the top (if we have space for that)
+ if ( rc.bottom - rc.top > GRADIENT_HEIGHT )
+ {
+ gradient_break = rc.bottom - GRADIENT_HEIGHT;
+
+ TRIVERTEX vert[2] = {
+ { rc.left, rc.top, 0xff00, 0xff00, 0xff00, 0xff00 },
+ { rc.right, gradient_break, 0xfa00, 0xfa00, 0xfa00, 0xff00 },
+ };
+ GradientFill( hDC, vert, 2, g_rect, 1, GRADIENT_FILL_RECT_V );
+ }
+ // gradient at the bottom
TRIVERTEX vert[2] = {
- { rc.left, rc.top, 0xff00, 0xff00, 0xff00, 0xff00 },
- { rc.right, gradient_break, 0xfa00, 0xfa00, 0xfa00, 0xff00 },
+ { rc.left, gradient_break, 0xfa00, 0xfa00, 0xfa00, 0xff00 },
+ { rc.right, rc.bottom, 0xf000, 0xf000, 0xf000, 0xff00 }
};
GradientFill( hDC, vert, 2, g_rect, 1, GRADIENT_FILL_RECT_V );
}
-
- // gradient at the bottom
- TRIVERTEX vert[2] = {
- { rc.left, gradient_break, 0xfa00, 0xfa00, 0xfa00, 0xff00 },
- { rc.right, rc.bottom, 0xf000, 0xf000, 0xf000, 0xff00 }
- };
- GradientFill( hDC, vert, 2, g_rect, 1, GRADIENT_FILL_RECT_V );
+ else
+ {
+ HBRUSH hbrush = CreateSolidBrush( RGB( 0xf0, 0xf0, 0xf0 ) );
+ FillRect( hDC, &rc, hbrush );
+ DeleteObject( hbrush );
+ }
}
sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
@@ -909,17 +919,16 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
{
const ToolbarValue *pValue = static_cast<const ToolbarValue*>(&aValue);
if( pValue->mbIsTopDockingArea )
- {
rc.top = 0; // extend potential gradient to cover menu bar as well
+ }
- // make it more compatible with Aero
- if( ImplGetSVData()->maNWFData.mbDockingAreaAvoidTBFrames )
- {
- impl_drawAeroToolbar( hDC, rc );
- return sal_True;
- }
- }
+ // make it more compatible with Aero
+ if( ImplGetSVData()->maNWFData.mbDockingAreaAvoidTBFrames )
+ {
+ impl_drawAeroToolbar( hDC, rc, nPart == PART_DRAW_BACKGROUND_HORZ );
+ return sal_True;
}
+
return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
}
}
@@ -936,7 +945,7 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
// make it more compatible with Aero
if( ImplGetSVData()->maNWFData.mbDockingAreaAvoidTBFrames )
{
- impl_drawAeroToolbar( hDC, rc );
+ impl_drawAeroToolbar( hDC, rc, true );
return sal_True;
}
}