Kylin/Fluent/qml/IconButton.qml

31 lines
766 B
QML
Raw Normal View History

2024-08-21 23:26:43 +08:00
import QtQuick
import QtQuick.Controls
Button {
property int iconSize: 20
property int iconSource
property int radius:4
property color color: {
if(!enabled){
return disableColor
}
if(pressed){
return pressedColor
}
return hovered ? hoverColor : normalColor
}
property color iconColor: {
if (FluTheme.dark) {
if (!enabled) {
return Qt.rgba(130 / 255, 130 / 255, 130 / 255, 1)
}
return Qt.rgba(1, 1, 1, 1)
} else {
if (!enabled) {
return Qt.rgba(161 / 255, 161 / 255, 161 / 255, 1)
}
return Qt.rgba(0, 0, 0, 1)
}
}
}