[vlc-devel] commit: skins2: correct forgotten position and set default values ( Erwan Tulou )

git version control git at videolan.org
Mon Jan 25 20:09:57 CET 2010


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Mon Jan 25 08:31:11 2010 +0100| [afe5f8d6076ca8fd5a737ba89128c7fed1fa2d06] | committer: Erwan Tulou 

skins2: correct forgotten position and set default values

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=afe5f8d6076ca8fd5a737ba89128c7fed1fa2d06
---

 modules/gui/skins2/src/generic_window.cpp |   10 ++++++----
 modules/gui/skins2/src/generic_window.hpp |    3 ++-
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/modules/gui/skins2/src/generic_window.cpp b/modules/gui/skins2/src/generic_window.cpp
index 2394c46..609f1e3 100644
--- a/modules/gui/skins2/src/generic_window.cpp
+++ b/modules/gui/skins2/src/generic_window.cpp
@@ -170,10 +170,12 @@ void* GenericWindow::getOSHandle() const
 
 void GenericWindow::setParent( GenericWindow* pParent, int x, int y, int w, int h )
 {
-    // Update the window size
-    m_width = w;
-    m_height = h;
+    // Update the window size and position
+    m_left = x;
+    m_top = y;
+    m_width  = ( w > 0 ) ? w : m_width;
+    m_height = ( h > 0 ) ? h : m_height;
 
     void* handle = pParent ? pParent->getOSHandle() : NULL;
-    m_pOsWindow->reparent( handle, x, y, w, h );
+    m_pOsWindow->reparent( handle, m_left, m_top, m_width, m_height );
 }
diff --git a/modules/gui/skins2/src/generic_window.hpp b/modules/gui/skins2/src/generic_window.hpp
index cc7deb8..4f65239 100644
--- a/modules/gui/skins2/src/generic_window.hpp
+++ b/modules/gui/skins2/src/generic_window.hpp
@@ -96,7 +96,8 @@ public:
     void* getOSHandle() const;
 
     /// reparent
-    void setParent( GenericWindow* pParent, int x, int y, int w, int h );
+    void setParent( GenericWindow* pParent,
+                    int x = 0, int y = 0, int w = -1, int h = -1 );
 
 protected:
     /// Get the OS window




More information about the vlc-devel mailing list