diff options
Diffstat (limited to 'src/styles/Desktop/TabViewStyle.qml')
-rw-r--r-- | src/styles/Desktop/TabViewStyle.qml | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/styles/Desktop/TabViewStyle.qml b/src/styles/Desktop/TabViewStyle.qml index b5fc2319..830732bb 100644 --- a/src/styles/Desktop/TabViewStyle.qml +++ b/src/styles/Desktop/TabViewStyle.qml @@ -44,38 +44,36 @@ import QtQuick.Controls.Styles 1.0 Style { id: root - property int leftMargin: 0 - property int rightMargin: 0 - property StyleItem __barstyle: StyleItem { elementType: "tabbar" ; visible: false } - property string tabBarAlignment: __barstyle.styleHint("tabbaralignment"); + property int tabsLeftPadding: 0 + property int tabsRightPadding: 0 + property int tabsAlignment: __barstyle.styleHint("tabbaralignment") === "center" ? Qt.AlignHCenter : Qt.AlignLeft; property int tabOverlap: __barstyle.pixelMetric("taboverlap"); - property int tabBaseOverlap: __barstyle.pixelMetric("tabbaseoverlap"); - property string tabPosition: control.tabPosition == Qt.TopEdge ? "Top" : "Bottom" + property int frameOverlap: __barstyle.pixelMetric("tabbaseoverlap"); + property StyleItem __barstyle: StyleItem { elementType: "tabbar" ; visible: false } property Component frame: StyleItem { id: styleitem anchors.fill: parent anchors.topMargin: 1//stack.baseOverlap z: style == "oxygen" ? 1 : 0 elementType: "tabframe" - hints: tabPosition + hints: control.tabPosition === Qt.TopEdge ? "Top" : "Bottom" value: tabbarItem && tabsVisible && tabbarItem.tab(currentIndex) ? tabbarItem.tab(currentIndex).x : 0 minimum: tabbarItem && tabsVisible && tabbarItem.tab(currentIndex) ? tabbarItem.tab(currentIndex).width : 0 maximum: tabbarItem && tabsVisible ? tabbarItem.width : width Component.onCompleted: { stack.frameWidth = styleitem.pixelMetric("defaultframewidth"); stack.style = style; - stack.baseOverlap = root.tabBaseOverlap; } } 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: nextSelected ? "next" : previousSelected ? "previous" : "" + property string selectedpos: tab.nextSelected ? "next" : tab.previousSelected ? "previous" : "" property int tabHSpace: __barstyle.pixelMetric("tabhspace"); property int tabVSpace: __barstyle.pixelMetric("tabvspace"); - implicitWidth: Math.max(50, styleitem.textWidth(title)) + tabHSpace + 2 + implicitWidth: Math.max(50, styleitem.textWidth(tab.title)) + tabHSpace + 2 implicitHeight: Math.max(styleitem.font.pixelSize + tabVSpace + 6, 0) StyleItem { @@ -93,8 +91,8 @@ Style { hints: [tabPosition, tabpos, selectedpos] selected: tab.selected - text: elidedText(title, tabbarItem.elide, item.width - item.tabHSpace) - hover: tab.hover + text: elidedText(tab.title, tabbarItem.elide, item.width - item.tabHSpace) + hover: tab.hovered hasFocus: tabbarItem.activeFocus && selected } } |