From 4a970202a9101be3fdd22ff060140e46133490dc Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 2 Nov 2009 10:15:48 +0000 Subject: (svn r17947) -Codechange: make the statusbar, chat input and news window know of eachothers size so they don't get overlapped and don't get invisible (bottoms) of windows when a larger font is used --- src/network/network_chat_gui.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/network') diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp index ef05ad931..1b5b13290 100644 --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -118,7 +118,7 @@ void NetworkInitChatMessage() _chatmsg_list = ReallocT(_chatmsg_list, _settings_client.gui.network_chat_box_height); _chatmsg_box.x = 10; - _chatmsg_box.y = 30; + _chatmsg_box.y = 3 * FONT_HEIGHT_NORMAL; _chatmsg_box.width = _settings_client.gui.network_chat_box_width; _chatmsg_box.height = _settings_client.gui.network_chat_box_height * (FONT_HEIGHT_NORMAL + NETWORK_CHAT_LINE_SPACING) + 2; _chatmessage_backup = ReallocT(_chatmessage_backup, _chatmsg_box.width * _chatmsg_box.height * BlitterFactoryBase::GetCurrentBlitter()->GetBytesPerPixel()); @@ -449,6 +449,12 @@ struct NetworkChatWindow : public QueryStringBaseWindow { this->DrawEditBox(NWCW_TEXTBOX); } + 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 }; + return pt; + } + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) { if (widget != NWCW_DESTINATION) return; @@ -537,7 +543,7 @@ static const NWidgetPart _nested_chat_window_widgets[] = { }; static const WindowDesc _chat_window_desc( - WDP_CENTER, -26, 320, 14, 640, 14, // x, y, width, height + WDP_CENTER, 0, 320, 14, 640, 14, // x, y, width, height WC_SEND_NETWORK_MSG, WC_NONE, WDF_STD_TOOLTIPS | WDF_DEF_WIDGET, NULL, _nested_chat_window_widgets, lengthof(_nested_chat_window_widgets) -- cgit v1.2.3-70-g09d2