From 188f759f04150ef246adb7dd0e298c1dd2148df1 Mon Sep 17 00:00:00 2001 From: Karol Nowak Date: Fri, 4 Aug 2006 13:46:36 +0000 Subject: [PATCH] Tiny gui: reduce font and border size of help strings and tooltips. --- src/tooltips.cpp | 9 ++++++++- src/video.cpp | 12 +++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/tooltips.cpp b/src/tooltips.cpp index 4680b19845c..df69545b16b 100644 --- a/src/tooltips.cpp +++ b/src/tooltips.cpp @@ -80,8 +80,15 @@ void show_tooltip(const tooltip& tip) const SDL_Color bgcolour = {0,0,0,128}; SDL_Rect area = screen_area(); + +#ifdef USE_TINY_GUI + unsigned int border = 2; +#else + unsigned int border = 10; +#endif + tooltip_handle = font::add_floating_label(tip.message,font_size,font::NORMAL_COLOUR, - 0,0,0,0,-1,area,font::LEFT_ALIGN,&bgcolour,10); + 0,0,0,0,-1,area,font::LEFT_ALIGN,&bgcolour,border); SDL_Rect rect = font::get_floating_label_rect(tooltip_handle); diff --git a/src/video.cpp b/src/video.cpp index f6bad809627..875852ed829 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -403,7 +403,11 @@ int CVideo::set_help_string(const std::string& str) const SDL_Color colour = {0x0,0x00,0x00,0x77}; +#ifdef USE_TINY_GUI + int size = font::SIZE_NORMAL; +#else int size = font::SIZE_LARGE; +#endif while(size > 0) { if(font::line_width(str, size) > getx()) { @@ -413,7 +417,13 @@ int CVideo::set_help_string(const std::string& str) } } - help_string_ = font::add_floating_label(str,size,font::NORMAL_COLOUR,getx()/2,gety(),0.0,0.0,-1,screen_area(),font::CENTER_ALIGN,&colour,5); +#ifdef USE_TINY_GUI + int border = 2; +#else + int border = 5; +#endif + + help_string_ = font::add_floating_label(str,size,font::NORMAL_COLOUR,getx()/2,gety(),0.0,0.0,-1,screen_area(),font::CENTER_ALIGN,&colour,border); const SDL_Rect& rect = font::get_floating_label_rect(help_string_); font::move_floating_label(help_string_,0.0,-double(rect.h)); return help_string_;