add tabs component

This commit is contained in:
2026-11-14 10:59:48 +03:00
parent b0145a9911
commit 1f243b63b6
4 changed files with 93 additions and 3 deletions

9
qml/components/Line.qml Normal file
View File

@@ -0,0 +1,9 @@
import QtQuick
import QtQuick.Layouts
Rectangle {
id: root
Layout.fillWidth: true
implicitHeight: 1
color: Theme.color4
}

67
qml/components/Tabs.qml Normal file
View File

@@ -0,0 +1,67 @@
import QtQuick
import QtQuick.Controls
TabBar {
id: root
property int parentWidth: 0
// Общее подчеркивание всех табов
background: Rectangle {
color: Theme.colorTransparent
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
height: 1
color: Theme.color4
}
}
component TabElement: TabButton {
id: tabElement
padding: 10
contentItem: Text {
text: tabElement.text
color: tabElement.checked ? "#cdd6f4" : "#a6adc8"
font.pixelSize: 13
font.bold: tabElement.checked
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
background: Rectangle {
radius: 3
color: Theme.colorTransparent
// Подчёркивание активного таба
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: 0
height: 1
radius: 1
color: "#89b4fa"
visible: tabElement.checked
}
}
}
TabElement {
text: "Обновление"
width: root.parentWidth / 3
}
TabElement {
text: "Установка"
width: root.parentWidth / 3
}
TabElement {
text: "Удаление"
width: root.parentWidth / 3
}
}