summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-06-03 21:02:37 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-06-05 10:14:46 +0100
commitb640c63086495a6216ad2a63f2219380cbfb5dff (patch)
tree42132f654714978adb9481dcae0396a59f2ee107 /vcl
parent84770240ee911393eb3e29f446e7c324843c5c6c (diff)
at one stage we had checkmarks *and* icons in menus side by side
later on we ended up with toggleable icons instead, change comment to reflect the current situation Change-Id: Ia39f6bffe8e5942442482b1f845d2964138ec032
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/menu.cxx13
1 files changed, 7 insertions, 6 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 2987267527d0..2779b373a17b 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2348,19 +2348,14 @@ void Menu::ImplRemoveDel( ImplMenuDelData& rDel )
Size Menu::ImplCalcSize( Window* pWin )
{
- // | Checked| Image| Text| Accel/Popup|
+ // | Check/Radio/Image| Text| Accel/Popup|
// for symbols: nFontHeight x nFontHeight
long nFontHeight = pWin->GetTextHeight();
long nExtra = nFontHeight/4;
-
- Size aSz;
- Size aMaxImgSz;
- long nMaxWidth = 0;
long nMinMenuItemHeight = nFontHeight;
long nCheckHeight = 0, nRadioHeight = 0;
- long nCheckWidth = 0;
Size aMaxSize = ImplGetNativeCheckAndRadioSize(pWin, nCheckHeight, nRadioHeight);
if( aMaxSize.Height() > nMinMenuItemHeight )
nMinMenuItemHeight = aMaxSize.Height();
@@ -2369,6 +2364,8 @@ Size Menu::ImplCalcSize( Window* pWin )
// have to add some extra space even in the MENU_FLAG_SHOWCHECKIMAGES case
bool bSpaceForCheckbox = ( aMaxSize.Height() == 0 );
+ Size aMaxImgSz;
+
const StyleSettings& rSettings = pWin->GetSettings().GetStyleSettings();
if ( rSettings.GetUseImagesInMenus() )
{
@@ -2395,6 +2392,10 @@ Size Menu::ImplCalcSize( Window* pWin )
}
}
+ Size aSz;
+ long nCheckWidth = 0;
+ long nMaxWidth = 0;
+
for ( size_t n = pItemList->size(); n; )
{
MenuItemData* pData = pItemList->GetDataFromPos( --n );