wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src multiplayer_client.cpp


From: Guillaume Melquiond
Subject: [Wesnoth-cvs-commits] wesnoth/src multiplayer_client.cpp
Date: Wed, 19 Jan 2005 16:25:12 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Guillaume Melquiond <address@hidden>    05/01/19 21:25:11

Modified files:
        src            : multiplayer_client.cpp 

Log message:
        Fix size and location of multiplayer client left pane.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_client.cpp.diff?tr1=1.84&tr2=1.85&r1=text&r2=text

Patches:
Index: wesnoth/src/multiplayer_client.cpp
diff -u wesnoth/src/multiplayer_client.cpp:1.84 
wesnoth/src/multiplayer_client.cpp:1.85
--- wesnoth/src/multiplayer_client.cpp:1.84     Wed Jan 19 20:47:14 2005
+++ wesnoth/src/multiplayer_client.cpp  Wed Jan 19 21:25:10 2005
@@ -135,28 +135,30 @@
                }
 
                SDL_Rect rect = area_;
-               rect.h /= 2;
+               rect.h -= 2 * gui::ButtonVPadding;
+               if (cancel_button_)
+                       rect.h -= cancel_button_->height();
                
SDL_FillRect(disp_.video().getSurface(),&rect,SDL_MapRGB(disp_.video().getSurface()->format,0,0,0));
 
-               menu_.assign(new gui::menu(disp_,details,false,area_.h/2));
-               menu_->set_location(area_.x,area_.y);
-               menu_->set_width(area_.w);
+               menu_.assign(new gui::menu(disp_, details, false, rect.h));
+               menu_->set_location(rect);
        }
        
        void set_area(const SDL_Rect& area) {
-
                area_ = area;
-               generate_menu(true);
-
-               const std::string text = _("Waiting for game to start...");
-               SDL_Rect rect = 
font::draw_text(NULL,disp_.screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOUR,text,0,0);
-               rect.x = area.x + area.w/2 - rect.w/2;
-               rect.y = area.y + (area.h*3)/4 - rect.h/2;
-               
font::draw_text(&disp_,rect,font::SIZE_NORMAL,font::NORMAL_COLOUR,text,rect.x,rect.y);
 
                cancel_button_.assign(new gui::button(disp_,_("Cancel")));
-               cancel_button_->set_location(area.x+area.w - 
cancel_button_->width() - gui::ButtonHPadding,
-                                                area.y+area.h - 
cancel_button_->height() - gui::ButtonVPadding);
+               int y = area.y + area.h - cancel_button_->height() - 
gui::ButtonVPadding;
+               cancel_button_->set_location(area.x + area.w - 
cancel_button_->width() - gui::ButtonHPadding, y);
+
+               std::string const text = _("Waiting for game to start...");
+               SDL_Rect rect = font::draw_text(NULL, disp_.screen_area(), 
font::SIZE_NORMAL,
+                                               font::NORMAL_COLOUR, text, 0, 
0);
+               rect.x = area_.x + gui::ButtonHPadding;
+               rect.y = y + 4;
+               font::draw_text(&disp_, rect, font::SIZE_NORMAL, 
font::NORMAL_COLOUR, text, rect.x, rect.y);
+
+               generate_menu(true);
                events::raise_draw_event();
        }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]