Changeset - r28500:34e4b1ae0c8a
[Not reviewed]
master
0 1 0
Peter Nelson - 11 months ago 2024-01-17 22:17:14
peter1138@openttd.org
Change: Remove extra padding from query text. (#11823)

This window uses 'modalpopup' padding so does not need extra padding on its text.
1 file changed with 2 insertions and 6 deletions:
0 comments (0 inline, 0 general)
src/misc_gui.cpp
Show inline comments
 
@@ -1135,24 +1135,20 @@ struct QueryWindow : public Window {
 
	}
 

	
 
	void UpdateWidgetSize(WidgetID widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override
 
	{
 
		if (widget != WID_Q_TEXT) return;
 

	
 
		Dimension d = GetStringMultiLineBoundingBox(this->message, *size);
 
		d.width += WidgetDimensions::scaled.frametext.Horizontal();
 
		d.height += WidgetDimensions::scaled.framerect.Vertical();
 
		*size = d;
 
		*size = GetStringMultiLineBoundingBox(this->message, *size);
 
	}
 

	
 
	void DrawWidget(const Rect &r, WidgetID widget) const override
 
	{
 
		if (widget != WID_Q_TEXT) return;
 

	
 
		DrawStringMultiLine(r.Shrink(WidgetDimensions::scaled.frametext, WidgetDimensions::scaled.framerect),
 
				this->message, TC_FROMSTRING, SA_CENTER);
 
		DrawStringMultiLine(r, this->message, TC_FROMSTRING, SA_CENTER);
 
	}
 

	
 
	void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override
 
	{
 
		switch (widget) {
 
			case WID_Q_YES: {
0 comments (0 inline, 0 general)