]> git.sesse.net Git - vlc/commitdiff
skins2: correct forgotten position and set default values
authorErwan Tulou <erwan10@videolan.org>
Mon, 25 Jan 2010 07:31:11 +0000 (08:31 +0100)
committerErwan Tulou <erwan10@videolan.org>
Mon, 25 Jan 2010 19:08:36 +0000 (20:08 +0100)
modules/gui/skins2/src/generic_window.cpp
modules/gui/skins2/src/generic_window.hpp

index 2394c46dd69ad8b8e0c9c4ff43d34b87a4aacaf0..609f1e337013a44a6e1911dfacb801c943244455 100644 (file)
@@ -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 );
 }
index cc7deb8148aae876481fa0d1c26be20cc7328998..4f6523981181c5aa7edae28201cce1e93ceaa2b0 100644 (file)
@@ -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