/* Set The Video In emebedded Mode or not */
videoEmbeddedFlag = config_GetInt( p_intf, "embedded-video" );
+ /* Do we confine videos within a persistent resizeable window */
+ b_keep_size = config_GetInt( p_intf, "qt-keep-size" );
+
/* Are we in the enhanced always-video mode or not ? */
i_visualmode = config_GetInt( p_intf, "qt-display-mode" );
settings = getSettings();
settings->beginGroup( "MainWindow" );
+ /**
+ * Retrieve saved sizes for main window
+ * mainBasedSize = based window size for normal mode
+ * (no video, no background)
+ * mainVideoSize = window size with video (all modes)
+ **/
+ mainBasedSize = settings->value( "mainBasedSize", QSize( 350, 120 ) ).toSize();
+ mainVideoSize = settings->value( "mainVideoSize", QSize( 400, 300 ) ).toSize();
+
/* Visualisation, not really used yet */
visualSelectorEnabled = settings->value( "visual-selector", false).toBool();
settings->beginGroup( "MainWindow" );
QVLCTools::restoreWidgetPosition( settings, this, QSize(380, 60) );
+ /* resize to previously saved main window size if appicable */
+ if( b_keep_size )
+ {
+ if( i_visualmode == QT_ALWAYS_VIDEO_MODE ||
+ i_visualmode == QT_MINIMAL_MODE )
+ {
+ resize( mainVideoSize );
+ }
+ else
+ {
+ resize( mainBasedSize );
+ }
+ }
+
bool b_visible = settings->value( "playlist-visible", 0 ).toInt();
settings->endGroup();
settings->setValue( "adv-controls",
getControlsVisibilityStatus() & CONTROLS_ADVANCED );
+ settings->setValue( "mainBasedSize", mainBasedSize );
+ settings->setValue( "mainVideoSize", mainVideoSize );
+
if( bgWidget )
settings->setValue( "backgroundSize", bgWidget->size() );
mainLayout->insertWidget( settings->value( "ToolbarPos", 0 ).toInt() ? 0: 3,
controls, 0, Qt::AlignBottom );
-
/* Finish the sizing */
main->updateGeometry();
QSize MainInterface::sizeHint() const
{
+ if( b_keep_size )
+ {
+ if( i_visualmode == QT_ALWAYS_VIDEO_MODE ||
+ i_visualmode == QT_MINIMAL_MODE )
+ {
+ return mainVideoSize;
+ }
+ else
+ {
+ if( VISIBLE( bgWidget) ||
+ ( videoIsActive && videoWidget->isVisible() )
+ )
+ return mainVideoSize;
+ else
+ return mainBasedSize;
+ }
+ }
+
int nwidth = controls->sizeHint().width();
int nheight = controls->isVisible() ?
controls->size().height()
unsigned int *pi_height )
{
/* Request the videoWidget */
- void *ret = videoWidget->request( p_nvout,pi_x, pi_y, pi_width, pi_height );
+ void *ret = videoWidget->request( p_nvout,pi_x, pi_y,
+ pi_width, pi_height, b_keep_size );
if( ret ) /* The videoWidget is available */
{
/* Did we have a bg ? Hide it! */
e->ignore();
}
+void MainInterface::resizeEvent( QResizeEvent * event )
+{
+ if( b_keep_size )
+ {
+ if( i_visualmode == QT_ALWAYS_VIDEO_MODE ||
+ i_visualmode == QT_MINIMAL_MODE )
+ {
+ mainVideoSize = size();
+ }
+ else
+ {
+ if( VISIBLE( bgWidget) ||
+ ( videoIsActive && videoWidget->isVisible() )
+ )
+ mainVideoSize = size();
+ else
+ mainBasedSize = size();
+ }
+ }
+}
+
void MainInterface::wheelEvent( QWheelEvent *e )
{
int i_vlckey = qtWheelEventToVLCKey( e );
#define MINIMIZED_LONGTEXT N_( "VLC will start with just an icon in " \
"your taskbar" )
+#define KEEPSIZE_TEXT N_( "Confine video to a persistent resizable window" )
+#define KEEPSIZE_LONGTEXT N_( "You can choose to confine a video to a " \
+ "persistent resizeable window or let it freely " \
+ "expand to match the original size. " \
+ "By default, videos are expanded to original size." )
+
#define TITLE_TEXT N_( "Show playing item name in window title" )
#define TITLE_LONGTEXT N_( "Show the name of the song or video in the " \
"controler window title." )
SYSTRAY_LONGTEXT, false);
add_bool( "qt-start-minimized", false, NULL, MINIMIZED_TEXT,
MINIMIZED_LONGTEXT, true);
+ add_bool( "qt-keep-size", false, NULL, KEEPSIZE_TEXT,
+ KEEPSIZE_LONGTEXT, false )
add_bool( "qt-name-in-title", true, NULL, TITLE_TEXT,
TITLE_LONGTEXT, false );
add_bool( "qt-fs-controller", true, NULL, QT_FULLSCREEN_TEXT,