Windows: Toolbar tweaks

.. menubar color
.. toolbar smaller since contains menu bar
This commit is contained in:
Mark Liversedge
2013-03-15 18:14:44 +00:00
parent bb53fcc4a9
commit b2baf5b69a
2 changed files with 11 additions and 0 deletions

View File

@@ -20,7 +20,11 @@
GcToolBar::GcToolBar(QWidget *parent) : QWidget(parent)
{
#ifdef WIN32
setFixedHeight(40);
#else
setFixedHeight(50);
#endif
setContentsMargins(0,0,0,0);
layout = new QHBoxLayout(this);
layout->setSpacing(10);
@@ -72,7 +76,9 @@ GcToolBar::paintBackground(QPaintEvent *)
painter.setPen(black);
painter.drawLine(0,height()-1, width()-1, height()-1);
#ifndef WIN32 // not on windows clashes with menu
QPen gray(QColor(230,230,230));
painter.setPen(gray);
painter.drawLine(0,0, width()-1, 0);
#endif
}

View File

@@ -796,6 +796,11 @@ MainWindow::MainWindow(const QDir &home) :
/*----------------------------------------------------------------------
* Application Menus
*--------------------------------------------------------------------*/
#ifdef WIN32
menuBar()->setStyleSheet("QMenuBar { background: rgba(225,225,225); }"
"QMenuBar::item { background: rgba(225,225,225); }");
menuBar()->setContentsMargins(0,0,0,0);
#endif
QMenu *fileMenu = menuBar()->addMenu(tr("&Athlete"));
fileMenu->addAction(tr("&New..."), this, SLOT(newCyclist()), tr("Ctrl+N"));