From cb3f752fa7e461c6fd236a5f7758fdbbc879a471 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Wed, 1 Jun 2011 21:46:31 +0100 Subject: [PATCH] Simplify and Clean UI Less jarring UI with simple use of color and no pixmaps to make a clean look. Will need more work to get consistent across the code base. A simple and clean UI is starting to emerge. --- src/AllPlotWindow.cpp | 3 ++- src/GoldenCheetah.cpp | 10 ++++++---- src/HomeWindow.cpp | 3 ++- src/MainWindow.cpp | 25 ++++++++++++++++--------- src/RideNavigator.cpp | 8 ++++++++ src/RideSummaryWindow.cpp | 1 + src/application.qrc | 1 + src/images/aluToolBar.png | Bin 0 -> 3561 bytes 8 files changed, 36 insertions(+), 15 deletions(-) create mode 100644 src/images/aluToolBar.png diff --git a/src/AllPlotWindow.cpp b/src/AllPlotWindow.cpp index bd5deeb5d..eeca31f29 100644 --- a/src/AllPlotWindow.cpp +++ b/src/AllPlotWindow.cpp @@ -276,7 +276,8 @@ AllPlotWindow::AllPlotWindow(MainWindow *mainWindow) : fullPlot->setInstanceName("fullPlot"); fullPlot->grid->enableY(false); QPalette def; - fullPlot->setCanvasBackground(def.color(QPalette::Window)); + //fullPlot->setCanvasBackground(def.color(QPalette::Window)); + fullPlot->setCanvasBackground(Qt::white); fullPlot->setCanvasLineWidth(0); fullPlot->enableAxis(QwtPlot::yLeft, false); fullPlot->enableAxis(QwtPlot::yLeft2, false); diff --git a/src/GoldenCheetah.cpp b/src/GoldenCheetah.cpp index 7043a14a8..dd7cdf380 100644 --- a/src/GoldenCheetah.cpp +++ b/src/GoldenCheetah.cpp @@ -170,17 +170,18 @@ GcWindow::paintEvent(QPaintEvent * /*event*/) // background light gray for now? QRect all(0,0,width(),height()); //painter.drawTiledPixmap(all, aluLight); - painter.fillRect(all, defaultPalette.color(QPalette::Window)); + //painter.fillRect(all, defaultPalette.color(QPalette::Window)); + painter.fillRect(all, Qt::white); // fill in the title bar QRect bar(0,0,width(),contentsMargins().top()); QColor bg; if (property("active").toBool() == true) { bg = GColor(CTILEBARSELECT); - painter.drawPixmap(bar, aluBarDark); + painter.drawPixmap(bar, aluBar); } else { bg = GColor(CTILEBAR); - painter.drawPixmap(bar, aluBar); + painter.drawPixmap(bar, aluBarDark); } @@ -210,7 +211,8 @@ GcWindow::paintEvent(QPaintEvent * /*event*/) QPainter painter(this); QRect all(0,0,width(),height()); if (property("isManager").toBool() == true) { - painter.drawTiledPixmap(all, carbon); + //painter.drawTiledPixmap(all, carbon); + painter.fillRect(all, QColor("#A8A8A8")); } else { //painter.drawTiledPixmap(all, aluLight); } diff --git a/src/HomeWindow.cpp b/src/HomeWindow.cpp index 0c403761f..f1e34ec89 100644 --- a/src/HomeWindow.cpp +++ b/src/HomeWindow.cpp @@ -79,7 +79,8 @@ HomeWindow::HomeWindow(MainWindow *mainWindow, QString name, QString windowtitle layout->addWidget(style); QPalette palette; - palette.setBrush(backgroundRole(), QBrush(QImage(":/images/carbon.jpg"))); + //palette.setBrush(backgroundRole(), QBrush(QImage(":/images/carbon.jpg"))); + palette.setBrush(backgroundRole(), QColor("#A8A8A8")); // each style has its own container widget tabbed = new QTabWidget(this); diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index a94b28fca..4cf089947 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -121,8 +121,8 @@ MainWindow::MainWindow(const QDir &home) : pal.setColor(QPalette::Button, GColor(CTOOLBAR)); pal.setColor(QPalette::WindowText, Qt::white); //XXX should be black/white for CTOOLBAR statusBar()->setPalette(pal); -#endif statusBar()->showMessage(tr("Ready")); +#endif /*---------------------------------------------------------------------- * Athlete details @@ -184,6 +184,7 @@ MainWindow::MainWindow(const QDir &home) : #ifndef Q_OS_MAC toolbar->setContentsMargins(0,0,0,0); toolbar->setAutoFillBackground(true); + toolbar->setStyleSheet("background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #CFCFCF, stop: 1.0 #A8A8A8);"); #if 0 toolbar->setPalette(pal); #endif @@ -320,10 +321,6 @@ MainWindow::MainWindow(const QDir &home) : } splitter = new QSplitter; - splitter->setHandleWidth(2); - splitter->setFrameStyle(QFrame::NoFrame); - splitter->setStyleSheet("QSplitter::handle { color: black; }"); - splitter->setContentsMargins(0, 0, 0, 0); // attempting to follow some UI guides // CHARTS chartTool = new GcWindowTool(this); @@ -331,10 +328,15 @@ MainWindow::MainWindow(const QDir &home) : // TOOLBOX toolBox = new QToolBox(this); toolBox->setStyleSheet("QToolBox::tab {" - "background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1," - "stop: 0 #FFFFFF, stop: 0.5 #DDDDDD," - "stop: 0.6 #D8D8D8, stop: 1.0 #CCCCCC);" +#if 0 + "background-image: url(:images/aluToolBar.png);" + "background-position: top right;" + "background-origin: content;" + "background-repeat: repeat-x;" +#endif "max-height: 18px; " + "background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1," + "stop: 0 #CFCFCF, stop: 1.0 #A8A8A8);" "color: #535353;" "font-weight: bold; }"); @@ -442,8 +444,11 @@ MainWindow::MainWindow(const QDir &home) : sizes.append(390); splitter->setSizes(sizes); } - splitter->setHandleWidth(2); // gets munged by restore state from older versions splitter->setChildrenCollapsible(false); // QT BUG crash QTextLayout do not undo this + splitter->setHandleWidth(1); + splitter->setFrameStyle(QFrame::NoFrame); + splitter->setStyleSheet("QSplitter { border: 0px; background-color: #A8A8A8; }"); + splitter->setContentsMargins(0, 0, 0, 0); // attempting to follow some UI guides setCentralWidget(splitter); /*---------------------------------------------------------------------- @@ -579,9 +584,11 @@ MainWindow::rideTreeWidgetSelectionChanged() ride = (RideItem*) which; } +#if 0 // update the status bar if (!ride) statusBar()->showMessage(tr("No ride selected")); else statusBar()->showMessage(ride->dateTime.toString("ddd MMM d, yyyy h:mm AP")); // same format as ride list +#endif // update the ride property on all widgets // to let them know they need to replot new diff --git a/src/RideNavigator.cpp b/src/RideNavigator.cpp index 80c42c540..eaee26b1c 100644 --- a/src/RideNavigator.cpp +++ b/src/RideNavigator.cpp @@ -69,6 +69,14 @@ RideNavigator::RideNavigator(MainWindow *parent) : main(parent), active(false), //tableView->setFont(smaller); tableView->installEventFilter(this); tableView->setFrameStyle(QFrame::NoFrame); + +#if 0 + tableView->header()->setStyleSheet( "::section { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1," + "stop: 0 #CFCFCF, stop: 1.0 #A8A8A8);" + "border: 2px; border-color: #A8A8A8; " + "color: #535353;" + "font-weight: bold; }"); +#endif tableView->show(); // this maps friendly names to metric names diff --git a/src/RideSummaryWindow.cpp b/src/RideSummaryWindow.cpp index 2025ebfe2..d3934a7c0 100644 --- a/src/RideSummaryWindow.cpp +++ b/src/RideSummaryWindow.cpp @@ -44,6 +44,7 @@ RideSummaryWindow::RideSummaryWindow(MainWindow *mainWindow) : vlayout->setContentsMargins(10,10,10,10); rideSummary = new QTextEdit(this); rideSummary->setReadOnly(true); + rideSummary->setFrameStyle(QFrame::NoFrame); vlayout->addWidget(rideSummary); QFont font; diff --git a/src/application.qrc b/src/application.qrc index 81275592e..8104bb6a6 100644 --- a/src/application.qrc +++ b/src/application.qrc @@ -10,6 +10,7 @@ images/toolbar/main/measures.png images/toolbar/main/train.png images/aluBar.png + images/aluToolBar.png images/aluBarDark.png images/aluLight.jpg images/carbon.jpg diff --git a/src/images/aluToolBar.png b/src/images/aluToolBar.png new file mode 100644 index 0000000000000000000000000000000000000000..a7c35e438de0968a7ae59db6f6a92811bcc3d470 GIT binary patch literal 3561 zcmX|^cQhOP_s3(@tWAyDd+!mXG-{7fs;V`LR*Xgwt*!PJrKr6UiV~_QYE#r`Xpoi= zqr|8^YxU=Qp6B_!KIgOUJ?DMTJ?H*$Z-NEHfR2WX1^@ui85!zY0sv$;uil(gq*v!u zK8ote6wW3Fx`4m`TgC0~-dtIzy$x;Q001q^|27FAH=pCmNa<%} zrbjtLLBb?T(GagmxRQ4_(goiOnBKHEd5LePFVnJyKw^L1KGGfzsz?0llMS5%%;MYt zi?B3eciYT@j7dmn_^2O(S}o)V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