Skip to content

Commit

Permalink
QtApp: new fullscreen routines - please test also on Linux and Windows!
Browse files Browse the repository at this point in the history
  • Loading branch information
masc4ii committed Mar 30, 2018
1 parent e3ae056 commit 8e84e75
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 12 deletions.
44 changes: 36 additions & 8 deletions platform/qt/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -749,8 +749,6 @@ void MainWindow::initGui( void )
QPixmap pic = QPixmap::fromImage( m_pAudioWave->getMonoWave( NULL, 0, 100, devicePixelRatio() ) );
pic.setDevicePixelRatio( devicePixelRatio() );
ui->labelAudioTrack->setPixmap( pic );
//Fullscreen does not work well, so disable
ui->actionFullscreen->setVisible( false );
//Disable caching by default to avoid crashes
//ui->actionCaching->setVisible( false );
//Disable unused (for now) actions
Expand Down Expand Up @@ -3976,7 +3974,7 @@ void MainWindow::on_dockWidgetEdit_visibilityChanged(bool visible)
}

//Set visibility of audio track
void MainWindow::on_actionShowAudioTrack_triggered(bool checked)
void MainWindow::on_actionShowAudioTrack_toggled(bool checked)
{
ui->labelAudioTrack->setVisible( checked );
qApp->processEvents();
Expand Down Expand Up @@ -4077,13 +4075,16 @@ void MainWindow::pictureCustomContextMenuRequested(const QPoint &pos)
myMenu.addMenu( ui->menuDemosaicForPreview );
myMenu.addSeparator();
myMenu.addAction( ui->actionShowZebras );
if( ui->graphicsView->isFullScreen() )
if( ui->actionFullscreen->isChecked() )
{
myMenu.addSeparator();
myMenu.addAction( ui->actionGoto_First_Frame );
myMenu.addAction( ui->actionPreviousFrame );
myMenu.addAction( ui->actionPlay );
myMenu.addAction( ui->actionNextFrame );
myMenu.addAction( ui->actionLoop );
myMenu.addSeparator();
myMenu.addAction( ui->actionFullscreen );
}
// Show context menu at handling position
myMenu.exec( globalPos );
Expand Down Expand Up @@ -4242,15 +4243,42 @@ void MainWindow::on_label_FilterStrengthVal_doubleClicked()
//Fullscreen Mode
void MainWindow::on_actionFullscreen_triggered( bool checked )
{
static bool editWasActive;
static bool sessionWasActive;
static bool audioWasActive;

if( checked )
{
ui->graphicsView->setWindowFlags( Qt::Dialog );
ui->graphicsView->showFullScreen();
ui->statusBar->hide();
ui->mainToolBar->hide();
ui->menuBar->hide();
ui->horizontalSliderPosition->hide();
ui->gridLayoutMain->setContentsMargins( 0, 0, 0, 0 );
editWasActive = ui->actionShowEditArea->isChecked();
sessionWasActive = ui->actionShowSessionArea->isChecked();
audioWasActive = ui->actionShowAudioTrack->isChecked();
ui->actionShowEditArea->setChecked( false );
ui->actionShowSessionArea->setChecked( false );
ui->actionShowAudioTrack->setChecked( false );
ui->actionShowEditArea->setEnabled( false );
ui->actionShowSessionArea->setEnabled( false );
ui->actionShowAudioTrack->setEnabled( false );
this->showFullScreen();
}
else
{
ui->graphicsView->setWindowFlags( Qt::Widget );
ui->graphicsView->showNormal();
this->showNormal();
ui->statusBar->show();
ui->mainToolBar->show();
ui->menuBar->show();
ui->horizontalSliderPosition->show();
ui->gridLayoutMain->setContentsMargins( 0, 5, 0, 5 );
if( !ui->actionShowEditArea->isChecked() && editWasActive ) ui->actionShowEditArea->setChecked( true );
if( !ui->actionShowSessionArea->isChecked() && sessionWasActive ) ui->actionShowSessionArea->setChecked( true );
if( !ui->actionShowAudioTrack->isChecked() && audioWasActive ) ui->actionShowAudioTrack->setChecked( true );
ui->actionShowEditArea->setEnabled( true );
ui->actionShowSessionArea->setEnabled( true );
ui->actionShowAudioTrack->setEnabled( true );
}
qApp->processEvents();
m_frameChanged = true;
Expand Down
2 changes: 1 addition & 1 deletion platform/qt/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private slots:
void on_listWidgetSession_activated(const QModelIndex &index);
void on_dockWidgetSession_visibilityChanged(bool visible);
void on_dockWidgetEdit_visibilityChanged(bool visible);
void on_actionShowAudioTrack_triggered(bool checked);
void on_actionShowAudioTrack_toggled(bool checked);
void on_listWidgetSession_customContextMenuRequested(const QPoint &pos);
void deleteFileFromSession( void );
void rightClickShowFile( void );
Expand Down
6 changes: 3 additions & 3 deletions platform/qt/MainWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<bool>true</bool>
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QGridLayout" name="gridLayout_24">
<layout class="QGridLayout" name="gridLayoutMain">
<property name="leftMargin">
<number>0</number>
</property>
Expand Down Expand Up @@ -5772,7 +5772,7 @@ QGroupBox::indicator:checked {
<connections>
<connection>
<sender>actionShowSessionArea</sender>
<signal>triggered(bool)</signal>
<signal>toggled(bool)</signal>
<receiver>dockWidgetSession</receiver>
<slot>setVisible(bool)</slot>
<hints>
Expand All @@ -5788,7 +5788,7 @@ QGroupBox::indicator:checked {
</connection>
<connection>
<sender>actionShowEditArea</sender>
<signal>triggered(bool)</signal>
<signal>toggled(bool)</signal>
<receiver>dockWidgetEdit</receiver>
<slot>setVisible(bool)</slot>
<hints>
Expand Down

1 comment on commit 8e84e75

@masc4ii
Copy link
Collaborator Author

@masc4ii masc4ii commented on 8e84e75 Apr 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On macOS, fullscreen works, keypress works. Small bug: when leaving fullscreen via green OSX button, window becomes small, but MLVApp is still in fullscreen-mode. -> always use CMD+F.

On Windows, fullscreen itself is working. But MLVApp recognises no keypresses -> not usable at all. 😢 App must be controlled via right click context menu.

Please sign in to comment.