[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src/widgets button.cpp
From: |
Yann Dirson |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src/widgets button.cpp |
Date: |
Thu, 21 Oct 2004 20:14:32 -0400 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Yann Dirson <address@hidden> 04/10/22 00:09:07
Modified files:
src/widgets : button.cpp
Log message:
do not make bitmap size a minimum size for butons in USE_TINY_GUI
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/button.cpp.diff?tr1=1.42&tr2=1.43&r1=text&r2=text
Patches:
Index: wesnoth/src/widgets/button.cpp
diff -u wesnoth/src/widgets/button.cpp:1.42 wesnoth/src/widgets/button.cpp:1.43
--- wesnoth/src/widgets/button.cpp:1.42 Fri Sep 24 23:25:09 2004
+++ wesnoth/src/widgets/button.cpp Fri Oct 22 00:09:07 2004
@@ -1,4 +1,4 @@
-/* $Id: button.cpp,v 1.42 2004/09/24 23:25:09 ydirson Exp $ */
+/* $Id: button.cpp,v 1.43 2004/10/22 00:09:07 ydirson Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -30,7 +30,7 @@
button::button(display& disp, const std::string& label, button::TYPE type,
std::string button_image_name, SPACE_CONSUMPTION spacing) :
widget(disp), label_(label), display_(&disp),
- image_(NULL),
pressedImage_(NULL), activeImage_(NULL), pressedActiveImage_(NULL),
+ image_(NULL), pressedImage_(NULL),
activeImage_(NULL), pressedActiveImage_(NULL),
button_(true), state_(NORMAL), type_(type),
enabled_(true), pressed_(false)
{
set_label(label);
@@ -72,15 +72,21 @@
textRect_ = font::draw_text(NULL,textRect_,font_size,
font::BUTTON_COLOUR,label_,0,0);
+#ifdef USE_TINY_GUI
+ set_height(textRect_.h+vertical_padding);
+#else
set_height(maximum(textRect_.h+vertical_padding,button_image->h));
-
+#endif
if(type == TYPE_PRESS) {
+#ifdef USE_TINY_GUI
+ set_width(textRect_.w + horizontal_padding);
+#else
if(spacing == MINIMUM_SPACE) {
set_width(textRect_.w + horizontal_padding);
} else {
set_width(maximum(textRect_.w+horizontal_padding,button_image->w));
}
-
+#endif
image_.assign(scale_surface(button_image,location().w,location().h));
pressedImage_.assign(scale_surface(pressed_image,location().w,location().h));
activeImage_.assign(scale_surface(active_image,location().w,location().h));
- [Wesnoth-cvs-commits] wesnoth/src/widgets button.cpp,
Yann Dirson <=