X-Git-Url: http://git.maemo.org/git/?p=groove;a=blobdiff_plain;f=bottombar.cpp;h=8a12aa0b98001fee5a0dca16996cdff295458369;hp=09faf6ceb6312d6a3c446c630487af76fb1134ae;hb=4adbefb36e52cb33564e704d8ea6a49425db8caf;hpb=a20498e05a0b00c41521182cf972294d9ae1269f diff --git a/bottombar.cpp b/bottombar.cpp index 09faf6c..8a12aa0 100644 --- a/bottombar.cpp +++ b/bottombar.cpp @@ -7,23 +7,42 @@ bottomBar::bottomBar(QWidget *parent) : { ui->setupUi(this); QRect screenGeometry = QApplication::desktop()->screenGeometry(); - QGraphicsScene *main = new QGraphicsScene(0,0,screenGeometry.width(),15); + main = new QGraphicsScene(0,0,screenGeometry.width(),15); ui->graphicsView->setScene(main); ui->graphicsView->setSceneRect(0,0,screenGeometry.width(),15); ui->graphicsView->setTransformationAnchor(QGraphicsView::NoAnchor); main->setBackgroundBrush(this->palette().window()); main->setSceneRect(0,0,screenGeometry.width(),15); - main->addRect(0,0,screenGeometry.width()/2,15,QPen(Qt::white),QBrush(Qt::white)); + this->playbackProgress = main->addRect(0,0,screenGeometry.width()/2,15,QPen(Qt::white),QBrush(Qt::white)); } bottomBar::~bottomBar() { delete ui; } +void bottomBar::setPlaybackProgress(int min, int max) +{ + this->playbackProgress->setRect(0,0,(min/max)*main->width(),15); + ui->graphicsView->update(); +} + +void bottomBar::on_nextB_clicked() +{ + emit this->nextB(); +} +void bottomBar::on_pauseB_clicked() +{ + emit this->pause(); +} + void bottomBar::on_addButton_clicked() { emit this->addB(); } +void bottomBar::on_backB_clicked() +{ + emit this->back(); +} void bottomBar::changeEvent(QEvent *e) {