X-Git-Url: http://git.maemo.org/git/?p=groove;a=blobdiff_plain;f=bottombar.cpp;h=8ca6d64a17d9451cdb755aa5ff9eb9c791930ab8;hp=8a12aa0b98001fee5a0dca16996cdff295458369;hb=fcfc7fb7a17e44c725a484f8d8e043afd8e808bd;hpb=4adbefb36e52cb33564e704d8ea6a49425db8caf diff --git a/bottombar.cpp b/bottombar.cpp index 8a12aa0..8ca6d64 100644 --- a/bottombar.cpp +++ b/bottombar.cpp @@ -1,29 +1,38 @@ #include "bottombar.h" #include "ui_bottombar.h" + bottomBar::bottomBar(QWidget *parent) : QWidget(parent), ui(new Ui::bottomBar) { ui->setupUi(this); - QRect screenGeometry = QApplication::desktop()->screenGeometry(); - main = new QGraphicsScene(0,0,screenGeometry.width(),15); + main = new QGraphicsScene(0,0,this->width(),15); ui->graphicsView->setScene(main); - ui->graphicsView->setSceneRect(0,0,screenGeometry.width(),15); - ui->graphicsView->setTransformationAnchor(QGraphicsView::NoAnchor); + ui->graphicsView->setSceneRect(0,0,this->width(),15); + //ui->graphicsView->setTransformationAnchor(QGraphicsView::NoAnchor); main->setBackgroundBrush(this->palette().window()); - main->setSceneRect(0,0,screenGeometry.width(),15); - this->playbackProgress = main->addRect(0,0,screenGeometry.width()/2,15,QPen(Qt::white),QBrush(Qt::white)); + main->setSceneRect(0,0,this->width(),15); + this->playbackProgress = main->addRect(0,0,this->width()/2,15,QPen(Qt::white),QBrush(Qt::white)); +#ifndef Q_WS_MAEMO_5 + ui->stopButton->setIcon(QIcon::fromTheme("media-playback-stop")); + ui->pauseB->setIcon(QIcon::fromTheme("media-playback-pause")); + ui->nextB->setIcon(QIcon::fromTheme("media-skip-forward")); + ui->backB->setIcon(QIcon::fromTheme("media-skip-backward")); + ui->settingsB->setIcon(QIcon::fromTheme("document-properties")); + +#endif } bottomBar::~bottomBar() { delete ui; } -void bottomBar::setPlaybackProgress(int min, int max) +void bottomBar::setPlaybackProgress(qint64 min,qint64 max) { - this->playbackProgress->setRect(0,0,(min/max)*main->width(),15); - ui->graphicsView->update(); + + this->playbackProgress->setRect(0,0,((float)min/(float)max)*this->width(),15); + //ui->graphicsView->update(); } void bottomBar::on_nextB_clicked()