Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ui/button.cc19
-rw-r--r--src/ui/console.cc3
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;