From: Sakari Poussa Date: Sun, 13 Dec 2009 15:30:11 +0000 (+0200) Subject: New colors, Graphs button removed X-Git-Url: http://vcs.maemo.org/git/?p=scorecard;a=commitdiff_plain;h=a89091ceb70e03259098279bf3771ae950a80914 New colors, Graphs button removed --- diff --git a/src/main-window.cpp b/src/main-window.cpp index 5c9a871..525d070 100644 --- a/src/main-window.cpp +++ b/src/main-window.cpp @@ -50,7 +50,7 @@ MainWindow::MainWindow(QMainWindow *parent): QMainWindow(parent) createMenus(); createTableView(scoreList, clubList); - createStatusBar(); + updateTitleBar(); createLayout(centralWidget); } @@ -139,20 +139,6 @@ void MainWindow::createTableView(QList &scoreList, QList &club table->horizontalHeader()->hide(); } -void MainWindow::createStatusBar() -{ -#if 0 - // TODO: use toolbar or buttons. Toolbar seems not to be ready and - // requires more work. - toolbar = addToolBar(tr("foo")); - toolbar->addAction(firstAct); - toolbar->addAction(lastAct); - toolbar->addAction(prevAct); - toolbar->addAction(nextAct); -#endif - updateStatusBar(); -} - void MainWindow::createActions() { newScoreAct = new QAction(tr("New Score"), this); @@ -198,7 +184,7 @@ void MainWindow::createMenus() menu->addAction(statAct); } -void MainWindow::updateStatusBar() +void MainWindow::updateTitleBar() { QString title = scoreTableModel->getInfoText(); if (title.isEmpty()) @@ -210,25 +196,25 @@ void MainWindow::updateStatusBar() void MainWindow::firstButtonClicked() { scoreTableModel->first(); - updateStatusBar(); + updateTitleBar(); } void MainWindow::lastButtonClicked() { scoreTableModel->last(); - updateStatusBar(); + updateTitleBar(); } void MainWindow::nextButtonClicked() { scoreTableModel->next(); - updateStatusBar(); + updateTitleBar(); } void MainWindow::prevButtonClicked() { scoreTableModel->prev(); - updateStatusBar(); + updateTitleBar(); } // FIXME: dup code from table-model.cpp @@ -371,7 +357,7 @@ void MainWindow::newScore() // TODO: does this really work? No mem leaks? scoreTableModel->setScore(scoreList, score); - updateStatusBar(); + updateTitleBar(); } } } @@ -411,7 +397,7 @@ void MainWindow::editScore() // TODO: does this really work? No mem leaks? scoreTableModel->setScore(scoreList, score); - updateStatusBar(); + updateTitleBar(); } } @@ -449,7 +435,7 @@ void MainWindow::viewStatistics() QHBoxLayout *mainLayout = new QHBoxLayout(central); mainLayout->addLayout(infoLayout); - mainLayout->addLayout(buttonLayout); + //mainLayout->addLayout(buttonLayout); central->setLayout(mainLayout); diff --git a/src/main-window.h b/src/main-window.h index 1816ca7..b922038 100644 --- a/src/main-window.h +++ b/src/main-window.h @@ -27,9 +27,8 @@ class MainWindow : public QMainWindow public: MainWindow(QMainWindow *parent = 0); void createLayout(QWidget *parent = 0); - void createStatusBar(); void createTableView(QList &, QList &); - void updateStatusBar(); + void updateTitleBar(); void loadScoreFile(QString &fileName, QList &scoreList); void loadClubFile(QString &fileName, QList &clubList); void saveScoreFile(QString &fileName, QList &scoreList); diff --git a/src/table-model.cpp b/src/table-model.cpp index 1f3721d..5620970 100644 --- a/src/table-model.cpp +++ b/src/table-model.cpp @@ -12,14 +12,21 @@ #include "table-model.h" QString empty(""); - -QColor colorHoleBg(Qt::darkGray); +#define SC_BLUE_THEME +QColor colorHoleBg(26, 26, 26); QColor colorHoleFg(Qt::yellow); -QColor colorBirdie(102, 102, 255); -QColor colorPar(Qt::green); -QColor colorBogey(Qt::darkGreen); -QColor colorDoubleBogey(Qt::red); -QColor colorBad(Qt::red); +QColor colorBirdie(138, 226, 52); +QColor colorPar(Qt::black); +#ifdef SC_ORANGE_THEME +QColor colorBogey(0xfc, 0xaf, 0x3e); +QColor colorDoubleBogey(0xf5, 0x79, 0x00); +QColor colorBad(0xce, 0x5c, 0x00); +#endif +#ifdef SC_BLUE_THEME +QColor colorBogey(0x72, 0x9f, 0xcf); +QColor colorDoubleBogey(0x34, 0x65, 0xa4); +QColor colorBad(0x20, 0x4a, 0x87); +#endif QColor colorSubTotal(Qt::black); QColor colorTotal(Qt::black); @@ -361,7 +368,7 @@ QVariant ScoreTableModel::headerData(int section, Qt::Orientation orientation, i if (orientation == Qt::Horizontal) return QVariant(); -#if 1 +#if 0 if (role == Qt::BackgroundRole) { QColor colorHoleBg(Qt::darkGray); QBrush brush(colorHoleBg);