From a9f7a30d906f2775cf76a57f0a3314886cc18f26 Mon Sep 17 00:00:00 2001 From: MiroslavR Date: Sat, 16 Aug 2014 13:12:02 +0200 Subject: [PATCH] HBox, VBox: call parent setPropertyOverride --- apps/openmw/mwgui/widgets.cpp | 12 +++++++++--- apps/openmw/mwgui/widgets.hpp | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwgui/widgets.cpp b/apps/openmw/mwgui/widgets.cpp index de48a9d3e8..41714a9bbd 100644 --- a/apps/openmw/mwgui/widgets.cpp +++ b/apps/openmw/mwgui/widgets.cpp @@ -670,7 +670,7 @@ namespace MWGui align(); } - void Box::_setPropertyImpl(const std::string& _key, const std::string& _value) + bool Box::_setPropertyImpl(const std::string& _key, const std::string& _value) { if (_key == "Spacing") mSpacing = MyGUI::utility::parseValue(_value); @@ -678,6 +678,10 @@ namespace MWGui mPadding = MyGUI::utility::parseValue(_value); else if (_key == "AutoResize") mAutoResize = MyGUI::utility::parseValue(_value); + else + return false; + + return true; } void HBox::align () @@ -756,7 +760,8 @@ namespace MWGui void HBox::setPropertyOverride(const std::string& _key, const std::string& _value) { - Box::_setPropertyImpl (_key, _value); + if (!Box::_setPropertyImpl (_key, _value)) + MyGUI::Widget::setPropertyOverride(_key, _value); } void HBox::setSize (const MyGUI::IntSize& _value) @@ -892,7 +897,8 @@ namespace MWGui void VBox::setPropertyOverride(const std::string& _key, const std::string& _value) { - Box::_setPropertyImpl (_key, _value); + if (!Box::_setPropertyImpl (_key, _value)) + MyGUI::Widget::setPropertyOverride(_key, _value); } void VBox::setSize (const MyGUI::IntSize& _value) diff --git a/apps/openmw/mwgui/widgets.hpp b/apps/openmw/mwgui/widgets.hpp index adc56f423f..dad49eb45a 100644 --- a/apps/openmw/mwgui/widgets.hpp +++ b/apps/openmw/mwgui/widgets.hpp @@ -367,7 +367,7 @@ namespace MWGui protected: virtual void align() = 0; - virtual void _setPropertyImpl(const std::string& _key, const std::string& _value); + virtual bool _setPropertyImpl(const std::string& _key, const std::string& _value); int mSpacing; // how much space to put between elements