Changeset - r17309:6de76b3d28ae
[Not reviewed]
master
0 4 0
terkhen - 13 years ago 2011-02-11 18:24:12
terkhen@openttd.org
(svn r22059) -Fix (r21179): Make the send chat message window follow the position of the status bar.
4 files changed with 17 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/network/network_chat_gui.cpp
Show inline comments
 
@@ -303,6 +303,8 @@ struct NetworkChatWindow : public QueryS
 
		this->SetFocusedWidget(NWCW_TEXTBOX);
 
		InvalidateWindowData(WC_NEWS_WINDOW, 0, this->height);
 
		_chat_tab_completion_active = false;
 

	
 
		PositionNetworkChatWindow(this);
 
	}
 

	
 
	~NetworkChatWindow()
 
@@ -457,7 +459,7 @@ struct NetworkChatWindow : public QueryS
 

	
 
	virtual Point OnInitialPosition(const WindowDesc *desc, int16 sm_width, int16 sm_height, int window_number)
 
	{
 
		Point pt = { (_screen.width - max(sm_width, desc->default_width)) / 2, _screen.height - sm_height - FindWindowById(WC_STATUS_BAR, 0)->height };
 
		Point pt = { 0, _screen.height - sm_height - FindWindowById(WC_STATUS_BAR, 0)->height };
 
		return pt;
 
	}
 

	
src/settings.cpp
Show inline comments
 
@@ -693,6 +693,7 @@ static bool v_PositionStatusbar(int32 p1
 
	if (_game_mode != GM_MENU) {
 
		PositionStatusbar(NULL);
 
		PositionNewsMessage(NULL);
 
		PositionNetworkChatWindow(NULL);
 
	}
 
	return true;
 
}
src/window.cpp
Show inline comments
 
@@ -2675,6 +2675,17 @@ int PositionNewsMessage(Window *w)
 
	return PositionWindow(w, WC_NEWS_WINDOW, _settings_client.gui.statusbar_pos);
 
}
 

	
 
/**
 
 * (Re)position network chat window at the screen.
 
 * @param w Window structure of the network chat window, may also be \c NULL.
 
 * @return X coordinate of left edge of the repositioned network chat winodw.
 
 */
 
int PositionNetworkChatWindow(Window *w)
 
{
 
	DEBUG(misc, 5, "Repositioning network chat window...");
 
	return PositionWindow(w, WC_SEND_NETWORK_MSG, _settings_client.gui.statusbar_pos);
 
}
 

	
 

	
 
/**
 
 * Switches viewports following vehicles, which get autoreplaced
 
@@ -2739,7 +2750,7 @@ void RelocateAllWindows(int neww, int ne
 
			case WC_SEND_NETWORK_MSG:
 
				ResizeWindow(w, Clamp(neww, 320, 640) - w->width, 0);
 
				top = newh - w->height - FindWindowById(WC_STATUS_BAR, 0)->height;
 
				left = (neww - w->width) >> 1;
 
				left = PositionNetworkChatWindow(w);
 
				break;
 

	
 
			case WC_CONSOLE:
src/window_func.h
Show inline comments
 
@@ -23,6 +23,7 @@ void ResizeWindow(Window *w, int x, int 
 
int PositionMainToolbar(Window *w);
 
int PositionStatusbar(Window *w);
 
int PositionNewsMessage(Window *w);
 
int PositionNetworkChatWindow(Window *w);
 

	
 
int GetMainViewTop();
 
int GetMainViewBottom();
0 comments (0 inline, 0 general)