// common action properties
foreach (QAction *action, actions->values()) {
+
+ // add actions to the MainWindow so that they work
+ // when the menu is hidden
+ addAction(action);
+
// never autorepeat.
// unexperienced users tend to keep keys pressed for a "long" time
action->setAutoRepeat(false);
void MainWindow::fullscreen() {
if (m_fullscreen) {
- mediaView->exitFullscreen();
fullscreenAct->setShortcut(QKeySequence(Qt::ALT + Qt::Key_Return));
fullscreenAct->setText(tr("&Full Screen"));
stopAct->setShortcut(QKeySequence(Qt::Key_Escape));
+ if (m_maximized) showMaximized();
+ else showNormal();
} else {
- mediaView->fullscreen();
stopAct->setShortcut(QString(""));
QList<QKeySequence> shortcuts;
- // for some reason it is importante that ESC comes first
+ // for some reason it is important that ESC comes first
shortcuts << QKeySequence(Qt::Key_Escape) << QKeySequence(Qt::ALT + Qt::Key_Return);
fullscreenAct->setShortcuts(shortcuts);
fullscreenAct->setText(tr("Exit &Full Screen"));
+ m_maximized = isMaximized();
+ showFullScreen();
}
compactViewAct->setVisible(m_fullscreen);
-
+ mediaView->setPlaylistVisible(m_fullscreen);
+ mainToolBar->setVisible(m_fullscreen);
+ statusBar()->setVisible(m_fullscreen);
+ menuBar()->setVisible(m_fullscreen);
+ menuBar()->setEnabled(true);
m_fullscreen = !m_fullscreen;
}
}
}
-void MediaView::fullscreen() {
- splitterState = splitter->saveState();
- videoAreaWidget->setParent(0);
- videoAreaWidget->showFullScreen();
-}
-
-void MediaView::exitFullscreen() {
- // videoAreaWidget->setParent(this);
- splitter->addWidget(videoAreaWidget);
- // Just calling show() on the Mac won't work
- videoAreaWidget->showNormal();
- splitter->restoreState(splitterState);
-}
-
void MediaView::stop() {
listModel->abortSearch();
mediaObject->stop();
void pause();
void stop();
void skip();
- void fullscreen();
- void exitFullscreen();
void openWebPage();
void removeSelected();
void moveUpSelected();
void moveDownSelected();
- void setPlaylistVisible(bool visible=true);
+ void setPlaylistVisible(bool visible=true);
private slots:
// list/model
SearchParams *searchParams;
QSplitter *splitter;
- QByteArray splitterState;
PlaylistWidget *playlistWidget;
QListView *listView;