]> git.sesse.net Git - vlc/commitdiff
skins2: remove unnecessary notifyLayout()
authorErwan Tulou <erwan10@videolan.org>
Thu, 14 Jan 2010 09:01:45 +0000 (10:01 +0100)
committerErwan Tulou <erwan10@videolan.org>
Thu, 14 Jan 2010 14:22:31 +0000 (15:22 +0100)
In today's implementation, notifyLayout() for a control leads to a whole
 layout rebuilt. Therefore, this function must be called _only_ if needed.

- Never needed in onResize() since we are already in the process of rebuilding
the whole layout. Calling notifyLayout() means the job is done twice.
- Never needed in onPositionChange() for the same reason as onResize().
- Not needed for a checkbox since already called in setImage() two lines above.

modules/gui/skins2/controls/ctrl_checkbox.cpp
modules/gui/skins2/controls/ctrl_list.cpp
modules/gui/skins2/controls/ctrl_tree.cpp

index 89c2c57ea21d749d140acc92466d7dd452299adb..0f0116faf31ce721ade15e50a5c179e84cf1824b 100644 (file)
@@ -276,7 +276,5 @@ void CtrlCheckbox::changeButton()
 
     // Notify the window the tooltip has changed
     notifyTooltipChange();
-    // Refresh
-    notifyLayout();
 }
 
index 28c8be54b6a7a41d9c06598ef3d257937358ddb1..4bf7d1e757115cd5a8df703bfbc933c48e7b2751 100644 (file)
@@ -78,9 +78,8 @@ void CtrlList::onUpdate( Subject<VarPercent> &rPercent, void *arg  )
     // Get the size of the control
     const Position *pPos = getPosition();
     if( !pPos )
-    {
         return;
-    }
+
     int height = pPos->getHeight();
 
     // How many lines can be displayed ?
@@ -114,9 +113,8 @@ void CtrlList::onResize()
     // Get the size of the control
     const Position *pPos = getPosition();
     if( !pPos )
-    {
         return;
-    }
+
     int height = pPos->getHeight();
 
     // How many lines can be displayed ?
@@ -142,14 +140,12 @@ void CtrlList::onResize()
     }
 
     makeImage();
-    notifyLayout();
 }
 
 
 void CtrlList::onPositionChange()
 {
     makeImage();
-    notifyLayout();
 }
 
 
index 7450b48ee5ee497f23e85f0a9f48c8e35914b863..31d9cb503e484d75cf2ed306a0cd5bae9e93a372 100644 (file)
@@ -244,13 +244,11 @@ void CtrlTree::onResize()
     // Redraw the control if the position has changed
     m_firstPos = it;
     makeImage();
-    notifyLayout();
 }
 
 void CtrlTree::onPositionChange()
 {
     makeImage();
-    notifyLayout();
 }
 
 void CtrlTree::handleEvent( EvtGeneric &rEvent )