Author: sapient
Date: Fri Jun 22 06:14:10 2007
New Revision: 18368
URL: http://svn.gna.org/viewcvs/wesnoth?rev=18368&view=rev
Log:
an attempt to make disabled buttons more obviously disabled (bug #9121)
Modified:
trunk/changelog
trunk/src/sdl_utils.cpp
trunk/src/sdl_utils.hpp
trunk/src/widgets/button.cpp
Modified: trunk/changelog
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=18368&r1=18367&r2=18368&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Fri Jun 22 06:14:10 2007
@@ -52,6 +52,7 @@
terrain defense and turns to reach
* restore search of no-team-only map labels
* ability to delete Add-Ons
+ * make disabled buttons more obviously disabled
* Miscellaneous and bugfixes
* fix bug #4299: word wrap for menus with very long option strings
* various bugfixes and code cleanups
Modified: trunk/src/sdl_utils.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/sdl_utils.cpp?rev=18368&r1=18367&r2=18368&view=diff
==============================================================================
--- trunk/src/sdl_utils.cpp (original)
+++ trunk/src/sdl_utils.cpp Fri Jun 22 06:14:10 2007
@@ -31,6 +31,13 @@
(0x0000FF00 & rgb)>>8,
(0x000000FF & rgb), 0
};
+ return to_return;
+}
+
+Uint32 color_to_int(const SDL_Color& color) {
+ Uint32 to_return = color.r;
+ to_return = (to_return << 8) & color.g;
+ to_return = (to_return << 8) & color.b;
return to_return;
}
Modified: trunk/src/sdl_utils.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/sdl_utils.hpp?rev=18368&r1=18367&r2=18368&view=diff
==============================================================================
--- trunk/src/sdl_utils.hpp (original)
+++ trunk/src/sdl_utils.hpp Fri Jun 22 06:14:10 2007
@@ -143,6 +143,7 @@
bool operator!=(const SDL_Color& a, const SDL_Color& b);
SDL_Color inverse(const SDL_Color& colour);
SDL_Color int_to_color(const Uint32 rgb);
+Uint32 color_to_int(const SDL_Color& rgb);
class config; // no need to include config.hpp
Modified: trunk/src/widgets/button.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/widgets/button.cpp?rev=18368&r1=18367&r2=18368&view=diff
==============================================================================
--- trunk/src/widgets/button.cpp (original)
+++ trunk/src/widgets/button.cpp Fri Jun 22 06:14:10 2007
@@ -209,8 +209,10 @@
SDL_Color button_colour = font::BUTTON_COLOUR;
if (!enabled()) {
- image = greyscale_image(image);
- button_colour = font::STONED_COLOUR;
+ static const Uint32 disabled_btn_color = 0xAAAAAA;
+ static const double disabled_btn_adjust = 0.18;
+ image = blend_surface(greyscale_image(image),
disabled_btn_adjust, disabled_btn_color);
+ button_colour = font::GRAY_COLOUR;
}
video().blit_surface(loc.x, loc.y, image);
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits