summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2012-06-25 13:09:36 +0200
committerJan Holesovsky <kendy@suse.cz>2012-06-25 18:05:19 +0200
commit6fe75c5b9500525682d696e26d8ad1b7be88ef42 (patch)
tree4082bf229cfa0346efed99cbc07f1ea26a810a25 /vcl
parentf7ab0114e94d25843aa9b0831fe4a592b6d83b13 (diff)
Revert "Reduce copy'n'paste by different nesting of if's."
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/menu.cxx64
1 files changed, 38 insertions, 26 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index a23f69aea0d1..5f543c9c0f31 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1,3 +1,4 @@
+
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
@@ -5498,45 +5499,56 @@ void MenuBarWindow::HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight )
Rectangle aRect = Rectangle( Point( nX, 1 ), Size( pData->aSz.Width(), GetOutputSizePixel().Height()-2 ) );
Push( PUSH_CLIPREGION );
IntersectClipRegion( aRect );
-
- if( IsNativeControlSupported( CTRL_MENUBAR, PART_MENU_ITEM ) &&
- IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL ) )
+ if ( bHighlight )
{
- // draw background (transparency)
- MenubarValue aControlValue;
- aControlValue.maTopDockingAreaHeight = ImplGetTopDockingAreaHeight( this );
-
- Point tmp(0,0);
- Rectangle aBgRegion( tmp, GetOutputSizePixel() );
- DrawNativeControl( CTRL_MENUBAR, PART_ENTIRE_CONTROL,
- aBgRegion,
- CTRL_STATE_ENABLED,
- aControlValue,
- OUString() );
- ImplAddNWFSeparator( this, aControlValue );
-
- if ( bHighlight )
+ if( IsNativeControlSupported( CTRL_MENUBAR, PART_MENU_ITEM ) &&
+ IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL ) )
{
+ // draw background (transparency)
+ MenubarValue aControlValue;
+ aControlValue.maTopDockingAreaHeight = ImplGetTopDockingAreaHeight( this );
+
+ Point tmp(0,0);
+ Rectangle aBgRegion( tmp, GetOutputSizePixel() );
+ DrawNativeControl( CTRL_MENUBAR, PART_ENTIRE_CONTROL,
+ aBgRegion,
+ CTRL_STATE_ENABLED,
+ aControlValue,
+ OUString() );
+ ImplAddNWFSeparator( this, aControlValue );
+
// draw selected item
DrawNativeControl( CTRL_MENUBAR, PART_MENU_ITEM,
- aRect,
- CTRL_STATE_ENABLED | CTRL_STATE_SELECTED,
- aControlValue,
- OUString() );
+ aRect,
+ CTRL_STATE_ENABLED | CTRL_STATE_SELECTED,
+ aControlValue,
+ OUString() );
}
- }
- else
- {
- if ( bHighlight )
+ else
{
SetFillColor( GetSettings().GetStyleSettings().GetMenuHighlightColor() );
SetLineColor();
DrawRect( aRect );
}
+ }
+ else
+ {
+ if( IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL) )
+ {
+ MenubarValue aMenubarValue;
+ aMenubarValue.maTopDockingAreaHeight = ImplGetTopDockingAreaHeight( this );
+
+ // use full window size to get proper gradient
+ // but clip accordingly
+ Point aPt;
+ Rectangle aCtrlRect( aPt, GetOutputSizePixel() );
+
+ DrawNativeControl( CTRL_MENUBAR, PART_ENTIRE_CONTROL, aCtrlRect, CTRL_STATE_ENABLED, aMenubarValue, rtl::OUString() );
+ ImplAddNWFSeparator( this, aMenubarValue );
+ }
else
Erase( aRect );
}
-
Pop();
pMenu->ImplPaint( this, 0, 0, pData, bHighlight );
}