Changeset - r8884:0f3a789fa3d6
[Not reviewed]
master
0 1 0
peter1138 - 16 years ago 2008-04-10 11:59:18
peter1138@openttd.org
(svn r12651) -Fix (r12644) [FS#1915]: Dropdown widget width should be one pixel less than window width, not one more.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/widgets/dropdown.cpp
Show inline comments
 
@@ -237,49 +237,49 @@ void ShowDropDownList(Window *w, DropDow
 
		/* If not, check if it will fit above the widget */
 
		if (w->top + wi->top - height > screen_top) {
 
			top = w->top + wi->top - height;
 
		} else {
 
			/* ... and lastly if it won't, enable the scroll bar and fit the
 
			 * list in below the widget */
 
			int rows = (screen_bottom - 4 - top) / 10;
 
			height = rows * 10 + 4;
 
			scroll = true;
 
		}
 
	}
 

	
 
	if (width == 0) width = wi->right - wi->left + 1;
 

	
 
	Window *dw = AllocateWindow(
 
		w->left + wi->left,
 
		top,
 
		width,
 
		height,
 
		DropDownMenuWndProc,
 
		WC_DROPDOWN_MENU,
 
		_dropdown_menu_widgets);
 

	
 
	dw->widget[0].color = wi->color;
 
	dw->widget[0].right = width + 1;
 
	dw->widget[0].right = width - 1;
 
	dw->widget[0].bottom = height - 1;
 

	
 
	dw->SetWidgetHiddenState(1, !scroll);
 

	
 
	if (scroll) {
 
		/* We're scrolling, so enable the scroll bar and shrink the list by
 
		 * the scrollbar's width */
 
		dw->widget[1].color  = wi->color;
 
		dw->widget[1].right  = dw->widget[0].right;
 
		dw->widget[1].left   = dw->widget[1].right - 11;
 
		dw->widget[1].bottom = height - 1;
 
		dw->widget[0].right -= 12;
 

	
 
		dw->vscroll.cap   = (height - 4) / 10;
 
		dw->vscroll.count = list->size();
 
	}
 

	
 
	dw->desc_flags = WDF_DEF_WIDGET;
 
	dw->flags4 &= ~WF_WHITE_BORDER_MASK;
 

	
 
	WP(dw, dropdown_d).parent_wnd_class = w->window_class;
 
	WP(dw, dropdown_d).parent_wnd_num   = w->window_number;
 
	WP(dw, dropdown_d).parent_button    = button;
 
	WP(dw, dropdown_d).list             = list;
0 comments (0 inline, 0 general)