mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-03 08:35:28 +08:00
update
This commit is contained in:
@ -2,19 +2,43 @@
|
||||
|
||||
Rectangle {
|
||||
|
||||
width: text.implicitWidth
|
||||
height: text.implicitHeight
|
||||
id:button
|
||||
width: 30
|
||||
height: 30
|
||||
|
||||
property int iconSize: 20
|
||||
property int icon
|
||||
property color iconColor: "#000000"
|
||||
signal clicked
|
||||
|
||||
radius: 4
|
||||
|
||||
color: {
|
||||
if(FluApp.isDark){
|
||||
return button_mouse.containsMouse ? "#000000" : "#00000000"
|
||||
}else{
|
||||
return button_mouse.containsMouse ? "#F4F4F4" : "#00000000"
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
id:text
|
||||
id:text_icon
|
||||
font.family: "fontawesome"
|
||||
font.pixelSize: 16
|
||||
font.pixelSize: iconSize
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
// text:icon
|
||||
anchors.centerIn: parent
|
||||
color: iconColor
|
||||
text: (String.fromCharCode(icon).toString(16));
|
||||
}
|
||||
|
||||
MouseArea{
|
||||
id:button_mouse
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
button.clicked()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user