From ac26aee2b567865404e2b5fb9964dae9b1af6679 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 2 Dec 2012 22:10:24 +0000 Subject: Added inventory mount indicator. --- src/client/inventorywindow.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/client') 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); -- cgit v1.2.3