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-16 18:47:01 +0000
committerStijn Buys <ingar@osirion.org>2008-11-16 18:47:01 +0000
commit44158ccfbe943b832c0e0bf9ce547212aa6c2b8b (patch)
tree3749d855271779b65283f86599c0faebdfdf4318 /src/client/view.cc
parent315a8c2dff9b76ac5e1ebbef265f13ac19d65e3d (diff)
camera zoom
Diffstat (limited to 'src/client/view.cc')
-rw-r--r--src/client/view.cc21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/client/view.cc b/src/client/view.cc
index 0f981ca..de867c0 100644
--- a/src/client/view.cc
+++ b/src/client/view.cc
@@ -165,10 +165,25 @@ KeyPress::KeyPress(ui::Widget *parent) : Widget(parent)
void KeyPress::draw()
{
- if(input::last_key_pressed()) {
- ui::paint::color(palette()->highlight());
- ui::paint::label(global_location(), size(), font(), input::last_key_pressed()->name(), ui::AlignCenter);
+ std::string label;
+ ui::paint::color(palette()->highlight());
+
+ Key::Modifier mod = input::modifier();
+ if (mod != Key::None) {
+ if (mod == Key::Shift)
+ label.assign("shift+");
+ else if (mod == Key::Ctrl)
+ label.assign("ctrl+");
+ else if (mod == Key::Alt)
+ label.assign("alt+");
+ }
+
+ if(input::last_key_pressed()) {
+ label.append(input::last_key_pressed()->name());
}
+
+ if (label.size())
+ ui::paint::label(global_location(), size(), font(), label , ui::AlignCenter);
}
/* -- View --------------------------------------------------------- */