aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/TabButton.qml
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-09-29 21:01:45 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-09-30 08:31:35 +0000
commitab779f64f2e01ed7aafc3358ac2f0bf42f349516 (patch)
tree4dcd31222baa585682de3db31898fc00aa408e00 /src/imports/controls/TabButton.qml
parentc74dde76c5e27396e70ab1b8498f2c74f68134c0 (diff)
TabButton: use Text's implicit size instead of content size
Using content size was a workaround (applied in 5f5654f) that helped with mis-aligned tab labels, but broke the implicit size calculation of TabButton itself. Now that the mis-alignment issue in QQuickText has been fixed in qtdeclarative commit 79cfc87, we can restore the correct implicit size calculation. This makes it possible to create tabs that are not squeezed to fit in TabBar: TabBar { TabButton { text: "Foo"; width: implicitWidth } TabButton { text: "Bar"; width: implicitWidth } TabButton { text: "Baz"; width: implicitWidth } } Task-number: QTBUG-55129 Change-Id: If0dbb00794299e324b7a8d8ce1370fe0a3491fe8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/imports/controls/TabButton.qml')
-rw-r--r--src/imports/controls/TabButton.qml4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/imports/controls/TabButton.qml b/src/imports/controls/TabButton.qml
index 870edb6d..56b57602 100644
--- a/src/imports/controls/TabButton.qml
+++ b/src/imports/controls/TabButton.qml
@@ -41,9 +41,9 @@ T.TabButton {
id: control
implicitWidth: Math.max(background ? background.implicitWidth : 0,
- contentItem.contentWidth + leftPadding + rightPadding)
+ contentItem.implicitWidth + leftPadding + rightPadding)
implicitHeight: Math.max(background ? background.implicitHeight : 0,
- contentItem.contentHeight + topPadding + bottomPadding)
+ contentItem.implicitHeight + topPadding + bottomPadding)
baselineOffset: contentItem.y + contentItem.baselineOffset
padding: 6