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() ...@@ -335,6 +335,7 @@ MainInterface::~MainInterface()
*****************************/ *****************************/
void MainInterface::recreateToolbars() void MainInterface::recreateToolbars()
{ {
msg_Dbg( p_intf, "Recreating the toolbars" );
settings->beginGroup( "MainWindow" ); settings->beginGroup( "MainWindow" );
delete controls; delete controls;
delete inputC; delete inputC;
...@@ -345,9 +346,9 @@ void MainInterface::recreateToolbars() ...@@ -345,9 +346,9 @@ void MainInterface::recreateToolbars()
this, doComponentsUpdate() ); this, doComponentsUpdate() );
inputC = new InputControlsWidget( p_intf, this ); inputC = new InputControlsWidget( p_intf, this );
mainLayout->insertWidget( 2, inputC, 0, Qt::AlignBottom ); mainLayout->addWidget( inputC, 2, 0, 1, -1, Qt::AlignBottom );
mainLayout->insertWidget( settings->value( "ToolbarPos", 0 ).toInt() ? 0: 3, mainLayout->addWidget( controls, settings->value( "ToolbarPos", 0 ).toInt() ? 0: 3,
controls, 0, Qt::AlignBottom ); 0, 1, -1, Qt::AlignBottom );
settings->endGroup(); settings->endGroup();
} }
...@@ -356,7 +357,7 @@ void MainInterface::createMainWidget( QSettings *settings ) ...@@ -356,7 +357,7 @@ void MainInterface::createMainWidget( QSettings *settings )
/* Create the main Widget and the mainLayout */ /* Create the main Widget and the mainLayout */
QWidget *main = new QWidget; QWidget *main = new QWidget;
setCentralWidget( main ); setCentralWidget( main );
mainLayout = new QVBoxLayout( main ); mainLayout = new QGridLayout( main );
/* Margins, spacing */ /* Margins, spacing */
main->setContentsMargins( 0, 0, 0, 0 ); main->setContentsMargins( 0, 0, 0, 0 );
...@@ -399,11 +400,15 @@ void MainInterface::createMainWidget( QSettings *settings ) ...@@ -399,11 +400,15 @@ void MainInterface::createMainWidget( QSettings *settings )
/* Add the controls Widget to the main Widget */ /* Add the controls Widget to the main Widget */
mainLayout->insertWidget( 0, bgWidget ); if( videoWidget ){
if( videoWidget ) mainLayout->insertWidget( 0, videoWidget, 10 ); mainLayout->addWidget( videoWidget, 0, 0, 1, -1 );
mainLayout->insertWidget( 2, inputC, 0, Qt::AlignBottom ); mainLayout->setRowStretch( 0, 10 );
mainLayout->insertWidget( settings->value( "ToolbarPos", 0 ).toInt() ? 0: 3, }
controls, 0, Qt::AlignBottom ); 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 */ /* Finish the sizing */
main->updateGeometry(); main->updateGeometry();
...@@ -839,7 +844,7 @@ void MainInterface::togglePlaylist() ...@@ -839,7 +844,7 @@ void MainInterface::togglePlaylist()
} }
else else
{ {
mainLayout->insertWidget( 4, playlistWidget ); // mainLayout->insertWidget( 4, playlistWidget );
} }
playlistVisible = true; playlistVisible = true;
......
...@@ -104,7 +104,7 @@ private: ...@@ -104,7 +104,7 @@ private:
QSystemTrayIcon *sysTray; QSystemTrayIcon *sysTray;
QMenu *systrayMenu; QMenu *systrayMenu;
QString input_name; QString input_name;
QVBoxLayout *mainLayout; QGridLayout *mainLayout;
ControlsWidget *controls; ControlsWidget *controls;
InputControlsWidget *inputC; InputControlsWidget *inputC;
FullscreenControllerWidget *fullscreenControls; 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