Changeset - r25318:6ade20457b7c
[Not reviewed]
master
0 1 0
Peter Nelson - 3 years ago 2021-04-22 00:35:51
peter1138@openttd.org
Cleanup: Remove fairly redundant DrawDropdown() function.
1 file changed with 1 insertions and 14 deletions:
0 comments (0 inline, 0 general)
src/widget.cpp
Show inline comments
 
@@ -624,19 +624,6 @@ static inline void DrawButtonDropdown(co
 
}
 

	
 
/**
 
 * Draw a dropdown #WWT_DROPDOWN widget.
 
 * @param r       Rectangle containing the widget.
 
 * @param colour  Background colour of the widget.
 
 * @param clicked The widget is lowered.
 
 * @param str     Text of the button.
 
 * @param align   Alignment of the text.
 
 */
 
static inline void DrawDropdown(const Rect &r, Colours colour, bool clicked, StringID str, StringAlignment align)
 
{
 
	DrawButtonDropdown(r, colour, false, clicked, str, align);
 
}
 

	
 
/**
 
 * Paint all widgets of a window.
 
 */
 
void Window::DrawWidgets() const
 
@@ -2639,7 +2626,7 @@ void NWidgetLeaf::Draw(const Window *w)
 

	
 
		case WWT_DROPDOWN:
 
			if (this->index >= 0) w->SetStringParameters(this->index);
 
			DrawDropdown(r, this->colour, clicked, this->widget_data, this->align);
 
			DrawButtonDropdown(r, this->colour, false, clicked, this->widget_data, this->align);
 
			break;
 

	
 
		case NWID_BUTTON_DROPDOWN:
0 comments (0 inline, 0 general)