[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src font.hpp titlescreen.cpp widgets/bu...
From: |
Yann Dirson |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src font.hpp titlescreen.cpp widgets/bu... |
Date: |
Fri, 24 Sep 2004 19:31:53 -0400 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Yann Dirson <address@hidden> 04/09/24 23:25:09
Modified files:
src : font.hpp titlescreen.cpp
src/widgets : button.cpp file_chooser.cpp menu.cpp
progressbar.cpp
Log message:
use normal/small/tiny types of fontsize names, use them in src/widgets
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/font.hpp.diff?tr1=1.40&tr2=1.41&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/titlescreen.cpp.diff?tr1=1.19&tr2=1.20&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/button.cpp.diff?tr1=1.41&tr2=1.42&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/file_chooser.cpp.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/menu.cpp.diff?tr1=1.60&tr2=1.61&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/progressbar.cpp.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
Patches:
Index: wesnoth/src/font.hpp
diff -u wesnoth/src/font.hpp:1.40 wesnoth/src/font.hpp:1.41
--- wesnoth/src/font.hpp:1.40 Fri Sep 24 23:04:49 2004
+++ wesnoth/src/font.hpp Fri Sep 24 23:25:09 2004
@@ -1,4 +1,4 @@
-/* $Id: font.hpp,v 1.40 2004/09/24 23:04:49 ydirson Exp $ */
+/* $Id: font.hpp,v 1.41 2004/09/24 23:25:09 ydirson Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -43,8 +43,9 @@
extern const char LARGE_TEXT, SMALL_TEXT, GOOD_TEXT, BAD_TEXT, NORMAL_TEXT,
BLACK_TEXT, BOLD_TEXT, IMAGE, NULL_MARKUP;
// font sizes, probably to make theme parameters
-const int SIZE_TITLESCREEN_VERSION = 10,
- SIZE_TITLESCREEN_TIPOFDAY = 14
+const int SIZE_NORMAL = 14,
+ SIZE_TINY = 10,
+ SIZE_SMALL = 12
;
//function to draw text on the screen. The text will be clipped to area.
Index: wesnoth/src/titlescreen.cpp
diff -u wesnoth/src/titlescreen.cpp:1.19 wesnoth/src/titlescreen.cpp:1.20
--- wesnoth/src/titlescreen.cpp:1.19 Fri Sep 24 23:04:49 2004
+++ wesnoth/src/titlescreen.cpp Fri Sep 24 23:25:09 2004
@@ -146,13 +146,13 @@
game_config::version;
const SDL_Rect version_area = font::draw_text(NULL,screen.screen_area(),
-
font::SIZE_TITLESCREEN_VERSION,
+ font::SIZE_TINY,
font::NORMAL_COLOUR,version_str,0,0);
const size_t versiony = screen.y() - version_area.h;
if(versiony < size_t(screen.y())) {
font::draw_text(&screen,screen.screen_area(),
- font::SIZE_TITLESCREEN_VERSION,
+ font::SIZE_TINY,
font::NORMAL_COLOUR,version_str,0,versiony);
}
@@ -202,17 +202,17 @@
std::string tip_of_day = get_tip_of_day(ntip);
if(tip_of_day.empty() == false) {
- tip_of_day =
font::word_wrap_text(tip_of_day,font::SIZE_TITLESCREEN_TIPOFDAY,
+ tip_of_day = font::word_wrap_text(tip_of_day,font::SIZE_NORMAL,
(game_config::title_tip_width*screen.x())/1024);
const std::string& tome = font::word_wrap_text(_("-- The Tome
of Wesnoth"),
-
font::SIZE_TITLESCREEN_TIPOFDAY,
+
font::SIZE_NORMAL,
(game_config::title_tip_width*screen.x())/1024);
const int pad = game_config::title_tip_padding;
- SDL_Rect area =
font::text_area(tip_of_day,font::SIZE_TITLESCREEN_TIPOFDAY);
- SDL_Rect tome_area =
font::text_area(tome,font::SIZE_TITLESCREEN_TIPOFDAY,TTF_STYLE_ITALIC);
+ SDL_Rect area = font::text_area(tip_of_day,font::SIZE_NORMAL);
+ SDL_Rect tome_area =
font::text_area(tome,font::SIZE_NORMAL,TTF_STYLE_ITALIC);
area.w = maximum<size_t>(area.w,tome_area.w) + 2*pad;
area.h += tome_area.h + next_tip_button.location().h + 3*pad;
@@ -223,8 +223,8 @@
draw_dialog_frame(area.x,area.y,area.w,area.h,screen,&style);
-
font::draw_text(&screen,area,font::SIZE_TITLESCREEN_TIPOFDAY,font::NORMAL_COLOUR,tip_of_day,area.x+pad,area.y+pad);
-
font::draw_text(&screen,area,font::SIZE_TITLESCREEN_TIPOFDAY,font::NORMAL_COLOUR,tome,area.x+area.w-tome_area.w-pad,next_tip_button.location().y-tome_area.h-pad,NULL,false,font::NO_MARKUP,TTF_STYLE_ITALIC);
+
font::draw_text(&screen,area,font::SIZE_NORMAL,font::NORMAL_COLOUR,tip_of_day,area.x+pad,area.y+pad);
+
font::draw_text(&screen,area,font::SIZE_NORMAL,font::NORMAL_COLOUR,tome,area.x+area.w-tome_area.w-pad,next_tip_button.location().y-tome_area.h-pad,NULL,false,font::NO_MARKUP,TTF_STYLE_ITALIC);
}
events::raise_draw_event();
Index: wesnoth/src/widgets/button.cpp
diff -u wesnoth/src/widgets/button.cpp:1.41 wesnoth/src/widgets/button.cpp:1.42
--- wesnoth/src/widgets/button.cpp:1.41 Sun Jul 18 19:02:25 2004
+++ wesnoth/src/widgets/button.cpp Fri Sep 24 23:25:09 2004
@@ -1,4 +1,4 @@
-/* $Id: button.cpp,v 1.41 2004/07/18 19:02:25 gruikya Exp $ */
+/* $Id: button.cpp,v 1.42 2004/09/24 23:25:09 ydirson Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -22,10 +22,10 @@
namespace gui {
-const int font_size = 12;
-const int horizontal_padding = 12;
-const int checkbox_horizontal_padding = 6;
-const int vertical_padding = 6;
+const int font_size = font::SIZE_SMALL;
+const int horizontal_padding = font::SIZE_SMALL;
+const int checkbox_horizontal_padding = font::SIZE_SMALL / 2;
+const int vertical_padding = font::SIZE_SMALL / 2;
button::button(display& disp, const std::string& label, button::TYPE type,
std::string button_image_name, SPACE_CONSUMPTION spacing) :
Index: wesnoth/src/widgets/file_chooser.cpp
diff -u wesnoth/src/widgets/file_chooser.cpp:1.5
wesnoth/src/widgets/file_chooser.cpp:1.6
--- wesnoth/src/widgets/file_chooser.cpp:1.5 Tue Aug 24 19:23:18 2004
+++ wesnoth/src/widgets/file_chooser.cpp Fri Sep 24 23:25:09 2004
@@ -122,7 +122,7 @@
}
display_current_files();
display_chosen_file();
- font::draw_text(&disp_, current_path_rect_, 14, font::NORMAL_COLOUR,
+ font::draw_text(&disp_, current_path_rect_, font::SIZE_NORMAL,
font::NORMAL_COLOUR,
current_dir_, current_path_rect_.x,
current_path_rect_.y,
disp_.video().getSurface());
set_dirty(false);
Index: wesnoth/src/widgets/menu.cpp
diff -u wesnoth/src/widgets/menu.cpp:1.60 wesnoth/src/widgets/menu.cpp:1.61
--- wesnoth/src/widgets/menu.cpp:1.60 Fri Sep 10 17:23:08 2004
+++ wesnoth/src/widgets/menu.cpp Fri Sep 24 23:25:09 2004
@@ -14,8 +14,8 @@
#include <numeric>
namespace {
-const size_t menu_font_size = 14;
-const size_t menu_cell_padding = 10;
+const size_t menu_font_size = font::SIZE_NORMAL;
+const size_t menu_cell_padding = font::SIZE_NORMAL * 3/5;
}
namespace gui {
Index: wesnoth/src/widgets/progressbar.cpp
diff -u wesnoth/src/widgets/progressbar.cpp:1.2
wesnoth/src/widgets/progressbar.cpp:1.3
--- wesnoth/src/widgets/progressbar.cpp:1.2 Sun Jul 18 19:02:25 2004
+++ wesnoth/src/widgets/progressbar.cpp Fri Sep 24 23:25:09 2004
@@ -29,12 +29,12 @@
SDL_FillRect(surf,&inner_area,SDL_MapRGB(surf->format,150,0,0));
const std::string text = str_cast(progress_) + "%";
- SDL_Rect text_area = font::text_area(text,14);
+ SDL_Rect text_area = font::text_area(text,font::SIZE_NORMAL);
text_area.x = area.x + area.w/2 - text_area.w/2;
text_area.y = area.y + area.h/2 - text_area.h/2;
-
font::draw_text(&disp(),location(),14,font::BLACK_COLOUR,text,text_area.x,text_area.y);
+
font::draw_text(&disp(),location(),font::SIZE_NORMAL,font::BLACK_COLOUR,text,text_area.x,text_area.y);
}
update_rect(location());
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth/src font.hpp titlescreen.cpp widgets/bu...,
Yann Dirson <=