]> git.sesse.net Git - vlc/commitdiff
skins2: drag&drop (small tweak)
authorErwan Tulou <erwan10@videolan.org>
Mon, 6 Jun 2011 21:21:10 +0000 (23:21 +0200)
committerErwan Tulou <erwan10@videolan.org>
Mon, 6 Jun 2011 21:34:40 +0000 (23:34 +0200)
Rather than automatically expanding folders when hoving over them, use this
information (folder expanded or not) to either insert the dropped item as its
next sibling in the parent folder or as its first child in this folder respectively.

modules/gui/skins2/controls/ctrl_tree.cpp
modules/gui/skins2/vars/playtree.cpp

index f86ac4bb12eb985075dd368bb562ca5e2887feed..32a90db32053bd3a5cad4f528e04dba1a8e596e3 100644 (file)
@@ -504,8 +504,6 @@ void CtrlTree::handleEvent( EvtGeneric &rEvent )
         Iterator it = findItemAtPos( yPos );
         if( it != m_itOver )
         {
-            if( it != m_rTree.end() )
-                it->setExpanded( true );
             m_itOver = it;
             needRefresh = true;
         }
index 89d2900403eeedfd84530d98908816fea4b129cc..ce529eb1a4f2a5003c93389ae17bdc8133bebeaa 100644 (file)
@@ -290,7 +290,7 @@ void Playtree::insertItems( VarTree& elem, const list<string>& files, bool start
         p_node = m_pPlaylist->p_ml_category;
         i_pos = 0;
     }
-    else if( p_elem->size() )
+    else if( p_elem->size() && p_elem->isExpanded() )
     {
         p_node = playlist_ItemGetById( m_pPlaylist, p_elem->getId() );
         i_pos = 0;