actions->insert("fullscreen", fullscreenAct);
connect(fullscreenAct, SIGNAL(triggered()), this, SLOT(fullscreen()));
+ compactViewAct = new QAction(tr("&Compact View"), this);
+ compactViewAct->setStatusTip(tr("Go compact view"));
+ compactViewAct->setShortcut(QKeySequence(Qt::ALT + Qt::Key_M));
+ compactViewAct->setCheckable(true);
+ compactViewAct->setChecked(false);
+ compactViewAct->setEnabled(false);
+ actions->insert("compactView", compactViewAct);
+ connect(compactViewAct, SIGNAL(toggled(bool)), this, SLOT(compactView(bool)));
+
/*
// icon should be document-save but it is ugly
downloadAct = new QAction(QtIconLoader::icon("go-down", QIcon(":/images/go-down.png")), tr("&Download"), this);
viewMenu->addAction(webPageAct);
viewMenu->addSeparator();
viewMenu->addAction(fullscreenAct);
+ viewMenu->addAction(compactViewAct);
helpMenu = menuBar()->addMenu(tr("&Help"));
helpMenu->addAction(siteAct);
// settingsAct->setEnabled(widget != settingsView);
stopAct->setEnabled(widget == mediaView);
fullscreenAct->setEnabled(widget == mediaView);
+ compactViewAct->setEnabled(widget == mediaView);
webPageAct->setEnabled(widget == mediaView);
aboutAct->setEnabled(widget != aboutView);
m_fullscreen = !m_fullscreen;
}
+void MainWindow::compactView(bool enable) {
+ mediaView->setPlaylistVisible(!enable);
+ mainToolBar->setVisible(!enable);
+}
+
void MainWindow::searchFocus() {
QWidget *view = views->currentWidget();
if (view == mediaView) {
splitter->addWidget(videoAreaWidget);
- QList<int> sizes;
- sizes << 320 << 640;
- splitter->setSizes(sizes);
-
layout->addWidget(splitter);
setLayout(layout);
}
void MediaView::exitFullscreen() {
videoAreaWidget->setParent(this);
splitter->addWidget(videoAreaWidget);
- videoAreaWidget->showNormal();
+ videoAreaWidget->show();
splitter->restoreState(splitterState);
}
searchParams->setSortBy(SearchParams::SortByViewCount);
search(searchParams);
}
+
+void MediaView::setPlaylistVisible(bool visible) {
+ playlistWidget->setVisible(visible);
+}
+