Permalink
Browse files

QT5.2.1 Unified Title ToolBar Update

.. if you build with qt 5.2.1 then the unified title and toolbar
   is back, but its a hack to just change the gradient and use a
   standard toolbar .. so we do that, but make the colours match.
  • Loading branch information...
liversedge committed Feb 12, 2014
1 parent 4d02a2c commit 79e5e8df18c7eb9b7c4510d3e19ef7b6a2d21912
Showing with 19 additions and 0 deletions.
  1. +10 −0 src/GcSideBarItem.cpp
  2. +9 −0 src/MainWindow.cpp
View
@@ -268,16 +268,26 @@ GcSplitterHandle::init(QString title, Qt::Orientation orientation,
int shade, inshade;
if (metal) {
#ifdef Q_OS_MAC
#if QT_VERSION >= 0x50201
shade = 0xD9;
inshade = 232;
#else
shade = 178;
inshade = 225;
#endif
#else
shade = 200;
inshade = 250;
#endif
} else {
#ifdef Q_OS_MAC
#if QT_VERSION >= 0x50201
shade = 0xD9;
inshade = 232;
#else
inshade = 225;
shade = 210;
#endif
#else
inshade = 250;
shade = 225;
View
@@ -232,15 +232,24 @@ MainWindow::MainWindow(const QDir &home)
*--------------------------------------------------------------------*/
#ifdef Q_OS_MAC
#if QT_VERSION > 0x50000
#if QT_VERSION >= 0x50201
setUnifiedTitleAndToolBarOnMac(true);
#endif
head = addToolBar(context->athlete->cyclist);
head->setContentsMargins(20,0,20,0);
head->setFloatable(false);
head->setMovable(false);
// make the normal toolbar in QT5 have same colors as the tabs and when inactive
// make it the same 'light' colour as the other widgets do.
#if QT_VERSION < 0x50201
head->setStyleSheet(" QToolBar:active { border: 0px; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #C6C6C6, stop: 1 #A5A5A5 ); } "
" QToolBar:!active { border: 0px; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #D9D9D9, stop: 1 #D6D6D6 ); } ");
#else
head->setStyleSheet(" QToolBar:!active { border: 0px; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #F0F0F0, stop: 1 #E8E8E8 ); } "
" QToolBar:active { border: 0px; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #D9D9D9, stop: 1 #D6D6D6 ); } ");
#endif
// widgets
QWidget *macAnalButtons = new QWidget(this);
macAnalButtons->setContentsMargins(20,5,20,0);

0 comments on commit 79e5e8d

Please sign in to comment.