styled button
This commit is contained in:
parent
8911381cb2
commit
ee3c84cf04
1 changed files with 32 additions and 0 deletions
32
widgets/StyledButton.qml
Normal file
32
widgets/StyledButton.qml
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue