connect(ui->searchLine, SIGNAL(textChanged(QString)), this, SLOT(_search(QString)));
connect(ui->nextButton, SIGNAL(clicked()), this, SLOT(_nextItem()));
connect(ui->prevButton, SIGNAL(clicked()), this, SLOT(_prevItem()));
+ connect(ui->fscreenButton, SIGNAL(clicked()), this, SLOT(_toggle_full_screen()));
hideSearchPanel();
library();
}
void MainWindow::showSearchPanel() {
ui->searchButton->show();
+ ui->searchLine->setFocus();
}
void MainWindow::hideSearchPanel() {
void MainWindow::_search(QString pattern) {
if (ui->stackedWidget->currentIndex() == 0) { // player
_player_form->search(pattern);
+ } else if (ui->stackedWidget->currentIndex() == 1) { // library
+ _library_form->search(pattern);
}
}
void MainWindow::_nextItem() {
if (ui->stackedWidget->currentIndex() == 0) { // player
_player_form->nextItem();
+ } else if (ui->stackedWidget->currentIndex() == 1) { // library
+ _library_form->nextItem();
}
}
void MainWindow::_prevItem() {
if (ui->stackedWidget->currentIndex() == 0) { // player
_player_form->prevItem();
+ } else if (ui->stackedWidget->currentIndex() == 1) { // library
+ _library_form->prevItem();
}
}
void MainWindow::_cancelSearch() {
if (ui->stackedWidget->currentIndex() == 0) { // player
_player_form->cancelSearch();
+ } else if (ui->stackedWidget->currentIndex() == 1) { // library
+ _library_form->cancelSearch();
+ }
+}
+
+void MainWindow::_toggle_full_screen() {
+ if (isFullScreen()) {
+ ui->fscreenButton->setIcon(QIcon(":/icons/fullscreen.png"));
+ showNormal();
+ } else {
+ ui->fscreenButton->setIcon(QIcon(":/icons/window.png"));
+ showFullScreen();
}
}