From 3209f48daa8107aaf5f8a203482bc3af0c885d1d Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Wed, 15 Oct 2014 12:09:57 +0200 Subject: [PATCH 1/2] Don't drop the texture property just because there's no texture assigned... --HG-- branch : dfighter-tools --- code/studio/src/plugins/gui_editor/property_browser_ctrl.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/code/studio/src/plugins/gui_editor/property_browser_ctrl.cpp b/code/studio/src/plugins/gui_editor/property_browser_ctrl.cpp index c518d7acc..6db5423a3 100644 --- a/code/studio/src/plugins/gui_editor/property_browser_ctrl.cpp +++ b/code/studio/src/plugins/gui_editor/property_browser_ctrl.cpp @@ -713,9 +713,6 @@ namespace GUIEditor { std::string j = element->getProperty( prop.propName ); - if( j.empty() ) - return; - QtProperty *pp = textureMgr->addProperty( prop.propName.c_str() ); if( pp == NULL ) return; From f91846c9709d708c9f9641892e0ddbddf730b650 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Wed, 15 Oct 2014 19:46:43 +0200 Subject: [PATCH 2/2] Fix parent pos and size parsing. --HG-- branch : dfighter-tools --- code/nel/include/nel/gui/interface_element.h | 2 + code/nel/src/gui/interface_element.cpp | 44 +++++++++++++++++++- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/code/nel/include/nel/gui/interface_element.h b/code/nel/include/nel/gui/interface_element.h index 0f9b271ce..c1f6d20e7 100644 --- a/code/nel/include/nel/gui/interface_element.h +++ b/code/nel/include/nel/gui/interface_element.h @@ -491,8 +491,10 @@ namespace NLGUI void setEditorSelected( bool b ){ editorSelected = b; } bool isEditorSelected() const{ return editorSelected; } + void parsePosParent( const std::string &id ); void setPosParent( const std::string &id ); void getPosParent( std::string &id ) const; + void parseSizeParent( const std::string &id ); void setSizeParent( const std::string &id ); void getSizeParent( std::string &id ) const; diff --git a/code/nel/src/gui/interface_element.cpp b/code/nel/src/gui/interface_element.cpp index 620e7dbdb..66eee038e 100644 --- a/code/nel/src/gui/interface_element.cpp +++ b/code/nel/src/gui/interface_element.cpp @@ -388,13 +388,13 @@ namespace NLGUI ptr = (char*) xmlGetProp( cur, (xmlChar*)"posparent" ); if (ptr) { - setPosParent( std::string( (const char*)ptr ) ); + parsePosParent( (const char*)ptr ); } ptr = (char*) xmlGetProp( cur, (xmlChar*)"sizeparent" ); if (ptr) { - setSizeParent( std::string( (const char*)ptr ) ); + parseSizeParent( (const char*)ptr ); } ptr = (char*) xmlGetProp (cur, (xmlChar*)"sizeref"); @@ -1532,6 +1532,26 @@ namespace NLGUI return false; } + void CInterfaceElement::parsePosParent( const std::string &id ) + { + CInterfaceElement *p = getParent(); + + if( ( id == "parent" ) || ( id.empty() ) ) + { + setParentPos( p ); + return; + } + + std::string ppId; + + if( p != NULL ) + ppId = p->getId() + ":" + id; + else + ppId = std::string( "ui:" ) + id; + + CWidgetManager::getInstance()->getParser()->addParentPositionAssociation( this, ppId ); + } + void CInterfaceElement::setPosParent( const std::string &id ) { // Parent or empty id simply means the group parent @@ -1596,6 +1616,26 @@ namespace NLGUI id = p->getId(); } + void CInterfaceElement::parseSizeParent( const std::string &id ) + { + CInterfaceElement *p = getParent(); + + if( ( id == "parent" ) || ( id.empty() ) ) + { + setParentSize( p ); + return; + } + + std::string spId; + + if( p != NULL ) + spId = p->getId() + ":" + id; + else + spId = std::string( "ui:" ) + id; + + CWidgetManager::getInstance()->getParser()->addParentSizeAssociation( this, spId ); + } + void CInterfaceElement::setSizeParent( const std::string &id ) { // Parent or empty id simply means the group parent