Commit 099e0294 authored by J-P Nurmi's avatar J-P Nurmi Committed by The Qt Project
Browse files

TabViewStyle: expose styleData.availableWidth


Change-Id: Ib209ec7311c64f172718c8baa7d7f63f6f79a3a8
Reviewed-by: default avatarJens Bache-Wiig <jens.bache-wiig@digia.com>
parent 8beda080
Branches
Tags
No related merge requests found
Showing with 2 additions and 2 deletions
...@@ -192,7 +192,6 @@ FocusScope { ...@@ -192,7 +192,6 @@ FocusScope {
property Item control: tabView property Item control: tabView
property int index: tabindex property int index: tabindex
property real availableWidth: tabbar.availableWidth
property QtObject styleData: QtObject { property QtObject styleData: QtObject {
readonly property alias index: tabitem.tabindex readonly property alias index: tabitem.tabindex
...@@ -202,6 +201,7 @@ FocusScope { ...@@ -202,6 +201,7 @@ FocusScope {
readonly property alias previsousSelected: tabitem.previousSelected readonly property alias previsousSelected: tabitem.previousSelected
readonly property alias hovered: tabitem.containsMouse readonly property alias hovered: tabitem.containsMouse
readonly property bool activeFocus: tabbar.activeFocus readonly property bool activeFocus: tabbar.activeFocus
readonly property real availableWidth: tabbar.availableWidth
} }
sourceComponent: loader.item ? loader.item.tab : null sourceComponent: loader.item ? loader.item.tab : null
......
...@@ -136,7 +136,7 @@ Style { ...@@ -136,7 +136,7 @@ Style {
scale: control.tabPosition === Qt.TopEdge ? 1 : -1 scale: control.tabPosition === Qt.TopEdge ? 1 : -1
property int totalOverlap: tabOverlap * (control.count - 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)) implicitWidth: Math.round(Math.min(maxTabWidth, textitem.implicitWidth + 20))
implicitHeight: Math.round(textitem.implicitHeight + 10) implicitHeight: Math.round(textitem.implicitHeight + 10)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment