mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-03 08:35:28 +08:00
update
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import QtQuick 2.15
|
||||
import FluentUI 1.0
|
||||
|
||||
Rectangle {
|
||||
|
||||
@ -8,16 +9,23 @@ Rectangle {
|
||||
|
||||
property int iconSize: 20
|
||||
property int icon
|
||||
property color iconColor: "#000000"
|
||||
property alias text: tool_tip.text
|
||||
signal clicked
|
||||
property bool disabled: false
|
||||
|
||||
radius: 4
|
||||
|
||||
color: {
|
||||
if(FluApp.isDark){
|
||||
return button_mouse.containsMouse ? "#000000" : "#00000000"
|
||||
if(disabled){
|
||||
return Qt.rgba(59/255,59/255,59/255,1)
|
||||
}
|
||||
return button_mouse.containsMouse ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(50/255,50/255,50/255,1)
|
||||
}else{
|
||||
return button_mouse.containsMouse ? "#F4F4F4" : "#00000000"
|
||||
if(disabled){
|
||||
return Qt.rgba(1,1,1,1)
|
||||
}
|
||||
return button_mouse.containsMouse ? Qt.rgba(244/255,244/255,244/255,1) : Qt.rgba(1,1,1,1)
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +36,19 @@ Rectangle {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
anchors.centerIn: parent
|
||||
color: iconColor
|
||||
color:{
|
||||
if(FluApp.isDark){
|
||||
if(disabled){
|
||||
return Qt.rgba(130/255,130/255,130/255,1)
|
||||
}
|
||||
return Qt.rgba(1,1,1,1)
|
||||
}else{
|
||||
if(disabled){
|
||||
return Qt.rgba(161/255,161/255,161/255,1)
|
||||
}
|
||||
return Qt.rgba(0,0,0,1)
|
||||
}
|
||||
}
|
||||
text: (String.fromCharCode(icon).toString(16));
|
||||
}
|
||||
|
||||
@ -36,9 +56,21 @@ Rectangle {
|
||||
id:button_mouse
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
enabled: !disabled
|
||||
onClicked: {
|
||||
button.clicked()
|
||||
}
|
||||
}
|
||||
|
||||
FluTooltip{
|
||||
id:tool_tip
|
||||
visible: {
|
||||
if(button.text === ""){
|
||||
return false
|
||||
}
|
||||
return button_mouse.containsMouse
|
||||
}
|
||||
delay: 1000
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user