diff --git a/src/AllPlot.cpp b/src/AllPlot.cpp index fc85350a1..ecb0f40de 100644 --- a/src/AllPlot.cpp +++ b/src/AllPlot.cpp @@ -224,7 +224,7 @@ AllPlot::AllPlot(AllPlotWindow *parent, MainWindow *mainWindow): bg = new AllPlotBackground(this); bg->attach(this); - insertLegend(new QwtLegend(), QwtPlot::BottomLegend); + //insertLegend(new QwtLegend(), QwtPlot::BottomLegend); setCanvasBackground(GColor(CRIDEPLOTBACKGROUND)); canvas()->setFrameStyle(QFrame::NoFrame); @@ -249,7 +249,7 @@ AllPlot::AllPlot(AllPlotWindow *parent, MainWindow *mainWindow): intervalHighlighterCurve->setYAxis(yLeft); intervalHighlighterCurve->setData(IntervalPlotData(this, mainWindow)); intervalHighlighterCurve->attach(this); - this->legend()->remove(intervalHighlighterCurve); // don't show in legend + //this->legend()->remove(intervalHighlighterCurve); // don't show in legend // setup that grid @@ -309,7 +309,7 @@ AllPlot::configChanged() QColor ihlbrush = QColor(GColor(CINTERVALHIGHLIGHTER)); ihlbrush.setAlpha(64); intervalHighlighterCurve->setBrush(ihlbrush); // fill below the line - this->legend()->remove(intervalHighlighterCurve); // don't show in legend + //this->legend()->remove(intervalHighlighterCurve); // don't show in legend QPen gridPen(GColor(CPLOTGRID)); gridPen.setStyle(Qt::DotLine); grid->setPen(gridPen); @@ -664,7 +664,7 @@ AllPlot::setDataFromPlot(AllPlot *plot, int startidx, int stopidx) double *xaxis = bydist ? smoothD : smoothT; // attach appropriate curves - if (this->legend()) this->legend()->hide(); + //if (this->legend()) this->legend()->hide(); wattsCurve->detach(); hrCurve->detach(); @@ -706,7 +706,7 @@ AllPlot::setDataFromPlot(AllPlot *plot, int startidx, int stopidx) refreshIntervalMarkers(); refreshZoneLabels(); - if (this->legend()) this->legend()->show(); + //if (this->legend()) this->legend()->show(); //replot(); } diff --git a/src/AllPlotWindow.cpp b/src/AllPlotWindow.cpp index eeca31f29..bd53f7707 100644 --- a/src/AllPlotWindow.cpp +++ b/src/AllPlotWindow.cpp @@ -284,7 +284,7 @@ AllPlotWindow::AllPlotWindow(MainWindow *mainWindow) : fullPlot->enableAxis(QwtPlot::yRight, false); fullPlot->enableAxis(QwtPlot::yRight2, false); fullPlot->enableAxis(QwtPlot::xBottom, false); - fullPlot->legend()->clear(); + //fullPlot->legend()->clear(); //fullPlot->setTitle(""); fullPlot->setContentsMargins(0,0,0,0); @@ -425,7 +425,7 @@ AllPlotWindow::redrawFullPlot() fullPlot->enableAxis(QwtPlot::yRight, false); fullPlot->enableAxis(QwtPlot::yRight2, false); fullPlot->enableAxis(QwtPlot::xBottom, false); - fullPlot->legend()->clear(); + //fullPlot->legend()->clear(); //fullPlot->setTitle(""); if (fullPlot->bydist) @@ -1310,12 +1310,12 @@ AllPlotWindow::setupStackPlots() if (i==0){ // First plot view title and legend //_allPlot->setTitle(allPlot->title()); - _allPlot->plotLayout()->setLegendPosition(QwtPlot::TopLegend); + //_allPlot->plotLayout()->setLegendPosition(QwtPlot::TopLegend); _allPlot->setFixedHeight(120+stackWidth*2+50); } else { _allPlot->setTitle(""); - _allPlot->insertLegend(NULL); + //_allPlot->insertLegend(NULL); _allPlot->setFixedHeight(120+stackWidth*2); } diff --git a/src/GoldenCheetah.cpp b/src/GoldenCheetah.cpp index f482435f3..f8378823c 100644 --- a/src/GoldenCheetah.cpp +++ b/src/GoldenCheetah.cpp @@ -122,11 +122,13 @@ GcWindow::GcWindow() setResizable(false); setMouseTracking(true); +#ifdef Q_OS_LINUX // only reliably works on Linux right now QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this); shadow->setBlurRadius(20); shadow->setXOffset(10); shadow->setYOffset(10); setGraphicsEffect(shadow); +#endif } GcWindow::GcWindow(QWidget *parent) : QFrame(parent), dragState(None) { @@ -141,11 +143,13 @@ GcWindow::GcWindow(QWidget *parent) : QFrame(parent), dragState(None) { setResizable(false); setMouseTracking(true); +#ifdef Q_OS_LINUX // only reliably works on Linux right now QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this); shadow->setBlurRadius(20); shadow->setXOffset(10); shadow->setYOffset(10); setGraphicsEffect(shadow); +#endif } GcWindow::~GcWindow() @@ -173,18 +177,14 @@ GcWindow::paintEvent(QPaintEvent * /*event*/) static QPixmap carbon = QPixmap(":images/carbon.jpg"); static QPalette defaultPalette; + // setup a painter and the area to paint + QPainter painter(this); + + // background light gray for now? + QRect all(0,0,width(),height()); + painter.fillRect(all, Qt::white); + if (contentsMargins().top() > 0) { - // draw a rectangle in the contents margins - // at the top of the widget - - // setup a painter and the area to paint - QPainter painter(this); - - // 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, Qt::white); // fill in the title bar QRect bar(0,0,width(),contentsMargins().top()); @@ -197,7 +197,6 @@ GcWindow::paintEvent(QPaintEvent * /*event*/) painter.drawPixmap(bar, aluBarDark); } - // heading QFont font; font.setPointSize((contentsMargins().top()/2)+2); diff --git a/src/GoogleMapControl.cpp b/src/GoogleMapControl.cpp index 9409c4d48..cdc61c42a 100644 --- a/src/GoogleMapControl.cpp +++ b/src/GoogleMapControl.cpp @@ -151,6 +151,7 @@ GoogleMapControl::GoogleMapControl(MainWindow *mw) : GcWindow(mw), main(mw), ran parent = mw; view = new QWebView(); view->setContentsMargins(0,0,0,0); + view->page()->view()->setContentsMargins(0,0,0,0); view->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); layout = new QVBoxLayout(); diff --git a/src/HomeWindow.cpp b/src/HomeWindow.cpp index a3884386f..174dae353 100644 --- a/src/HomeWindow.cpp +++ b/src/HomeWindow.cpp @@ -20,6 +20,10 @@ #include "HomeWindow.h" #include "LTMSettings.h" +#ifdef Q_OS_LINUX +#include +#endif + HomeWindow::HomeWindow(MainWindow *mainWindow, QString name, QString /* windowtitle */) : GcWindow(mainWindow), mainWindow(mainWindow), name(name), active(false), clicked(NULL), dropPending(false), chartCursor(-2), loaded(false) @@ -35,8 +39,8 @@ HomeWindow::HomeWindow(MainWindow *mainWindow, QString name, QString /* windowti bigandbold.setPointSize(bigandbold.pointSize() + 2); bigandbold.setWeight(QFont::Bold); -#if 0 QHBoxLayout *titleBar = new QHBoxLayout; +#if 0 title = new QLabel(windowtitle, this); title->setFont(bigandbold); title->setStyleSheet("QLabel {" @@ -50,6 +54,7 @@ HomeWindow::HomeWindow(MainWindow *mainWindow, QString name, QString /* windowti mypalette.setColor(title->foregroundRole(), Qt::white); title->setPalette(mypalette); titleBar->addWidget(title); +#endif titleBar->addStretch(); #ifdef Q_OS_MAC @@ -67,15 +72,14 @@ HomeWindow::HomeWindow(MainWindow *mainWindow, QString name, QString /* windowti small.setPointSize(8); styleSelector->setFont(small); styleSelector->setFixedHeight(20); -#endif titleBar->addWidget(styleSelector); - layout->addLayout(titleBar); #endif style = new QStackedWidget(this); layout->setSpacing(0); layout->setContentsMargins(0,0,0,0); + layout->addLayout(titleBar); layout->addWidget(style); QPalette palette; @@ -83,11 +87,41 @@ HomeWindow::HomeWindow(MainWindow *mainWindow, QString name, QString /* windowti palette.setBrush(backgroundRole(), QColor("#A8A8A8")); // each style has its own container widget + QWidget *tabArea = new QWidget(this); + tabArea->setContentsMargins(20,0,20,20); + tabArea->setAutoFillBackground(false); + //tabArea->setFrameStyle(QFrame::NoFrame); + QVBoxLayout *tabLayout = new QVBoxLayout(tabArea); + tabLayout->setContentsMargins(0,0,0,0); + tabLayout->setSpacing(0); tabbed = new QTabWidget(this); tabbed->setContentsMargins(0,0,0,0); - tabbed->setTabsClosable(true); + tabbed->setTabsClosable(false); tabbed->setPalette(palette); - style->addWidget(tabbed); + tabbed->setDocumentMode(true); + + // styling commented out whilst work out the differences + // between mac and linux and windows +#if 0 + tabbed->setStyleSheet("QTabBar::tab {" + "background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1," + "stop: 0 #CFCFCF, stop: 1.0 #A8A8A8);" + "border: 1px solid rgba(255, 255, 255, 32);" + "color: #535353;}" + "QTabBar::tab:selected {" + "min-height: 30px;" + "background: rgba(255,255,255,255); }"); +#endif + + tabLayout->addWidget(tabbed); +#ifdef Q_OS_LINUX // only reliably works on Linux right now + QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this); + shadow->setBlurRadius(20); + shadow->setXOffset(10); + shadow->setYOffset(10); + tabbed->setGraphicsEffect(shadow); +#endif + style->addWidget(tabArea); // tiled tileWidget = new QWidget(this); @@ -123,12 +157,10 @@ HomeWindow::HomeWindow(MainWindow *mainWindow, QString name, QString /* windowti winWidget->setMouseTracking(true); // to draw cursor currentStyle=2; -#if 0 #ifdef Q_OS_MAC styleSelector->setSelected(2); #else styleSelector->setCurrentIndex(2); -#endif #endif style->setCurrentIndex(2); // tile area @@ -136,12 +168,10 @@ HomeWindow::HomeWindow(MainWindow *mainWindow, QString name, QString /* windowti connect(mainWindow, SIGNAL(configChanged()), this, SLOT(configChanged())); connect(tabbed, SIGNAL(currentChanged(int)), this, SLOT(tabSelected(int))); connect(tabbed, SIGNAL(tabCloseRequested(int)), this, SLOT(removeChart(int))); -#if 0 #ifdef Q_OS_MAC connect(styleSelector, SIGNAL(clicked(int,bool)), SLOT(styleChanged(int))); #else connect(styleSelector, SIGNAL(currentIndexChanged(int)), SLOT(styleChanged(int))); -#endif #endif // watch drop operations diff --git a/src/RideNavigator.cpp b/src/RideNavigator.cpp index dd9482a1d..53fd5a827 100644 --- a/src/RideNavigator.cpp +++ b/src/RideNavigator.cpp @@ -743,6 +743,7 @@ void NavigatorCellDelegate::paint(QPainter *painter, const QStyleOptionViewItem //painter->drawLine(rideNavigator->pwidth,myOption.rect.y(),rideNavigator->pwidth, myOption.rect.y()+myOption.rect.height()-1); painter->drawLine(rideNavigator->pwidth,myOption.rect.y(),rideNavigator->pwidth, myOption.rect.y()+myOption.rect.height()); myOption.rect.setHeight(18); //added + myOption.font.setWeight(QFont::Bold); drawDisplay(painter, myOption, myOption.rect, value); if (calendarText != "") { @@ -751,6 +752,7 @@ void NavigatorCellDelegate::paint(QPainter *painter, const QStyleOptionViewItem myOption.rect.setWidth(rideNavigator->pwidth); myOption.rect.setHeight(36); myOption.font.setPointSize(myOption.font.pointSize()-2); + myOption.font.setWeight(QFont::Normal); //myOption.font.setStyle(QFont::StyleItalic); painter->fillRect(myOption.rect, background); //drawFocus(painter, myOption, myOption.rect);