summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2012-06-12 11:06:56 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-06-17 17:08:01 +0200
commitdd06b29cf9a490d854cd8f9a12e3eb001edc7ab7 (patch)
treef7eaf651150a7ec57fb584ef552530962fbaf50e /vcl
parent8806e00dbc14b55cff6072f0f6dcf90e0a11a079 (diff)
toolbars: Improve the toolbars look in Windows Vista or later.
Change-Id: I389ef70c76a3a9c837ad5406c417804ad77be948
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/svdata.hxx1
-rw-r--r--vcl/source/window/dockingarea.cxx35
-rw-r--r--vcl/win/source/gdi/salnativewidgets-luna.cxx37
3 files changed, 56 insertions, 17 deletions
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index a0f610dd3be5..a4a228e8d925 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -308,6 +308,7 @@ struct ImplSVNWFData
bool mbMenuBarDockingAreaCommonBG:1; // e.g. WinXP default theme
bool mbDockingAreaSeparateTB:1; // individual toolbar backgrounds
// instead of one for docking area
+ bool mbDockingAreaAvoidTBFrames:1; //< don't draw frames around the individual toolbars if mbDockingAreaSeparateTB is false
bool mbToolboxDropDownSeparate:1; // two adjacent buttons for
// toolbox dropdown buttons
bool mbFlatMenu:1; // no popup 3D border
diff --git a/vcl/source/window/dockingarea.cxx b/vcl/source/window/dockingarea.cxx
index 31f29c2f186f..a123ead8f959 100644
--- a/vcl/source/window/dockingarea.cxx
+++ b/vcl/source/window/dockingarea.cxx
@@ -171,24 +171,27 @@ void DockingAreaWindow::Paint( const Rectangle& )
DrawNativeControl( CTRL_TOOLBAR, IsHorizontal() ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT,
aCtrlRegion, nState, aControlValue, rtl::OUString() );
- // each toolbar gets a thin border to better recognize its borders on the homogeneous docking area
- sal_uInt16 nChildren = GetChildCount();
- for( sal_uInt16 n = 0; n < nChildren; n++ )
+ if( !ImplGetSVData()->maNWFData.mbDockingAreaAvoidTBFrames )
{
- Window* pChild = GetChild( n );
- if ( pChild->IsVisible() )
+ // each toolbar gets a thin border to better recognize its borders on the homogeneous docking area
+ sal_uInt16 nChildren = GetChildCount();
+ for( sal_uInt16 n = 0; n < nChildren; n++ )
{
- Point aPos = pChild->GetPosPixel();
- Size aSize = pChild->GetSizePixel();
- Rectangle aRect( aPos, aSize );
-
- SetLineColor( GetSettings().GetStyleSettings().GetLightColor() );
- DrawLine( aRect.TopLeft(), aRect.TopRight() );
- DrawLine( aRect.TopLeft(), aRect.BottomLeft() );
-
- SetLineColor( GetSettings().GetStyleSettings().GetSeparatorColor() );
- DrawLine( aRect.BottomLeft(), aRect.BottomRight() );
- DrawLine( aRect.TopRight(), aRect.BottomRight() );
+ Window* pChild = GetChild( n );
+ if ( pChild->IsVisible() )
+ {
+ Point aPos = pChild->GetPosPixel();
+ Size aSize = pChild->GetSizePixel();
+ Rectangle aRect( aPos, aSize );
+
+ SetLineColor( GetSettings().GetStyleSettings().GetLightColor() );
+ DrawLine( aRect.TopLeft(), aRect.TopRight() );
+ DrawLine( aRect.TopLeft(), aRect.BottomLeft() );
+
+ SetLineColor( GetSettings().GetStyleSettings().GetSeparatorColor() );
+ DrawLine( aRect.BottomLeft(), aRect.BottomRight() );
+ DrawLine( aRect.TopRight(), aRect.BottomRight() );
+ }
}
}
}
diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx
index 6ba04d72a256..2b1a4f18012b 100644
--- a/vcl/win/source/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx
@@ -932,7 +932,39 @@ sal_Bool ImplDrawNativeControl( HWND hWnd, 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.mbTransparentMenubar )
+ {
+ const long GRADIENT_HEIGHT = 32;
+
+ 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;
+
+ 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, gradient_break, 0xfa00, 0xfa00, 0xfa00, 0xff00 },
+ { rc.right, rc.bottom, 0xe500, 0xe900, 0xee00, 0xff00 }
+ };
+ GradientFill( hDC, vert, 2, g_rect, 1, GRADIENT_FILL_RECT_V );
+
+ return sal_True;
+ }
+ else
+ rc.top = 0; // extend potential gradient to cover menu bar as well
+ }
}
return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
}
@@ -1514,6 +1546,9 @@ void WinSalGraphics::updateSettingsNative( AllSettings& rSettings )
pSVData->maNWFData.mnMenuFormatBorderY = 2;
pSVData->maNWFData.maMenuBarHighlightTextColor = aStyleSettings.GetMenuTextColor();
GetSalData()->mbThemeMenuSupport = TRUE;
+
+ // don't draw frame around each and every toolbar
+ pSVData->maNWFData.mbDockingAreaAvoidTBFrames = true;
}
rSettings.SetStyleSettings( aStyleSettings );