diff options
Diffstat (limited to 'src/styles/Desktop/TabViewStyle.qml')
-rw-r--r-- | src/styles/Desktop/TabViewStyle.qml | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/styles/Desktop/TabViewStyle.qml b/src/styles/Desktop/TabViewStyle.qml index 455b99db..51b70ea4 100644 --- a/src/styles/Desktop/TabViewStyle.qml +++ b/src/styles/Desktop/TabViewStyle.qml @@ -51,7 +51,7 @@ Style { property StyleItem __barstyle: StyleItem { elementType: "tab" - hints: [control.tabPosition === Qt.TopEdge ? "Top" : "Bottom"] + properties: { "tabposition" : (control.tabPosition === Qt.TopEdge ? "Top" : "Bottom") } visible: false } @@ -65,6 +65,7 @@ Style { minimum: tabbarItem && tabsVisible && tabbarItem.tab(currentIndex) ? tabbarItem.tab(currentIndex).width : 0 maximum: tabbarItem && tabsVisible ? tabbarItem.width : width properties: { "selectedTabRect" : tabbarItem.__selectedTabRect, "orientation" : control.tabPosition } + hints: control.styleHints Component.onCompleted: { stack.frameWidth = styleitem.pixelMetric("defaultframewidth"); stack.style = style; @@ -74,13 +75,13 @@ Style { property Component tab: Item { id: item property string tabpos: control.count === 1 ? "only" : index === 0 ? "beginning" : index === control.count - 1 ? "end" : "middle" - property string selectedpos: tab.nextSelected ? "next" : tab.previousSelected ? "previous" : "" + property string selectedpos: styleData.nextSelected ? "next" : styleData.previousSelected ? "previous" : "" property string orientation: control.tabPosition === Qt.TopEdge ? "Top" : "Bottom" property int tabHSpace: __barstyle.pixelMetric("tabhspace"); property int tabVSpace: __barstyle.pixelMetric("tabvspace"); property int totalOverlap: tabOverlap * (control.count - 1) property real maxTabWidth: (control.width + totalOverlap) / control.count - implicitWidth: Math.min(maxTabWidth, Math.max(50, styleitem.textWidth(tab.title)) + tabHSpace + 2) + implicitWidth: Math.min(maxTabWidth, Math.max(50, styleitem.textWidth(styleData.title)) + tabHSpace + 2) implicitHeight: Math.max(styleitem.font.pixelSize + tabVSpace + 6, 0) StyleItem { @@ -94,12 +95,12 @@ Style { anchors.rightMargin: -paintMargins anchors.bottomMargin: -1 anchors.leftMargin: -paintMargins + (style === "mac" && selected ? -1 : 0) - properties: { "hasFrame" : true } - hints: [orientation, tabpos, selectedpos] + properties: { "hasFrame" : true, "orientation": orientation, "tabpos": tabpos, "selectedpos": selectedpos } + hints: control.styleHints - selected: tab.selected - text: elidedText(tab.title, tabbarItem.elide, item.width - item.tabHSpace) - hover: tab.hovered + selected: styleData.selected + text: elidedText(styleData.title, tabbarItem.elide, item.width - item.tabHSpace) + hover: styleData.hovered hasFocus: tabbarItem.activeFocus && selected } } |