Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Images in menus causing enormous padding 
	| 
		
 |  
	| 
		
 |  
	
		
		
			| Re: Images in menus causing enormous padding [message #14641 is a reply to message #14639] | 
			Wed, 05 March 2008 17:39    | 
		 
		
			
				
				
				  | 
					
						  
						mirek
						 Messages: 14271 Registered: November 2005 
						
					 | 
					Ultimate Member  | 
					 | 
		 
		 
	 | 
 
	
		Thanks, a bug. Fix: 
 
CtrlLib/MenuItem.cpp 302 
Size MenuItem::GetMinSize() const
{
	Size sz1 = GetTextSize(text, font);
	Size sz2(0, 0);
	if(accel) {
		sz2 = GetTextSize(GetKeyDesc(accel), font);
		sz2.cx += 12;
	}
	Size lsz = min(maxiconsize, licon.GetSize());
	Size rsz = ricon.GetSize();
	return AddFrameSize(Size(max(lsz.cx, leftgap) + sz1.cx + max(sz2.cx, (rsz.cx ? 16 : 0))
	                         + max(rsz.cx, 16) + textgap + 10,
	                         max(max(lsz.cy, rsz.cy) + 4, sz1.cy + 6)));
}
 
 
Note: U++ reduces the size of icons, it is intentional. You can adjust the minimal size using MenuBar::MaxIconSize. Using "INT_MAX" here is OK too   
 
Mirek 
		
		
		
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |   
Goto Forum:
 
 Current Time: Tue Nov 04 02:18:32 CET 2025 
 Total time taken to generate the page: 0.06834 seconds 
 |