mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-05 01:25:25 +08:00
update
This commit is contained in:
@ -14,15 +14,31 @@ Switch {
|
||||
width: root.width
|
||||
height: root.height
|
||||
radius: height / 2
|
||||
color: root.checked ? checkedColor : "white"
|
||||
color: {
|
||||
if(FluApp.isDark){
|
||||
if(root.checked){
|
||||
return checkedColor
|
||||
}
|
||||
if(switch_mouse.containsMouse){
|
||||
return "#3E3E3C"
|
||||
}
|
||||
return "#323232"
|
||||
}else{
|
||||
if(switch_mouse.containsMouse){
|
||||
return "#F4F4F4"
|
||||
}
|
||||
return root.checked ? checkedColor : "white"
|
||||
}
|
||||
}
|
||||
border.width: 1
|
||||
border.color: root.checked ? checkedColor : "#666666"
|
||||
|
||||
Rectangle {
|
||||
x: root.checked ? parent.width - width - 4 : 4
|
||||
width: root.checked ? parent.height - 8 : parent.height - 8
|
||||
height: width
|
||||
x: root.checked ? root.implicitWidth - width - 4 : 4
|
||||
width: root.height - 8
|
||||
height: root.height - 8
|
||||
radius: width / 2
|
||||
scale: switch_mouse.containsMouse ? 1.2 : 1.0
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: root.checked ? "#FFFFFF" : "#666666"
|
||||
// border.color: "#D5D5D5"
|
||||
|
@ -13,9 +13,21 @@ Rectangle {
|
||||
}
|
||||
property string title: "FluentUI"
|
||||
|
||||
Behavior on opacity{
|
||||
NumberAnimation{
|
||||
duration: 100
|
||||
}
|
||||
}
|
||||
|
||||
property var window : {
|
||||
if(Window.window == null)
|
||||
return null
|
||||
return Window.window
|
||||
}
|
||||
|
||||
onIsMaxChanged: {
|
||||
if(isMax){
|
||||
root.anchors.margins = 4
|
||||
root.anchors.margins = 8
|
||||
root.anchors.fill = parent
|
||||
}else{
|
||||
root.anchors.margins = 0
|
||||
@ -26,7 +38,17 @@ Rectangle {
|
||||
color : FluApp.isDark ? "#202020" : "#F3F3F3"
|
||||
|
||||
Component.onCompleted: {
|
||||
console.debug("onCompleted")
|
||||
}
|
||||
|
||||
Connections{
|
||||
target: FluApp
|
||||
function onWindowReady(view){
|
||||
if(FluApp.equalsWindow(view,window)){
|
||||
helper.initWindow(view);
|
||||
helper.setTitle(title);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WindowHelper{
|
||||
|
Reference in New Issue
Block a user