From 94d3de4b81f47d072d6afd3745465ff2c2de702f Mon Sep 17 00:00:00 2001 From: Andreas Date: Mon, 13 May 2013 17:40:00 +0200 Subject: [PATCH] - Spacebar works now in the seekbar - Show utf-8 times character instead of x in the album cover exporter. --- src/ui/albumcoverexport.ui | 4 ++-- src/ui/mainwindow.cpp | 15 +++++++++++++++ src/ui/mainwindow.h | 1 + 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/ui/albumcoverexport.ui b/src/ui/albumcoverexport.ui index 4f59b5e75..4d424e502 100644 --- a/src/ui/albumcoverexport.ui +++ b/src/ui/albumcoverexport.ui @@ -6,7 +6,7 @@ 0 0 - 391 + 608 412 @@ -143,7 +143,7 @@ - x + × diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index 54091437c..538c9fa4d 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -2324,3 +2324,18 @@ void MainWindow::ShowConsole() { Console* console = new Console(app_, this); console->show(); } + +void MainWindow::keyPressEvent(QKeyEvent* event) { + if(event->key() == Qt::Key_Space) { + app_->player()->PlayPause(); + event->accept(); + } else if(event->key() == Qt::Key_Left) { + ui_->track_slider->Seek(-1); + event->accept(); + } else if(event->key() == Qt::Key_Right) { + ui_->track_slider->Seek(1); + event->accept(); + } else { + QMainWindow::keyPressEvent(event); + } +} diff --git a/src/ui/mainwindow.h b/src/ui/mainwindow.h index 4afcded5f..832502306 100644 --- a/src/ui/mainwindow.h +++ b/src/ui/mainwindow.h @@ -121,6 +121,7 @@ class MainWindow : public QMainWindow, public PlatformInterface { void CommandlineOptionsReceived(const CommandlineOptions& options); protected: + void keyPressEvent(QKeyEvent* event); void resizeEvent(QResizeEvent* event); void closeEvent(QCloseEvent* event);