[vlc-commits] Qt: fix position the toolbar above the video (fixes #15306)
Daniel Amm
git at videolan.org
Mon Oct 30 11:24:12 CET 2017
vlc | branch: master | Daniel Amm <da2424 at t-online.de> | Wed Oct 25 20:40:40 2017 +0200| [631ffade676b7971577ecf4b0dcbb3515307cc29] | committer: Jean-Baptiste Kempf
Qt: fix position the toolbar above the video (fixes #15306)
Also initialize the preview with the current position
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=631ffade676b7971577ecf4b0dcbb3515307cc29
---
modules/gui/qt/dialogs/toolbar.cpp | 9 +++++----
modules/gui/qt/dialogs/toolbar.hpp | 2 +-
modules/gui/qt/main_interface.cpp | 4 ++--
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/modules/gui/qt/dialogs/toolbar.cpp b/modules/gui/qt/dialogs/toolbar.cpp
index 1cc245aa9a..07196cc113 100644
--- a/modules/gui/qt/dialogs/toolbar.cpp
+++ b/modules/gui/qt/dialogs/toolbar.cpp
@@ -96,7 +96,7 @@ ToolbarEditDialog::ToolbarEditDialog( QWidget *_w, intf_thread_t *_p_intf)
positionCheckbox = new QCheckBox( qtr( "Above the Video" ) );
positionCheckbox->setChecked(
- getSettings()->value( "MainWindow/ToolbarPos", 0 ).toInt() );
+ getSettings()->value( "MainWindow/ToolbarPos", false ).toBool() );
mainTboxLayout->addRow( new QLabel( qtr( "Toolbar position:" ) ),
positionCheckbox );
@@ -182,7 +182,8 @@ ToolbarEditDialog::ToolbarEditDialog( QWidget *_w, intf_thread_t *_p_intf)
profileCombo->setCurrentIndex( -1 );
/* Build and prepare our preview */
- PreviewWidget *previewWidget = new PreviewWidget( controller, controller1, controller2 );
+ PreviewWidget *previewWidget = new PreviewWidget( controller, controller1, controller2,
+ positionCheckbox->isChecked() );
QGroupBox *previewBox = new QGroupBox( qtr("Preview"), this );
previewBox->setLayout( new QVBoxLayout() );
previewBox->layout()->addWidget( previewWidget );
@@ -292,7 +293,7 @@ void ToolbarEditDialog::cancel()
}
-PreviewWidget::PreviewWidget( QWidget *a, QWidget *b, QWidget *c )
+PreviewWidget::PreviewWidget( QWidget *a, QWidget *b, QWidget *c, bool barsTopPosition )
: QWidget( a )
{
bars[0] = a;
@@ -300,7 +301,7 @@ PreviewWidget::PreviewWidget( QWidget *a, QWidget *b, QWidget *c )
bars[2] = c;
for ( int i=0; i<3; i++ ) bars[i]->installEventFilter( this );
setAutoFillBackground( true );
- setBarsTopPosition( false );
+ setBarsTopPosition( barsTopPosition );
}
void PreviewWidget::setBarsTopPosition( int b )
diff --git a/modules/gui/qt/dialogs/toolbar.hpp b/modules/gui/qt/dialogs/toolbar.hpp
index c2073d8b91..520d760557 100644
--- a/modules/gui/qt/dialogs/toolbar.hpp
+++ b/modules/gui/qt/dialogs/toolbar.hpp
@@ -53,7 +53,7 @@ class PreviewWidget : public QWidget
Q_OBJECT
public:
- PreviewWidget( QWidget *, QWidget *, QWidget * );
+ PreviewWidget( QWidget *, QWidget *, QWidget *, bool );
public slots:
void setBarsTopPosition( int b );
diff --git a/modules/gui/qt/main_interface.cpp b/modules/gui/qt/main_interface.cpp
index 3ddde38cc7..b8f2363299 100644
--- a/modules/gui/qt/main_interface.cpp
+++ b/modules/gui/qt/main_interface.cpp
@@ -326,7 +326,7 @@ void MainInterface::recreateToolbars()
controls = new ControlsWidget( p_intf, b_adv, this );
inputC = new InputControlsWidget( p_intf, this );
mainLayout->insertWidget( 2, inputC );
- mainLayout->insertWidget( settings->value( "MainWindow/ToolbarPos", 0 ).toInt() ? 0: 3,
+ mainLayout->insertWidget( settings->value( "MainWindow/ToolbarPos", false ).toBool() ? 0: 3,
controls );
if( fullscreenControls )
@@ -494,7 +494,7 @@ void MainInterface::createMainWidget( QSettings *creationSettings )
mainLayout->insertWidget( 2, inputC );
mainLayout->insertWidget(
- creationSettings->value( "MainWindow/ToolbarPos", 0 ).toInt() ? 0: 3,
+ creationSettings->value( "MainWindow/ToolbarPos", false ).toBool() ? 0: 3,
controls );
/* Visualisation, disabled for now, they SUCK */
More information about the vlc-commits
mailing list