From d5b522d3465daa3c26f936e8f5a13ae8448a0eae Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig <jens.bache-wiig@digia.com> Date: Fri, 12 Jul 2013 14:21:33 +0200 Subject: [PATCH] ToolBar: Improved aestetics for Fusion style We were drawing an ugly double gray line and had uneven spacing between tool buttons and margins. Change-Id: Ifd2a30cb2ae8f3fb31b5df8410e17cfbd1175978 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> --- src/private/qquickstyleitem.cpp | 5 ++++- src/styles/Desktop/ToolBarStyle.qml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/private/qquickstyleitem.cpp b/src/private/qquickstyleitem.cpp index f9809155f..b8edbd2df 100644 --- a/src/private/qquickstyleitem.cpp +++ b/src/private/qquickstyleitem.cpp @@ -1371,8 +1371,11 @@ void QQuickStyleItem::paint(QPainter *painter) case ToolBar: painter->fillRect(m_styleoption->rect, m_styleoption->palette.window().color()); qApp->style()->drawControl(QStyle::CE_ToolBar, m_styleoption, painter); - painter->setPen(m_styleoption->palette.dark().color().darker(120)); + painter->save(); + painter->setPen(style() != "fusion" ? m_styleoption->palette.dark().color().darker(120) : + m_styleoption->palette.window().color().lighter(107)); painter->drawLine(m_styleoption->rect.bottomLeft(), m_styleoption->rect.bottomRight()); + painter->restore(); break; case StatusBar: #ifdef Q_OS_MAC diff --git a/src/styles/Desktop/ToolBarStyle.qml b/src/styles/Desktop/ToolBarStyle.qml index 56dfbce38..c295f7310 100644 --- a/src/styles/Desktop/ToolBarStyle.qml +++ b/src/styles/Desktop/ToolBarStyle.qml @@ -51,7 +51,7 @@ Style { padding.left: 6 padding.right: 6 padding.top: 1 - padding.bottom: style.style == "mac" ? 1 : 2 + padding.bottom: style.style === "mac" ? 1 : style.style === "fusion" ? 3 : 2 StyleItem { id: style ; visible: false} -- GitLab