2023-03-02 18:21:43 +08:00
|
|
|
|
import QtQuick 2.15
|
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
|
|
2023-03-02 23:58:50 +08:00
|
|
|
|
Item {
|
2023-03-02 18:21:43 +08:00
|
|
|
|
|
2023-03-02 23:58:50 +08:00
|
|
|
|
id:root
|
2023-03-16 14:34:20 +08:00
|
|
|
|
width: {
|
|
|
|
|
if(root.parent){
|
|
|
|
|
return root.parent.width
|
|
|
|
|
}
|
|
|
|
|
return 140
|
|
|
|
|
}
|
2023-03-02 23:58:50 +08:00
|
|
|
|
height: 32
|
2023-03-02 18:21:43 +08:00
|
|
|
|
|
2023-03-02 23:58:50 +08:00
|
|
|
|
property string text: "MenuItem"
|
|
|
|
|
signal clicked
|
2023-03-02 18:21:43 +08:00
|
|
|
|
|
2023-03-02 23:58:50 +08:00
|
|
|
|
Rectangle{
|
|
|
|
|
anchors.centerIn: parent
|
2023-03-16 14:34:20 +08:00
|
|
|
|
width: root.width-40
|
2023-03-02 23:58:50 +08:00
|
|
|
|
height: 32
|
|
|
|
|
radius: 4
|
|
|
|
|
color:{
|
|
|
|
|
if(mouse_area.containsMouse){
|
2023-03-06 14:22:13 +08:00
|
|
|
|
return FluTheme.isDark ? Qt.rgba(56/255,56/255,56/255,1) : Qt.rgba(230/255,230/255,230/255,1)
|
2023-03-02 23:58:50 +08:00
|
|
|
|
}
|
2023-03-06 14:22:13 +08:00
|
|
|
|
return FluTheme.isDark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(237/255,237/255,237/255,1)
|
2023-03-02 23:58:50 +08:00
|
|
|
|
}
|
2023-03-02 18:21:43 +08:00
|
|
|
|
|
2023-03-02 23:58:50 +08:00
|
|
|
|
FluText{
|
|
|
|
|
text: root.text
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MouseArea{
|
|
|
|
|
id:mouse_area
|
|
|
|
|
hoverEnabled: true
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
onClicked: {
|
|
|
|
|
root.clicked()
|
|
|
|
|
root.parent.closePopup()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-03-02 18:21:43 +08:00
|
|
|
|
}
|