1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-08 18:39:29 +00:00
OpenMW/apps/openmw/mwgui/windowpinnablebase.cpp
Emanuel Guevel b2e5e8dd0d Saner inventory window pinning/hiding
Hide inventory window pin button in container, companion and barter mode.
Restore the pinned inventory window position when exiting these modes.
Allow toggling windows visibility in inventory mode only.
2013-08-07 23:30:08 +02:00

33 lines
854 B
C++

#include "windowpinnablebase.hpp"
#include "exposedwindow.hpp"
namespace MWGui
{
WindowPinnableBase::WindowPinnableBase(const std::string& parLayout)
: WindowBase(parLayout), mPinned(false)
{
ExposedWindow* window = static_cast<ExposedWindow*>(mMainWidget);
mPinButton = window->getSkinWidget ("Button");
mPinButton->eventMouseButtonClick += MyGUI::newDelegate(this, &WindowPinnableBase::onPinButtonClicked);
}
void WindowPinnableBase::onPinButtonClicked(MyGUI::Widget* _sender)
{
mPinned = !mPinned;
if (mPinned)
mPinButton->changeWidgetSkin ("PinDown");
else
mPinButton->changeWidgetSkin ("PinUp");
onPinToggled();
}
void WindowPinnableBase::setPinButtonVisible(bool visible)
{
mPinButton->setVisible(visible);
}
}