2020-06-17 15:31:01 -04:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
2021-09-28 18:04:06 +03:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-14 14:44:32 +02:00
|
|
|
import "../"
|
2021-10-14 15:09:35 +02:00
|
|
|
import "../panels"
|
2020-05-28 10:32:58 -04:00
|
|
|
|
2022-03-21 11:33:14 -04:00
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
|
2020-05-28 10:32:58 -04:00
|
|
|
TabButton {
|
|
|
|
property string btnText: "Default Button"
|
2022-03-24 21:55:22 +01:00
|
|
|
property int addToWidth: 0
|
|
|
|
|
2022-03-21 11:33:14 -04:00
|
|
|
property alias badge: statusBadge
|
2020-11-27 11:13:35 -04:00
|
|
|
|
2020-05-28 10:32:58 -04:00
|
|
|
id: tabButton
|
2022-03-21 11:33:14 -04:00
|
|
|
width: tabBtnText.width +
|
2022-03-24 21:55:22 +01:00
|
|
|
(statusBadge.visible ? statusBadge.width + statusBadge.anchors.leftMargin : 0) +
|
|
|
|
addToWidth
|
|
|
|
|
2020-05-28 10:32:58 -04:00
|
|
|
height: tabBtnText.height + 11
|
|
|
|
text: ""
|
|
|
|
padding: 0
|
|
|
|
background: Rectangle {
|
2020-07-02 11:14:31 -04:00
|
|
|
color: Style.current.transparent
|
2020-10-15 14:44:22 -04:00
|
|
|
border.width: 0
|
2020-05-28 10:32:58 -04:00
|
|
|
}
|
|
|
|
|
2020-06-19 14:06:58 -04:00
|
|
|
StyledText {
|
2020-05-28 10:32:58 -04:00
|
|
|
id: tabBtnText
|
2022-03-24 21:55:22 +01:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2020-05-28 10:32:58 -04:00
|
|
|
text: btnText
|
|
|
|
font.weight: Font.Medium
|
|
|
|
font.pixelSize: 15
|
2021-02-25 18:35:25 +04:00
|
|
|
color: parent.checked || parent.hovered ? Style.current.textColor : Style.current.secondaryText
|
2020-05-28 10:32:58 -04:00
|
|
|
}
|
|
|
|
|
2022-03-21 11:33:14 -04:00
|
|
|
StatusBadge {
|
|
|
|
id: statusBadge
|
|
|
|
visible: value > 0
|
|
|
|
anchors.left: tabBtnText.right
|
|
|
|
anchors.leftMargin: 10
|
|
|
|
anchors.verticalCenter: tabBtnText.verticalCenter
|
|
|
|
}
|
|
|
|
|
2020-05-28 10:32:58 -04:00
|
|
|
Rectangle {
|
2021-01-12 12:40:48 +01:00
|
|
|
visible: parent.checked || parent.hovered
|
2021-03-16 15:19:48 -04:00
|
|
|
color: parent.checked ? Style.current.primary : Style.current.secondaryBackground
|
2020-05-28 10:32:58 -04:00
|
|
|
anchors.bottom: parent.bottom
|
2021-01-12 12:40:48 +01:00
|
|
|
width: 40
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2020-05-28 10:32:58 -04:00
|
|
|
height: 3
|
|
|
|
radius: 4
|
|
|
|
}
|
2021-01-12 12:40:48 +01:00
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
anchors.fill: parent
|
|
|
|
onPressed: mouse.accepted = false
|
|
|
|
}
|
2020-05-28 10:32:58 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
|
|
|
D{i:0;formeditorColor:"#ffffff";formeditorZoom:1.75}
|
|
|
|
}
|
|
|
|
##^##*/
|