New HTabbedBoxes component, base AddChat on it

This commit is contained in:
miruka
2019-12-07 08:56:32 -04:00
parent 883d1c095b
commit 28b3727e88
2 changed files with 49 additions and 43 deletions

View File

@@ -0,0 +1,42 @@
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
HColumnLayout {
implicitWidth: Math.min(
parent.width,
Math.max(tabBar.contentWidth, swipeView.contentWidth),
)
Layout.alignment: Qt.AlignCenter
Layout.fillWidth: false
Layout.fillHeight: false
property alias tabIndex: tabBar.currentIndex
property alias tabModel: tabRepeater.model
default property alias boxes: swipeView.contentData
HTabBar {
id: tabBar
Component.onCompleted: shortcuts.tabsTarget = this
Layout.fillWidth: true
Repeater {
id: tabRepeater
HTabButton { text: modelData }
}
}
SwipeView {
id: swipeView
clip: true
currentIndex: tabBar.currentIndex
interactive: false
Layout.fillWidth: true
Behavior on implicitWidth { HNumberAnimation {} }
Behavior on implicitHeight { HNumberAnimation {} }
}
}