diff --git a/src/private/TabBar.qml b/src/private/TabBar.qml index 7f4db779127b38729179aee6d7b6fab352dde039..6bcf795cc96ad39b21d378069efeec8ecf9b8f9a 100644 --- a/src/private/TabBar.qml +++ b/src/private/TabBar.qml @@ -192,7 +192,6 @@ FocusScope { property Item control: tabView property int index: tabindex - property real availableWidth: tabbar.availableWidth property QtObject styleData: QtObject { readonly property alias index: tabitem.tabindex @@ -202,6 +201,7 @@ FocusScope { readonly property alias previsousSelected: tabitem.previousSelected readonly property alias hovered: tabitem.containsMouse readonly property bool activeFocus: tabbar.activeFocus + readonly property real availableWidth: tabbar.availableWidth } sourceComponent: loader.item ? loader.item.tab : null diff --git a/src/styles/Base/TabViewStyle.qml b/src/styles/Base/TabViewStyle.qml index a668f43b08f804ef7af9726ec4b8ef4d3ee01446..04e34d4c92fa8b9dfd3a211e95bb745afaf8416e 100644 --- a/src/styles/Base/TabViewStyle.qml +++ b/src/styles/Base/TabViewStyle.qml @@ -136,7 +136,7 @@ Style { scale: control.tabPosition === Qt.TopEdge ? 1 : -1 property int totalOverlap: tabOverlap * (control.count - 1) - property real maxTabWidth: (availableWidth + totalOverlap) / control.count + property real maxTabWidth: (styleData.availableWidth + totalOverlap) / control.count implicitWidth: Math.round(Math.min(maxTabWidth, textitem.implicitWidth + 20)) implicitHeight: Math.round(textitem.implicitHeight + 10)