From 051dabae5e425750ae5f564ae26192549ef506aa Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 3 Jun 2014 15:57:14 +0200 Subject: [PATCH] warnings-- BUG:335522 --- src/declarativeimports/plasmacomponents/qml/TabBar.qml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/declarativeimports/plasmacomponents/qml/TabBar.qml b/src/declarativeimports/plasmacomponents/qml/TabBar.qml index df31b97c9..8604871f5 100644 --- a/src/declarativeimports/plasmacomponents/qml/TabBar.qml +++ b/src/declarativeimports/plasmacomponents/qml/TabBar.qml @@ -98,8 +98,8 @@ FocusScope { id: buttonFrame visible: currentTab && currentTab !== null - x: layout.isHorizontal ? tabBarLayout.x + currentTab.x : 0 - y: layout.isHorizontal ? 0 : tabBarLayout.y + currentTab.y + x: currentTab && layout.isHorizontal ? tabBarLayout.x + currentTab.x : 0 + y: !currentTab || layout.isHorizontal ? 0 : tabBarLayout.y + currentTab.y width: currentTab && layout.isHorizontal ? currentTab.width + margins.left + margins.right -1 : parent.width height: !currentTab || layout.isHorizontal ? parent.height : currentTab.height + margins.top + margins.bottom imagePath: "widgets/tabbar" @@ -172,6 +172,9 @@ FocusScope { } onCurrentTabChanged: { + if (!currentTab) { + return; + } if (layout.isHorizontal) { tabBarLayout.x = Math.max(Math.min(0, -(currentTab.x + currentTab.width/2) + tabbarScroller.width/2), -tabBarLayout.width + tabbarScroller.width); } else {