diff --git a/src/private/qstyleitem.cpp b/src/private/qstyleitem.cpp index 831e8e9656ebecd4006f43270055cc2c161c9d40..8a21e50f18e83034533a9b6209d775af83780e43 100644 --- a/src/private/qstyleitem.cpp +++ b/src/private/qstyleitem.cpp @@ -303,7 +303,7 @@ void QStyleItem::initStyleOption() opt->selectedPosition = QStyleOptionTab::NextIsSelected; else if (selectedPosition == QLatin1String("previous")) opt->selectedPosition = QStyleOptionTab::PreviousIsSelected; - else + else opt->selectedPosition = QStyleOptionTab::NotAdjacent; } @@ -1100,7 +1100,14 @@ void QStyleItem::paint(QPainter *painter) qApp->style()->drawComplexControl(QStyle::CC_ToolButton, qstyleoption_cast<QStyleOptionComplex*>(m_styleoption), painter); break; case Tab: - qApp->style()->drawControl(QStyle::CE_TabBarTab, m_styleoption, painter); + if (style() == "mac") { + m_styleoption->rect.translate(0, 1); // Unhack QMacStyle's hack + qApp->style()->drawControl(QStyle::CE_TabBarTabShape, m_styleoption, painter); + m_styleoption->rect.translate(0, -1); + qApp->style()->drawControl(QStyle::CE_TabBarTabLabel, m_styleoption, painter); + } else { + qApp->style()->drawControl(QStyle::CE_TabBarTab, m_styleoption, painter); + } break; case Frame: qApp->style()->drawControl(QStyle::CE_ShapedFrame, m_styleoption, painter); diff --git a/src/styles/Desktop/TabViewStyle.qml b/src/styles/Desktop/TabViewStyle.qml index f659b706d87f3debab37fae24dbb2e36b16e82e4..e9249b02b5d326c65fa91bef87b4785a2e359f3d 100644 --- a/src/styles/Desktop/TabViewStyle.qml +++ b/src/styles/Desktop/TabViewStyle.qml @@ -83,12 +83,13 @@ Style { id: styleitem elementType: "tab" - paintMargins: 2 + paintMargins: style === "mac" ? 0 : 2 anchors.fill: parent - anchors.rightMargin: -paintMargins + (style == "mac" ? -1 : 0) + anchors.topMargin: style === "mac" ? 2 : 0 + anchors.rightMargin: -paintMargins anchors.bottomMargin: -1 - anchors.leftMargin: -paintMargins + anchors.leftMargin: -paintMargins + (style === "mac" && selected ? -1 : 0) properties: { "hasFrame" : true } hints: [tabPosition, tabpos, selectedpos] @@ -96,12 +97,6 @@ Style { text: elidedText(title, tabbarItem.elide, width - item.tabHSpace) hover: tab.hover hasFocus: tabbarItem.activeFocus && selected - - Text { - id: textitem - visible: false - text: styleitem.text - } } } }