X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fmainwindow.cpp;h=3ad7ea120e944a59f682648068906c31d6aa94b9;hb=e1ad9ba325c1e8e23b7d484d967fc04626883524;hp=f9d470ea701dddc946c3029da408a8bd505cb554;hpb=75a31c072d4db3f29e6df6f224beebe0f7dfd617;p=someplayer diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index f9d470e..3ad7ea1 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -43,6 +43,7 @@ MainWindow::MainWindow(QWidget *parent) : 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(); } @@ -122,6 +123,7 @@ void MainWindow::_toggle_search_line() { void MainWindow::showSearchPanel() { ui->searchButton->show(); + ui->searchLine->setFocus(); } void MainWindow::hideSearchPanel() { @@ -136,23 +138,41 @@ 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(); } }