]> git.sesse.net Git - vlc/commitdiff
implement some minimum size of wx interface at all times. closes ticket #360.
authorScott Caudle <zcot@videolan.org>
Mon, 21 Nov 2005 03:15:46 +0000 (03:15 +0000)
committerScott Caudle <zcot@videolan.org>
Mon, 21 Nov 2005 03:15:46 +0000 (03:15 +0000)
doc/developer/configure.ac
doc/intf-cdda.txt
doc/intf-vcd.txt
doc/subtitles/cvd-subtitles.txt
doc/subtitles/svcd-ogt-subtitles.txt
modules/gui/skins2/commands/cmd_minimize.cpp
modules/gui/skins2/commands/cmd_minimize.hpp
modules/gui/skins2/commands/cmd_playtree.cpp
modules/gui/skins2/commands/cmd_playtree.hpp
modules/gui/wxwidgets/interface.cpp
modules/gui/wxwidgets/interface.hpp

index f485f2dac7355c6d7bbdd1bef1dada6ab8987de3..b49dd1459a9da881bf7f497e073b0e448392bae2 100644 (file)
@@ -1,4 +1,4 @@
-dnl $Id: configure.ac,v 1.2 2004/02/13 11:33:38 rocky Exp $
+dnl $Id$
 dnl Process this file with autoconf to produce a configure script.
 
 AC_INIT(manual.xml.in,0.0.1)
index 4a753e80fd5d82ec41e1f7f89ef9dca9b48368f7..47a0669c4738ac37c250330b4f00667877b5b2c9 100644 (file)
@@ -447,4 +447,4 @@ analyze the contents of a CD.
 The tool cd-read from libcdio can be used to show the sectors of 
 the CD or CD image or extract sectors. 
 
-$Id: intf-cdda.txt,v 1.6 2004/02/11 12:37:28 rocky Exp $
+$Id$
index 98e1473b905eacae99d02d2a798379b62c2d608d..9aecac2911d7bce12803f31b6e48883b48d67aed 100644 (file)
@@ -544,4 +544,4 @@ http://www.vcdhelp.com/
 http://www.vcdimager.org/
 http://www.vcdimager.org/guides/#guides
 
-$Id: intf-vcd.txt,v 1.5 2004/02/11 12:37:28 rocky Exp $
+$Id$
index 055f0cb315b72aeedd0f9bfe492048ad2d4a1bd8..c471bbfe12f95afbb611f671b7706fa3bead10c1 100644 (file)
@@ -1,4 +1,4 @@
-$Id: cvd-subtitles.txt,v 1.4 2004/02/13 00:57:03 rocky Exp $
+$Id$
 The following information is culled from information from 
 Julio Sanchez Fernandez (http://subhandler.sourceforge.net)
 by Rocky Bernstein. 
index b2f3c5e0cc2c06a8a27d2be669b2d4d97fc9ec54..ecde936b42e89c61289e5a0480519c6f35ec5700 100644 (file)
@@ -1,4 +1,4 @@
-$Id: svcd-ogt-subtitles.txt,v 1.2 2004/02/13 00:57:03 rocky Exp $
+$Id$
 The following information is culled from information from 
 Julio Sanchez Fernandez (http://subhandler.sourceforge.net)
 by Rocky Bernstein. 
index 2439b0e2c2e808ea9eaf8be38ea1f0a9e5c6b2fc..558d5de1c564b0701ac5b4501aa3fbe99371cb0f 100644 (file)
@@ -2,7 +2,7 @@
  * cmd_minimize.cpp
  *****************************************************************************
  * Copyright (C) 2003 the VideoLAN team
- * $Id: cmd_fullscreen.cpp 6961 2004-03-05 17:34:23Z sam $
+ * $Id$
  *
  * Authors: Mohammed Adnène Trojette     <adn@via.ecp.fr>
  *
index 23b835192830c3fa644c80a1e4959f81a2b85d3d..f2de84adcf290f9581eba5a56ac8134bee64f7e4 100644 (file)
@@ -2,7 +2,7 @@
  * cmd_minimize.hpp
  *****************************************************************************
  * Copyright (C) 2003 the VideoLAN team
- * $Id: cmd_fullscreen.hpp 6961 2004-03-05 17:34:23Z sam $
+ * $Id$
  *
  * Authors: Mohammed Adnène Trojette     <adn@via.ecp.fr>
  *
index 5504e3496fc74cab6bdb55496e3d67e583fadb02..f908f95267a3a51d5efdc1d0e8ee7316d3107cca 100644 (file)
@@ -2,7 +2,7 @@
  * cmd_playtree.cpp
  *****************************************************************************
  * Copyright (C) 2005 VideoLAN
- * $Id: cmd_playlist.cpp 10101 2005-03-02 16:47:31Z robux4 $
+ * $Id$
  *
  * Authors: Antoine Cellerier <dionoea@videolan.org>
  *
index eb3d2a45a3f99e70accbd8b9d7c76882ba706add..ff9e796d85be2a0a0c319e13bb420c3fc7be89e7 100644 (file)
@@ -2,7 +2,7 @@
  * cmd_playtree.hpp
  *****************************************************************************
  * Copyright (C) 2005 VideoLAN
- * $Id: cmd_playlist.hpp 9934 2005-02-15 13:55:08Z courmisch $
+ * $Id$
  *
  * Authors: Antoine Cellerier <dionoea@videolan.org>
  *
index 3318f175cb02a6df2aff95e85e9e5cb8c9d206b5..8e119b6e5d975935b67cddc37401d7eba5197f8a 100644 (file)
@@ -336,13 +336,32 @@ Interface::Interface( intf_thread_t *_p_intf, long style ):
         Move( p );
 
     /* Set minimum window size to prevent user from glitching it */
+    wxSize  s2;
     s = GetSize();
+
+    /* save smallest possible default minimum size */
+    default_size = GetSize();
+
+    /* save slider size for height only for MinSizing */
+    slider_size = slider_sizer->GetSize();
+
+    /* and save extended gui size for MinSize scheme */
+    s2 = extra_frame->GetSize();
+    s2.SetWidth( s2.GetWidth() +
+                2 * wxSystemSettings::GetMetric( wxSYS_FRAMESIZE_X ) );
+    extended_size = s2;
+
+    /* Set initial minimum window size */
     if( config_GetInt( p_intf, "wx-embed" ) )
     {
-        wxSize  s2;
         s2 = video_window->GetSize();
         s.SetHeight( s.GetHeight() - s2.GetHeight() );
     }
+    if( config_GetInt( p_intf, "wx-extended" ) )
+    {
+        s.SetWidth( extended_size.GetWidth() );
+        s.SetHeight( s.GetHeight() + extended_size.GetHeight() );
+    }
 #if (wxCHECK_VERSION(2,5,4))
     SetMinSize( s );
 #else
@@ -506,22 +525,14 @@ void Interface::CreateOurMenuBar()
     HDC hdc = GetDC( NULL );
     for( unsigned int i = 0; i < menubar->GetMenuCount(); i++ )
     {
-        //                [ MENU BUTTON WIDTH CALCULATION ]
-        // [ SM_CXDLGFRAME + pixels + textextent + pixels + SM_CXDLGFRAME ]
         GetTextExtentPoint32( hdc, menubar->GetLabelTop(i).c_str(),
                                 menubar->GetLabelTop(i).Length(), &sizing );
-        // + text size..
-        i_size += sizing.cx;
-        // +1 more pixel on each size
-        i_size += 2;
-        // width of 2 DLGFRAME
-        i_size += GetSystemMetrics( SM_CXDLGFRAME ) * 2;
+
+        // [ SM_CXDLGFRAME + pixels + textextent + pixels + SM_CXDLGFRAME ]
+        i_size += sizing.cx + 2 + GetSystemMetrics( SM_CXDLGFRAME ) * 2;
     }
     ReleaseDC( NULL, hdc );
-    // Width of 2 edges of app window
-    i_size += GetSystemMetrics( SM_CXSIZEFRAME ) * 2;
-    // + 2 more pixels on each side..
-    i_size += 4;
+    i_size += GetSystemMetrics( SM_CXSIZEFRAME ) * 2 + 4;
 #endif
 /* End patch by zcot */
 
@@ -762,11 +773,27 @@ void Interface::ShowSlider( bool show, bool layout )
 
         //prevent continuous layout
         if( slider_frame->IsShown() ) return;
+        
+        wxSize ms = GetMinSize();
+        ms.SetHeight( ms.GetHeight() + slider_size.GetHeight() );
+#if ( wxCHECK_VERSION( 2,5,4 ) )
+        SetMinSize( ms );
+#else
+        frame_sizer->SetMinSize( ms );
+#endif
     }
     else
     {
         //prevent continuous layout
         if( !slider_frame->IsShown() ) return;
+        
+        wxSize ms = GetMinSize();
+        ms.SetHeight( ms.GetHeight() - slider_size.GetHeight() );
+#if ( wxCHECK_VERSION( 2,5,4 ) )
+        SetMinSize( ms );
+#else
+        frame_sizer->SetMinSize( ms );
+#endif
     }
 
     if( layout && p_intf->p_sys->b_video_autosize )
@@ -1009,11 +1036,27 @@ void Interface::OnExtended(wxCommandEvent& event)
     {
         extra_frame->Hide();
         frame_sizer->Hide( extra_frame );
+        wxSize ms = GetMinSize();
+        ms.SetHeight( ms.GetHeight() - extended_size.GetHeight() );
+        ms.SetWidth( default_size.GetWidth() );
+#if ( wxCHECK_VERSION( 2,5,4 ) )
+        SetMinSize( ms );
+#else
+        frame_sizer->SetMinSize( ms );
+#endif
     }
     else
     {
         extra_frame->Show();
         frame_sizer->Show( extra_frame );
+        wxSize ms = GetMinSize();
+        ms.SetHeight( ms.GetHeight() + extended_size.GetHeight() );
+        ms.SetWidth( extended_size.GetWidth() );
+#if ( wxCHECK_VERSION( 2,5,4 ) )
+        SetMinSize( ms );
+#else
+        frame_sizer->SetMinSize( ms );
+#endif
     }
     frame_sizer->Layout();
     frame_sizer->Fit(this);
index f1f58fbff2d1761982b34334a405812a6ea032b6..c9e0b2b790eec2c22b9f49b1605de16944d3ec7d 100644 (file)
@@ -187,6 +187,11 @@ namespace wxvlc
         wxMenu *p_audio_menu;
         wxMenu *p_video_menu;
         wxMenu *p_navig_menu;
+
+        /* utility dimensions */
+        wxSize default_size;
+        wxSize extended_size;
+        wxSize slider_size;
     };