]> git.sesse.net Git - vlc/commitdiff
* ctrl_*.cpp : mouse scrolling behavior change
authorAntoine Cellerier <dionoea@videolan.org>
Sat, 20 Aug 2005 09:26:46 +0000 (09:26 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Sat, 20 Aug 2005 09:26:46 +0000 (09:26 +0000)
 * skin_parser.cpp : add comment so people know where to look to fix the
                     Playlist slider breakage.

modules/gui/skins2/controls/ctrl_list.cpp
modules/gui/skins2/controls/ctrl_tree.cpp
modules/gui/skins2/parser/skin_parser.cpp

index 204164a66b55cfc9fb3c0600ed32e028fb5dbfac..e533a1e9f571eabd5041d3923f17c2c31e4e0944 100644 (file)
@@ -332,13 +332,14 @@ void CtrlList::handleEvent( EvtGeneric &rEvent )
         int direction = ((EvtScroll&)rEvent).getDirection();
 
         double percentage = m_rList.getPositionVar().get();
+        double step = 2.0 / (double)m_rList.size();
         if( direction == EvtScroll::kUp )
         {
-            percentage += SCROLL_STEP;
+            percentage += step;
         }
         else
         {
-            percentage -= SCROLL_STEP;
+            percentage -= step;
         }
         m_rList.getPositionVar().set( percentage );
     }
index 71afa8b84cefa0cf21556f5430a96d4ff980ac4c..ae8648150b1ad81080a994840d72e1918b8ae412 100644 (file)
@@ -345,13 +345,14 @@ void CtrlTree::handleEvent( EvtGeneric &rEvent )
         int direction = ((EvtScroll&)rEvent).getDirection();
 
         double percentage = m_rTree.getPositionVar().get();
+        double step = 2.0 / (double)m_rTree.visibleItems();
         if( direction == EvtScroll::kUp )
         {
-            percentage += SCROLL_STEP;
+            percentage += step;
         }
         else
         {
-            percentage -= SCROLL_STEP;
+            percentage -= step;
         }
         m_rTree.getPositionVar().set( percentage );
     }
index 64553bba8c3d94113dfb3ea3ebe59a35ad372f0b..499b2886768e125bad29929e746451de4682dc2b 100644 (file)
@@ -331,7 +331,7 @@ void SkinParser::handleBeginElement( const string &rName, AttrList_t &attr )
         {
             // Slider associated to a list
             newValue = "playlist.slider";
-            // FIXME
+            // FIXME : this breaks slider usage in old style Playlists
             newValue = "playtree.slider";
         }
         const BuilderData::Slider slider( uniqueId( attr["id"] ),