Commit 650f0c34 authored by Jan Möbius's avatar Jan Möbius

More intelligent update handling for visibility

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7795 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 9d121eb4
...@@ -265,8 +265,11 @@ bool BaseObject::visible() { ...@@ -265,8 +265,11 @@ bool BaseObject::visible() {
} }
void BaseObject::visible(bool _visible) { void BaseObject::visible(bool _visible) {
visible_ = _visible; // Only do something if this is really a change
emit visibilityChanged( id() ); if ( visible_ != _visible ) {
visible_ = _visible;
emit visibilityChanged( id() );
}
} }
// =============================================================================== // ===============================================================================
......
...@@ -190,17 +190,21 @@ void BaseObjectData::path(QString _path ) { ...@@ -190,17 +190,21 @@ void BaseObjectData::path(QString _path ) {
// =============================================================================== // ===============================================================================
void BaseObjectData::show() { void BaseObjectData::show() {
separatorNode_->set_status( ACG::SceneGraph::BaseNode::Active ); if ( !visible_ ) {
visible_ = true; separatorNode_->set_status( ACG::SceneGraph::BaseNode::Active );
visible_ = true;
emit visibilityChanged( id() );
emit visibilityChanged( id() );
}
} }
void BaseObjectData::hide() { void BaseObjectData::hide() {
separatorNode_->set_status( ACG::SceneGraph::BaseNode::HideSubtree ); if ( visible_ ) {
visible_ = false; separatorNode_->set_status( ACG::SceneGraph::BaseNode::HideSubtree );
visible_ = false;
emit visibilityChanged( id() );
emit visibilityChanged( id() );
}
} }
bool BaseObjectData::visible(){ bool BaseObjectData::visible(){
...@@ -209,14 +213,17 @@ bool BaseObjectData::visible(){ ...@@ -209,14 +213,17 @@ bool BaseObjectData::visible(){
void BaseObjectData::visible(bool _visible) { void BaseObjectData::visible(bool _visible) {
if (_visible) if ( visible_ != _visible ) {
separatorNode_->set_status( ACG::SceneGraph::BaseNode::Active );
else if (_visible)
separatorNode_->set_status( ACG::SceneGraph::BaseNode::HideSubtree ); separatorNode_->set_status( ACG::SceneGraph::BaseNode::Active );
else
separatorNode_->set_status( ACG::SceneGraph::BaseNode::HideSubtree );
visible_ = _visible; visible_ = _visible;
emit visibilityChanged( id() ); emit visibilityChanged( id() );
}
} }
SeparatorNode* BaseObjectData::baseNode() { SeparatorNode* BaseObjectData::baseNode() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment