lux-shell/components/StyledTabButton.qml
2025-09-11 17:01:08 -04:00

46 lines
1.3 KiB
QML

import qs.config
import QtQuick
import QtQuick.Controls.Basic
TabButton {
id: control
contentItem: Text {
id: icon
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 : 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
}
}