Commit 73e64612 authored by Thomas BOUTROUE's avatar Thomas BOUTROUE

Allow hiding disabled tabs from TabBar

parent 91c86152
Pipeline #991 passed with stage
in 7 seconds
......@@ -67,6 +67,7 @@ FocusScope {
TextLabel {
text: parent.text;
emphasis: parent.active;
}
}
anchors.verticalCenter: (parent ? parent.verticalCenter : undefined);
......
......@@ -15,17 +15,6 @@ Item {
default property alias content : container.children;
readonly property var tabs : {
var ret = [];
for (var idx = 0; idx < content.length; idx++) {
var item = content [idx];
if (Introspector.isGroupItem (item)) {
ret.push (item);
}
}
return ret;
}
Rectangle {
id: rect;
color: Style.colorSecondary;
......@@ -36,23 +25,31 @@ Item {
anchors.bottom: bar.bottom;
ExtraAnchors.horizontalFill: parent;
}
GridContainer {
RowContainer {
id: bar;
clip: true;
cols: capacity;
capacity: tabs.length;
colSpacing: Style.spacingSmall;
spacing: Style.spacingSmall;
anchors {
topMargin: bar.colSpacing;
leftMargin: (bar.colSpacing + extraPaddingBeforeTabs);
rightMargin: (bar.colSpacing + extraPaddingAfterTabs);
topMargin: bar.spacing;
leftMargin: (bar.spacing + extraPaddingBeforeTabs);
rightMargin: (bar.spacing + extraPaddingAfterTabs);
}
ExtraAnchors.topDock: parent;
Repeater {
model: tabs;
model: {
var ret = [];
for (var idx = 0; idx < base.content.length; idx++) {
var item = base.content [idx];
if (Introspector.isGroupItem (item)) {
ret.push (item);
}
}
return ret;
}
delegate: MouseArea {
id: clicker;
visible: (clicker.group && clicker.group.enabled);
implicitHeight: tabsSize;
states: [
State {
......@@ -127,7 +124,10 @@ Item {
}
}
]
onClicked: { currentTab = modelData; }
Container.horizontalStretch: 1;
onClicked: {
currentTab = modelData;
}
readonly property Group group : modelData;
......
Markdown is supported
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