styled button

This commit is contained in:
Benjamin Palko 2025-07-26 21:16:51 -04:00
parent 8911381cb2
commit ee3c84cf04

32
widgets/StyledButton.qml Normal file
View file

@ -0,0 +1,32 @@
import qs.config
import QtQuick
import Quickshell.Widgets
WrapperMouseArea {
id: root
required property Component content
property alias padding: rectangle.margin
property alias color: rectangle.color
property alias border: rectangle.border
property alias radius: rectangle.radius
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
WrapperRectangle {
id: rectangle
margin: 8
radius: 8
color: root.containsMouse && root.hoverEnabled ? Theme.palette.primary : Theme.palette.base100
Behavior on color {
ColorAnimation {
duration: 200
easing.type: Easing.InOutQuad
}
}
Loader {
active: true
sourceComponent: content
}
}
}