From 3dc28baa287dd9d2169bace23bf89d2cb792e084 Mon Sep 17 00:00:00 2001 From: Emanuel Guevel Date: Sun, 17 Feb 2013 16:29:38 +0100 Subject: [PATCH] Remove "PinToggle" event from layout file --- apps/openmw/mwgui/window_pinnable_base.cpp | 24 ++++++++-------------- apps/openmw/mwgui/window_pinnable_base.hpp | 2 +- files/mygui/openmw_windows.skin.xml | 4 +--- 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/apps/openmw/mwgui/window_pinnable_base.cpp b/apps/openmw/mwgui/window_pinnable_base.cpp index 781c427ef..651b3a1e9 100644 --- a/apps/openmw/mwgui/window_pinnable_base.cpp +++ b/apps/openmw/mwgui/window_pinnable_base.cpp @@ -9,26 +9,20 @@ using namespace MWGui; WindowPinnableBase::WindowPinnableBase(const std::string& parLayout, MWBase::WindowManager& parWindowManager) : WindowBase(parLayout, parWindowManager), mPinned(false), mVisible(false) { - MyGUI::WindowPtr t = static_cast(mMainWidget); - t->eventWindowButtonPressed += MyGUI::newDelegate(this, &WindowPinnableBase::onWindowButtonPressed); - ExposedWindow* window = static_cast(mMainWidget); mPinButton = window->getSkinWidget ("Button"); + + mPinButton->eventMouseButtonClick += MyGUI::newDelegate(this, &WindowPinnableBase::onPinButtonClicked); } -void WindowPinnableBase::onWindowButtonPressed(MyGUI::Window* sender, const std::string& eventName) +void WindowPinnableBase::onPinButtonClicked(MyGUI::Widget* _sender) { - if ("PinToggle" == eventName) - { - mPinned = !mPinned; - - if (mPinned) - mPinButton->changeWidgetSkin ("PinDown"); - else - mPinButton->changeWidgetSkin ("PinUp"); + mPinned = !mPinned; - onPinToggled(); - } + if (mPinned) + mPinButton->changeWidgetSkin ("PinDown"); + else + mPinButton->changeWidgetSkin ("PinUp"); - eventDone(this); + onPinToggled(); } diff --git a/apps/openmw/mwgui/window_pinnable_base.hpp b/apps/openmw/mwgui/window_pinnable_base.hpp index 7426b16fc..50259858e 100644 --- a/apps/openmw/mwgui/window_pinnable_base.hpp +++ b/apps/openmw/mwgui/window_pinnable_base.hpp @@ -14,7 +14,7 @@ namespace MWGui bool pinned() { return mPinned; } private: - void onWindowButtonPressed(MyGUI::Window* sender, const std::string& eventName); + void onPinButtonClicked(MyGUI::Widget* _sender); protected: virtual void onPinToggled() = 0; diff --git a/files/mygui/openmw_windows.skin.xml b/files/mygui/openmw_windows.skin.xml index 93aa8fd20..73f68e80d 100644 --- a/files/mygui/openmw_windows.skin.xml +++ b/files/mygui/openmw_windows.skin.xml @@ -585,9 +585,7 @@ - - - +