[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src show_dialog.cpp
From: |
Isaac Clerencia |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src show_dialog.cpp |
Date: |
Wed, 25 Aug 2004 17:32:20 -0400 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Isaac Clerencia <address@hidden> 04/08/25 21:27:33
Modified files:
src : show_dialog.cpp
Log message:
ettin show_dialog patch, see patch #3316
basically moves caption that was under the image to above the text in
character dialogs
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/show_dialog.cpp.diff?tr1=1.88&tr2=1.89&r1=text&r2=text
Patches:
Index: wesnoth/src/show_dialog.cpp
diff -u wesnoth/src/show_dialog.cpp:1.88 wesnoth/src/show_dialog.cpp:1.89
--- wesnoth/src/show_dialog.cpp:1.88 Wed Aug 25 02:59:51 2004
+++ wesnoth/src/show_dialog.cpp Wed Aug 25 21:27:33 2004
@@ -1,4 +1,4 @@
-/* $Id: show_dialog.cpp,v 1.88 2004/08/25 02:59:51 Sirp Exp $ */
+/* $Id: show_dialog.cpp,v 1.89 2004/08/25 21:27:33 isaaccp Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -438,6 +438,7 @@
switch(type) {
case MESSAGE:
break;
+
case OK_ONLY: {
static const char* thebuttons[] = { N_("Ok"), "" };
button_list = thebuttons;
@@ -543,21 +544,21 @@
const int padding_height = top_padding + bottom_padding + menu_hpadding;
const int caption_width = caption_size.w;
const int image_width = image != NULL ? image->w : 0;
- const int total_image_width = caption_width > image_width ?
- caption_width : image_width;
const int image_height = image != NULL ? image->h : 0;
- const int total_image_height = image_height + caption_size.h;
+ const int total_text_height = text_size.h + caption_size.h;
int text_width = text_size.w;
+ if(caption_width > text_width)
+ text_width = caption_width;
if(menu_.width() > text_width)
text_width = menu_.width();
- int total_width = total_image_width + text_width + padding_width;
+ int total_width = image_width + text_width + padding_width;
if(text_widget_width+left_padding+right_padding > total_width)
total_width = text_widget_width+left_padding+right_padding;
- const size_t text_and_image_height = total_image_height > text_size.h ?
total_image_height : text_size.h;
+ const size_t text_and_image_height = image_height > total_text_height ?
image_height : total_text_height;
const int total_height = text_and_image_height +
padding_height + menu_.height() +
@@ -655,7 +656,7 @@
xloc +
left_padding,text_widget_y_unpadded);
}
- const int menu_xpos =
xloc+total_image_width+left_padding+image_h_padding;
+ const int menu_xpos = xloc+image_width+left_padding+image_h_padding;
const int menu_ypos =
yloc+top_padding+text_and_image_height+menu_hpadding+ (use_textbox ?
text_widget.location().h + top_padding : 0);
if(menu_.height() > 0) {
menu_.set_loc(menu_xpos,menu_ypos);
@@ -667,21 +668,16 @@
disp.blit_surface(x,y,image);
- int center_font = 0;
- if(caption_size.w < image->w) {
- center_font = image->w/2 - caption_size.w/2;
- }
-
font::draw_text(&disp, clipRect, caption_font_size,
font::NORMAL_COLOUR, caption,
- xloc+left_padding+center_font,
- yloc+top_padding+image->h, NULL);
+ xloc+image_width+left_padding+image_h_padding,
+ yloc+top_padding, NULL);
}
font::draw_text(&disp, clipRect, message_font_size,
font::NORMAL_COLOUR, message,
-
xloc+total_image_width+left_padding+image_h_padding,
- yloc+top_padding);
+ xloc+image_width+left_padding+image_h_padding,
+ yloc+top_padding+caption_size.h);
//set the position of any tick boxes. they go right below the menu,
slammed against
//the right side of the dialog
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth/src show_dialog.cpp,
Isaac Clerencia <=