lux-shell/components/StyledTabButton.qml
Benjamin Palko 93b3a09a0a remove id
2025-09-11 23:41:14 -04:00

45 lines
1.3 KiB
QML

import qs.config
import QtQuick
import QtQuick.Controls.Basic
TabButton {
id: control
contentItem: Text {
font.pixelSize: Styling.typography.textSize.base
font.family: Styling.typography.fontFamily
text: control.text
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
padding: 6
color: control.hovered ? Styling.theme.primarycontent : control.checked ? Styling.theme.accent : Styling.theme.basecontent
Behavior on color {
ColorAnimation {
duration: Styling.animations.speed.normal
}
}
rotation: control.rotation
Behavior on rotation {
RotationAnimation {
duration: Styling.animations.speed.slow
easing.type: Easing.OutQuad
}
}
}
background: Rectangle {
id: rectangle
color: control.hovered ? Styling.theme.primary : Styling.theme.base200
Behavior on color {
ColorAnimation {
duration: Styling.animations.speed.normal
}
}
border.width: 2
border.color: control.checked ? Styling.theme.accent : "transparent"
}
HoverHandler {
cursorShape: Qt.PointingHandCursor
}
}