diff --git a/src/private/TabBar.qml b/src/private/TabBar.qml index 1efaaf8508ccb63588fa9c5ffbd2f088faf575a1..49b10584d661619728d55246cae20d7d69149792 100644 --- a/src/private/TabBar.qml +++ b/src/private/TabBar.qml @@ -79,6 +79,8 @@ FocusScope { property real availableWidth: tabbar.width - leftCorner.width - rightCorner.width + property var __selectedTabRect + function tab(index) { for (var i = 0; i < tabrow.children.length; ++i) { if (tabrow.children[i].tabindex == index) { @@ -154,6 +156,13 @@ FocusScope { hoverEnabled: true focus: true + Binding { + target: tabbar + when: selected + property: "__selectedTabRect" + value: Qt.rect(x, y, width, height) + } + drag.target: tabsMovable ? tabloader : null drag.axis: Drag.XAxis drag.minimumX: drag.active ? 0 : -Number.MAX_VALUE diff --git a/src/private/qquickstyleitem.cpp b/src/private/qquickstyleitem.cpp index 7da0ebdf51875bbc9ac3d21a3170e98de49d196a..f5e32bba4d20394fe5c8e3b3c1b67f0a2112d12a 100644 --- a/src/private/qquickstyleitem.cpp +++ b/src/private/qquickstyleitem.cpp @@ -368,7 +368,9 @@ void QQuickStyleItem::initStyleOption() if (!m_styleoption) m_styleoption = new QStyleOptionTabWidgetFrame(); QStyleOptionTabWidgetFrame *opt = qstyleoption_cast<QStyleOptionTabWidgetFrame*>(m_styleoption); - opt->shape = hints().contains("South") ? QTabBar::RoundedSouth : QTabBar::RoundedNorth; + + opt->selectedTabRect = m_properties["selectedTabRect"].toRect(); + opt->shape = m_properties["orientation"] == Qt::BottomEdge ? QTabBar::RoundedSouth : QTabBar::RoundedNorth; if (minimum()) opt->selectedTabRect = QRect(value(), 0, minimum(), height()); opt->tabBarSize = QSize(minimum() , height()); diff --git a/src/styles/Desktop/TabViewStyle.qml b/src/styles/Desktop/TabViewStyle.qml index 9cd34705cd0f398adaca483c982d255e13367152..455b99dbe653d76b3a385d990e2632d5021577a3 100644 --- a/src/styles/Desktop/TabViewStyle.qml +++ b/src/styles/Desktop/TabViewStyle.qml @@ -61,10 +61,10 @@ Style { anchors.topMargin: 1//stack.baseOverlap z: style == "oxygen" ? 1 : 0 elementType: "tabframe" - hints: control.tabPosition === Qt.TopEdge ? "Top" : "Bottom" value: tabbarItem && tabsVisible && tabbarItem.tab(currentIndex) ? tabbarItem.tab(currentIndex).x : 0 minimum: tabbarItem && tabsVisible && tabbarItem.tab(currentIndex) ? tabbarItem.tab(currentIndex).width : 0 maximum: tabbarItem && tabsVisible ? tabbarItem.width : width + properties: { "selectedTabRect" : tabbarItem.__selectedTabRect, "orientation" : control.tabPosition } Component.onCompleted: { stack.frameWidth = styleitem.pixelMetric("defaultframewidth"); stack.style = style;