FluentUI/src/controls/FluMenuItem.qml
2023-03-06 14:22:13 +08:00

41 lines
895 B
QML

import QtQuick 2.15
import QtQuick.Controls 2.15
Item {
id:root
width: 140
height: 32
property string text: "MenuItem"
signal clicked
Rectangle{
anchors.centerIn: parent
width: 100
height: 32
radius: 4
color:{
if(mouse_area.containsMouse){
return FluTheme.isDark ? Qt.rgba(56/255,56/255,56/255,1) : Qt.rgba(230/255,230/255,230/255,1)
}
return FluTheme.isDark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(237/255,237/255,237/255,1)
}
FluText{
text: root.text
anchors.centerIn: parent
}
MouseArea{
id:mouse_area
hoverEnabled: true
anchors.fill: parent
onClicked: {
root.clicked()
root.parent.closePopup()
}
}
}
}