diff options
author | Rüdiger Timm <rt@openoffice.org> | 2005-01-31 08:19:43 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2005-01-31 08:19:43 +0000 |
commit | ef04a7ec92a1de78514387e70f26f7a554a81988 (patch) | |
tree | fe7e64a6740020fb26ebfcdf02acee103041b957 /vcl | |
parent | e9f431656eb8d67d9fffbe1a272f70025f002064 (diff) |
INTEGRATION: CWS vcl34 (1.114.26); FILE MERGED
2005/01/12 11:47:59 pl 1.114.26.3: RESYNC: (1.114-1.116); FILE MERGED
2005/01/06 16:07:13 ssa 1.114.26.2: #i17937# add space between accelerator and submenu indicator
2004/12/29 15:35:03 ssa 1.114.26.1: #i17937# reduce amount of white space in menu entries by positioning the accelerator strings at variable x positions
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/menu.cxx | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 3726c9a379ba..175d761bbd45 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2,9 +2,9 @@ * * $RCSfile: menu.cxx,v $ * - * $Revision: 1.118 $ + * $Revision: 1.119 $ * - * last change: $Author: kz $ $Date: 2005-01-21 09:56:08 $ + * last change: $Author: rt $ $Date: 2005-01-31 09:19:43 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -2073,8 +2073,7 @@ Size Menu::ImplCalcSize( Window* pWin ) Size aSz; Size aMaxImgSz; - long nMaxTextWidth = 0; - long nMaxAccWidth = 0; + long nMaxWidth = 0; long nMinMenuItemHeight = nFontHeight; const StyleSettings& rSettings = pWin->GetSettings().GetStyleSettings(); @@ -2105,6 +2104,7 @@ Size Menu::ImplCalcSize( Window* pWin ) if ( ImplIsVisible( n ) ) { + long nWidth = 0; // Separator if ( !bIsMenuBar && ( pData->eType == MENUITEM_SEPARATOR ) ) @@ -2129,8 +2129,6 @@ Size Menu::ImplCalcSize( Window* pWin ) if ( (pData->eType == MENUITEM_STRING) || (pData->eType == MENUITEM_STRINGIMAGE) ) { long nTextWidth = pWin->GetCtrlTextWidth( pData->aText ); - if ( nTextWidth > nMaxTextWidth ) - nMaxTextWidth = nTextWidth; long nTextHeight = pWin->GetTextHeight(); // if ( nTextHeight > pData->aSz.Height() ) @@ -2146,6 +2144,8 @@ Size Menu::ImplCalcSize( Window* pWin ) } else pData->aSz.Height() = Max( Max( nTextHeight, pData->aSz.Height() ), nMinMenuItemHeight ); + + nWidth += nTextWidth; } // Accel @@ -2154,15 +2154,14 @@ Size Menu::ImplCalcSize( Window* pWin ) String aName = pData->aAccelKey.GetName(); long nAccWidth = pWin->GetTextWidth( aName ); nAccWidth += nExtra; - if ( nAccWidth > nMaxAccWidth ) - nMaxAccWidth = nAccWidth; + nWidth += nAccWidth; } // SubMenu? if ( !bIsMenuBar && pData->pSubMenu ) { - if ( nFontHeight > nMaxAccWidth ) - nMaxAccWidth = nFontHeight; + if ( nFontHeight > nWidth ) + nWidth += nFontHeight; pData->aSz.Height() = Max( Max( nFontHeight, pData->aSz.Height() ), nMinMenuItemHeight ); } @@ -2171,6 +2170,10 @@ Size Menu::ImplCalcSize( Window* pWin ) if ( !bIsMenuBar ) aSz.Height() += (long)pData->aSz.Height(); + + if ( nWidth > nMaxWidth ) + nMaxWidth = nWidth; + } } @@ -2183,8 +2186,9 @@ Size Menu::ImplCalcSize( Window* pWin ) if ( aMaxImgSz.Width() ) nTextPos += gfxExtra; - aSz.Width() = nTextPos + nMaxTextWidth + nExtra + nMaxAccWidth; - aSz.Width() += 10*nExtra; // etwas mehr... + aSz.Width() = nTextPos + nMaxWidth + nExtra; + aSz.Width() += 8*nExtra; // a _little_ more ... + int nOuterSpace = ImplGetSVData()->maNWFData.mnMenuFormatExtraBorder; aSz.Width() += 2*nOuterSpace; aSz.Height() += 2*nOuterSpace; @@ -2335,7 +2339,8 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData* { XubString aAccText = pData->aAccelKey.GetName(); aTmpPos.X() = aOutSz.Width() - pWin->GetTextWidth( aAccText ); - aTmpPos.X() -= 3*nExtra; + aTmpPos.X() -= 4*nExtra; + aTmpPos.X() -= nOuterSpace; aTmpPos.Y() = aPos.Y(); aTmpPos.Y() += nTextOffsetY; @@ -4409,6 +4414,7 @@ void MenuFloatingWindow::Paint( const Rectangle& rRect ) ImplDrawScroller( TRUE ); ImplDrawScroller( FALSE ); } + SetFillColor( GetSettings().GetStyleSettings().GetMenuColor() ); pMenu->ImplPaint( this, nScrollerHeight, ImplGetStartY() ); if ( nHighlightedItem != ITEMPOS_INVALID ) HighlightItem( nHighlightedItem, TRUE ); @@ -5089,6 +5095,7 @@ void MenuBarWindow::Paint( const Rectangle& rRect ) DrawNativeControl( CTRL_MENUBAR, PART_ENTIRE_CONTROL, aCtrlRegion, CTRL_STATE_ENABLED, aControlValue, rtl::OUString() ); } + SetFillColor( GetSettings().GetStyleSettings().GetMenuColor() ); pMenu->ImplPaint( this, 0 ); if ( nHighlightedItem != ITEMPOS_INVALID ) HighlightItem( nHighlightedItem, TRUE ); |