diff options
author | Stijn Buys <ingar@osirion.org> | 2008-11-05 21:26:45 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-11-05 21:26:45 +0000 |
commit | 27ab3566118e77754fefb32a41ee06cf24a59dfe (patch) | |
tree | e736ec12975eac6ddbb91a8adf6b4af970dae0aa /src | |
parent | 4be6238b85e9d4b39c4f1fc23ba05952df78179a (diff) |
console scrollwheel, glowing ok button
Diffstat (limited to 'src')
-rw-r--r-- | src/ui/button.cc | 19 | ||||
-rw-r--r-- | src/ui/console.cc | 3 |
2 files changed, 16 insertions, 6 deletions
diff --git a/src/ui/button.cc b/src/ui/button.cc index 856c165..989e9eb 100644 --- a/src/ui/button.cc +++ b/src/ui/button.cc @@ -4,12 +4,15 @@ the terms of the GNU General Public License version 2 */ +#include <cmath> + #include "audio/audio.h" #include "auxiliary/functions.h" -#include "ui/paint.h" +#include "core/application.h" +#include "core/commandbuffer.h" #include "sys/sys.h" +#include "ui/paint.h" #include "ui/button.h" -#include "core/commandbuffer.h" namespace ui { @@ -46,9 +49,15 @@ void Button::set_command(const std::string &command) void Button::draw_border() { - if (has_mouse_focus()) - paint::color(palette()->foreground()); - else + if (has_mouse_focus()) { + math::Color color(palette()->foreground()); + float t = core::application()->time(); + t = t - floorf(t); + if (t > 0.5) + t = 1 - t; + color.a = 0.5f + t; + paint::color(color); + } else paint::color(palette()->border()); paint::border(global_location(), size()); diff --git a/src/ui/console.cc b/src/ui/console.cc index 759d67d..0b7c278 100644 --- a/src/ui/console.cc +++ b/src/ui/console.cc @@ -155,11 +155,12 @@ bool Console::on_keypress(const int key, const unsigned int modifier) } return true; break; + case 512 + SDL_BUTTON_WHEELUP: case SDLK_PAGEUP: console_scrollpane->inc_scroll(scroll_offset); return true; break; - + case 512 + SDL_BUTTON_WHEELDOWN: case SDLK_PAGEDOWN: console_scrollpane->dec_scroll(scroll_offset); return true; |