Commit df92fa49 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: use a QGridLayout for the core of central Widget of the main Interface.

This will let us have a few extras widgets in the main dialog
parent c06416a2
......@@ -335,6 +335,7 @@ MainInterface::~MainInterface()
*****************************/
void MainInterface::recreateToolbars()
{
msg_Dbg( p_intf, "Recreating the toolbars" );
settings->beginGroup( "MainWindow" );
delete controls;
delete inputC;
......@@ -345,9 +346,9 @@ void MainInterface::recreateToolbars()
this, doComponentsUpdate() );
inputC = new InputControlsWidget( p_intf, this );
mainLayout->insertWidget( 2, inputC, 0, Qt::AlignBottom );
mainLayout->insertWidget( settings->value( "ToolbarPos", 0 ).toInt() ? 0: 3,
controls, 0, Qt::AlignBottom );
mainLayout->addWidget( inputC, 2, 0, 1, -1, Qt::AlignBottom );
mainLayout->addWidget( controls, settings->value( "ToolbarPos", 0 ).toInt() ? 0: 3,
0, 1, -1, Qt::AlignBottom );
settings->endGroup();
}
......@@ -356,7 +357,7 @@ void MainInterface::createMainWidget( QSettings *settings )
/* Create the main Widget and the mainLayout */
QWidget *main = new QWidget;
setCentralWidget( main );
mainLayout = new QVBoxLayout( main );
mainLayout = new QGridLayout( main );
/* Margins, spacing */
main->setContentsMargins( 0, 0, 0, 0 );
......@@ -399,11 +400,15 @@ void MainInterface::createMainWidget( QSettings *settings )
/* Add the controls Widget to the main Widget */
mainLayout->insertWidget( 0, bgWidget );
if( videoWidget ) mainLayout->insertWidget( 0, videoWidget, 10 );
mainLayout->insertWidget( 2, inputC, 0, Qt::AlignBottom );
mainLayout->insertWidget( settings->value( "ToolbarPos", 0 ).toInt() ? 0: 3,
controls, 0, Qt::AlignBottom );
if( videoWidget ){
mainLayout->addWidget( videoWidget, 0, 0, 1, -1 );
mainLayout->setRowStretch( 0, 10 );
}
mainLayout->addWidget( bgWidget, 1, 0, 1, -1 );
//mainLayout->setRowStretch( 1, 10 );
mainLayout->addWidget( inputC, 2, 0, 1, -1, Qt::AlignBottom );
mainLayout->addWidget( controls, settings->value( "ToolbarPos", 0 ).toInt() ? 0: 3,
0, 1, -1, Qt::AlignBottom );
/* Finish the sizing */
main->updateGeometry();
......@@ -839,7 +844,7 @@ void MainInterface::togglePlaylist()
}
else
{
mainLayout->insertWidget( 4, playlistWidget );
// mainLayout->insertWidget( 4, playlistWidget );
}
playlistVisible = true;
......
......@@ -104,7 +104,7 @@ private:
QSystemTrayIcon *sysTray;
QMenu *systrayMenu;
QString input_name;
QVBoxLayout *mainLayout;
QGridLayout *mainLayout;
ControlsWidget *controls;
InputControlsWidget *inputC;
FullscreenControllerWidget *fullscreenControls;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment