Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-11-05 21:26:45 +0000
committerStijn Buys <ingar@osirion.org>2008-11-05 21:26:45 +0000
commit27ab3566118e77754fefb32a41ee06cf24a59dfe (patch)
treee736ec12975eac6ddbb91a8adf6b4af970dae0aa /src/ui/button.cc
parent4be6238b85e9d4b39c4f1fc23ba05952df78179a (diff)
console scrollwheel, glowing ok button
Diffstat (limited to 'src/ui/button.cc')
-rw-r--r--src/ui/button.cc19
1 files changed, 14 insertions, 5 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());