Changeset - r25372:892030e76582
[Not reviewed]
master
0 1 0
PeterN - 3 years ago 2021-05-03 15:39:20
peter1138@openttd.org
Fix: Query windows may be partially drawn initially. (#9184)

Query window was not marked dirty after being moved on init. It was then marked dirty once the white border flash completed.
1 file changed with 9 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/misc_gui.cpp
Show inline comments
 
@@ -1162,12 +1162,9 @@ struct QueryWindow : public Window {
 
		this->caption = caption;
 
		this->message = message;
 
		this->proc    = callback;
 
		this->parent  = parent;
 

	
 
		this->InitNested(WN_CONFIRM_POPUP_QUERY);
 

	
 
		this->parent = parent;
 
		this->left = parent->left + (parent->width / 2) - (this->width / 2);
 
		this->top = parent->top + (parent->height / 2) - (this->height / 2);
 
	}
 

	
 
	~QueryWindow()
 
@@ -1175,6 +1172,14 @@ struct QueryWindow : public Window {
 
		if (this->proc != nullptr) this->proc(this->parent, false);
 
	}
 

	
 
	void FindWindowPlacementAndResize(int def_width, int def_height) override
 
	{
 
		/* Position query window over the calling window, ensuring it's within screen bounds. */
 
		this->left = Clamp(parent->left + (parent->width / 2) - (this->width / 2), 0, _screen.width - this->width);
 
		this->top = Clamp(parent->top + (parent->height / 2) - (this->height / 2), 0, _screen.height - this->height);
 
		this->SetDirty();
 
	}
 

	
 
	void SetStringParameters(int widget) const override
 
	{
 
		switch (widget) {
0 comments (0 inline, 0 general)