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>2012-12-02 22:10:24 +0000
committerStijn Buys <ingar@osirion.org>2012-12-02 22:10:24 +0000
commitac26aee2b567865404e2b5fb9964dae9b1af6679 (patch)
tree20af877ef6ab93812d5cd9327e2d5473bb80d8d2 /src/client
parentdf30620c548d23fa6f7632e280093824209d917a (diff)
Added inventory mount indicator.
Diffstat (limited to 'src/client')
-rw-r--r--src/client/inventorywindow.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/client/inventorywindow.cc b/src/client/inventorywindow.cc
index 9539061..1483325 100644
--- a/src/client/inventorywindow.cc
+++ b/src/client/inventorywindow.cc
@@ -7,6 +7,7 @@
#include "core/application.h"
#include "client/inventorywindow.h"
#include "ui/label.h"
+#include "ui/bitmap.h"
#include "ui/listitem.h"
#include "ui/paint.h"
#include "ui/ui.h"
@@ -135,6 +136,17 @@ void InventoryWindow::update_inventory()
sortkey += item->info()->label();
listitem->set_sortkey(sortkey);
+ // mount indicator
+ if (item->has_flag(core::Item::Mounted)) {
+ const float icon_size = 24.0f; // small icons
+ const float padding = ui::root()->font_large()->height();
+
+ ui::Bitmap *icon = new ui::Bitmap(listitem, "bitmaps/icons/button_unmount");
+ icon->set_background(true);
+ icon->set_size(icon_size, icon_size);
+ icon->set_location(ui::UI::elementsize.width() - icon_size - padding, padding);
+ }
+
// preserve previous selection during update
if (item == selecteditem) {
inventorywindow_listview->select(listitem);