From: dooglus Date: Fri, 11 Apr 2008 15:37:34 +0000 (+0000) Subject: When multiple layers are selected, only show parameters which are present in all... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=8d84ce1bd606706b14e876d61856644b9d5d3c20;p=synfig.git When multiple layers are selected, only show parameters which are present in all selected layers *with the same type*. git-svn-id: http://svn.voria.com/code@2015 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/src/gtkmm/layerparamtreestore.cpp b/synfig-studio/trunk/src/gtkmm/layerparamtreestore.cpp index 610c2bb..90a88c0 100644 --- a/synfig-studio/trunk/src/gtkmm/layerparamtreestore.cpp +++ b/synfig-studio/trunk/src/gtkmm/layerparamtreestore.cpp @@ -322,6 +322,7 @@ LayerParamTreeStore::rebuild() struct REBUILD_HELPER { ParamVocab vocab; + Layer::Handle layer_0; static ParamVocab::iterator find_param_desc(ParamVocab& vocab, const synfig::String& x) { @@ -333,14 +334,17 @@ LayerParamTreeStore::rebuild() return iter; } - void process_vocab(ParamVocab x) + void process_vocab(synfig::Layer::Handle layer_n) { + ParamVocab x = layer_n->get_param_vocab(); ParamVocab::iterator iter; for(iter=vocab.begin();iter!=vocab.end();++iter) { - ParamVocab::iterator iter2(find_param_desc(x,iter->get_name())); - if(iter2==x.end()) + String name(iter->get_name()); + ParamVocab::iterator iter2(find_param_desc(x,name)); + if(iter2==x.end() || + layer_0->get_param(name).get_type() != layer_n->get_param(name).get_type()) { // remove it and start over vocab.erase(iter); @@ -357,10 +361,11 @@ LayerParamTreeStore::rebuild() { LayerList::iterator iter(layer_list.begin()); rebuild_helper.vocab=(*iter)->get_param_vocab(); + rebuild_helper.layer_0=*iter; for(++iter;iter!=layer_list.end();++iter) { - rebuild_helper.process_vocab((*iter)->get_param_vocab()); + rebuild_helper.process_vocab(*iter); changed_connection_list.push_back( (*iter)->signal_changed().connect( sigc::mem_fun(